/[smeserver]/builds_bin/macros
ViewVC logotype

Annotation of /builds_bin/macros

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (hide annotations) (download)
Fri Dec 29 01:56:32 2006 UTC (17 years, 11 months ago) by slords
Branch: MAIN
Changes since 1.5: +4 -2 lines
Updates to support kmdl packages

1 slords 1.1 ## Build directory
2     %_topdir %(echo $HOME)/rpms
3    
4     %_signature gpg
5     %_gpg_name SME Server 7 signing key <bugteam@contribs.org>
6     %_gpgbin /usr/bin/gpg
7    
8     %_packager SME Server, Inc. <http://smeserver.org>
9    
10     ## Disable the -debug symbol packages
11     %debug_package %{nil}
12    
13     # Compiler optimizations
14     %_smp_mflags -j5
15    
16     %distversion %(rpm -qf --qf='%{VERSION}' /etc/redhat-release)
17 slords 1.3 %dist .el%{distversion}.sme
18 slords 1.6 %smerelease() %1%{dist}%{?2:.%2}
19 slords 1.1
20     #---------------------------------------------------------------------
21    
22     %evr %{?epoch:%{epoch}:}%{version}-%{release}
23    
24     %_kversion %(ls /usr/src/kernels/ | sed -n 's|^\\([^-]\\+-[^-]\\+\\)-.*|\\1|p' | tail -1)
25 slords 1.5
26     %kmdl_kernelsrcdir() /usr/src/kernels/%{_kversion}%{?1:-%1}-%{_target_cpu}
27     %kmdl_moduledir() /lib/modules/%{_kversion}%{?1}/updates
28    
29     %_with_smp %(test -d %{kmdl_kernelsrcdir smp} && echo 1 || echo 0)
30     %_with_hugemem %(test -d %{kmdl_kernelsrcdir hugemem} && echo 1 || echo 0)
31     %_with_largesmp %(test -d %{kmdl_kernelsrcdir largesmp} && echo 1 || echo 0)
32     %_with_xen0 %(test -d %{kmdl_kernelsrcdir xen0} && echo 1 || echo 0)
33     %_with_xenU %(test -d %{kmdl_kernelsrcdir xenU} && echo 1 || echo 0)
34     %_with_xen %(test -d %{kmdl_kernelsrcdir xen} && echo 1 || echo 0)
35    
36 slords 1.6 %kmdl(r:) \
37     %{-r:%{expand:%%define _kmdlrelease %{-r*}}} \
38 slords 1.5 %kmdl_kernel \
39     %kmdl_kernel smp \
40     %kmdl_kernel hugemem \
41     %kmdl_kernel largesmp \
42     %kmdl_kernel xen0 \
43     %kmdl_kernel xenU \
44     %kmdl_kernel xen
45    
46     %kmdl_kernel() \
47     %{?1:%{expand:%%if %%{_with_%1}}} \
48     %package kmdl-%{_kversion}%{?1} \
49     Summary: %{name} kernel%{?1:-%1} module(s) \
50 slords 1.6 %{?_kmdlrelease:Release: %{_kmdlrelease}} \
51 slords 1.5 Group: System Environment/Kernel \
52     BuildRequires: gcc \
53     BuildRequires: kernel%{?1:-%1}-devel = %{_kversion} \
54     Requires: /sbin/depmod \
55     Requires: /boot/vmlinuz-%{_kversion}%{?1} \
56     Requires: kernel%{?1:-%1}-%{_target_cpu} = %{_kversion} \
57     Obsoletes: kmod-%{name}%{?1:-%1} \
58     Obsoletes: kernel%{?1:-%1}-module-%{name} \
59     Provides: %{name}-kmdl-%{evr} \
60     Provides: %{name}-kmdl-%{_kversion}%{?1} = %{evr} \
61     %description kmdl-%{_kversion}%{?1} \
62     This package provides the %{name} kernel modules built for the Linux \
63     kernel %{_kversion}%{?1} for the %{_target_cpu} family of processors. \
64     %post kmdl-%{_kversion}%{?1} \
65     depmod -aeF /boot/System.map-%{_kversion}%%{?1} %{_kversion}%%{?1} > /dev/null 2>&1 || : \
66     %postun kmdl-%{_kversion}%{?1} \
67     depmod -aeF /boot/System.map-%{_kversion}%%{?1} %{_kversion}%%{?1} > /dev/null 2>&1 || : \
68     %files kmdl-%{_kversion}%{?1} \
69     %defattr(-, root, root, -) \
70     %{expand:%%{kmdl_moduledir %{?1}}} \
71     %{?1:%endif} \
72     %{nil}
73    
74     #---------------------------------------------------------------------
75    
76 slords 1.1 %_krelver %(echo "%{_kversion}" | sed -e 's|-|_|g')
77    
78     %kmod_kernelsrcdir() %(echo "/usr/src/kernels/%{_kversion}-%{?1}-%{_target_cpu}" | sed -e's|--|-|')
79     %kmod_moduledir() /lib/modules/%{_kversion}%{?1}/updates
80    
81     %kmod() \
82     %{expand:%%global _kmodname %1} \
83     %{expand:%%global _kmodversion %2} \
84     %{expand:%%global _kmodrelease %3} \
85     Name: kmod-%{_kmodname} \
86     Version: %{_kmodversion} \
87     Release: %{_kmodrelease}.%{_krelver} \
88     Packager: %{_packager} \
89     License: GPL \
90     BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(id -u -n)-root
91    
92 slords 1.4 %kmod_kernel() \
93     %{expand:%%if %%{_with_%1}}\
94     %package %1 \
95     %{expand:%%kmod_dependencies %1} \
96     %{expand:%%kmod_desc %1} \
97     %{expand:%%kmod_scripts %1} \
98     %files %1 \
99     %defattr(-, root, root, -) \
100     %{expand:%%kmod_moduledir %1} \
101     %endif \
102     %{nil}
103    
104 slords 1.1 %kmod_dependencies() \
105     Summary: %{_kmodname} kernel module(s) \
106     Group: System Environment/Kernel \
107     BuildRequires: gcc \
108     BuildRequires: %(echo "kernel-%{?1}-devel" | sed -e's|--|-|') = %{_kversion} \
109     Requires: /sbin/depmod \
110     Requires: %(echo "kernel-%{?1}-%{_target_cpu}" | sed -e's|--|-|') = %{_kversion} \
111     Provides: %{_kmodname}-kmod = %{evr} \
112     Provides: kernel-modules = %{_kversion}%{?1} \
113     Provides: %(echo "kmod-%{_kmodname}-%{?1}" | sed -e's|-$||') = %{evr}
114    
115     %kmod_desc() \
116     %description %{?1}\
117     This package provides the %{_kmodname} kernel modules built for the Linux \
118     kernel %{_kversion}%{?1} for the %{_target_cpu} family of processors.
119    
120     %kmod_scripts() \
121     %post %{?1} \
122     depmod -aeF /boot/System.map-%{_kversion}%{?1} %{_kversion}%{?1} > /dev/null 2>&1 || : \
123     %postun %{?1} \
124     depmod -aeF /boot/System.map-%{_kversion}%{?1} %{_kversion}%{?1} > /dev/null 2>&1 || :

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed