/[smeserver]/builds_bin/macros
ViewVC logotype

Contents of /builds_bin/macros

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


Revision 1.4 - (show annotations) (download)
Mon Dec 18 22:21:39 2006 UTC (17 years, 11 months ago) by slords
Branch: MAIN
Changes since 1.3: +15 -0 lines
Add xen and new kmod_kernel definition

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 %dist .el%{distversion}.sme
18 %smerelease() %(echo "%{?1}%{?dist}.%{?2}" | sed -e's|\\.$||')
19
20 #---------------------------------------------------------------------
21
22 %evr %{?epoch:%{epoch}:}%{version}-%{release}
23
24 %_kversion %(ls /usr/src/kernels/ | sed -n 's|^\\([^-]\\+-[^-]\\+\\)-.*|\\1|p' | tail -1)
25 %_krelver %(echo "%{_kversion}" | sed -e 's|-|_|g')
26
27 %kmod_kernelsrcdir() %(echo "/usr/src/kernels/%{_kversion}-%{?1}-%{_target_cpu}" | sed -e's|--|-|')
28 %kmod_moduledir() /lib/modules/%{_kversion}%{?1}/updates
29
30 %_with_smp %(test -d %{kmod_kernelsrcdir smp} && echo 1 || echo 0)
31 %_with_hugemem %(test -d %{kmod_kernelsrcdir hugemem} && echo 1 || echo 0)
32 %_with_xen0 %(test -d %{kmod_kernelsrcdir xen0} && echo 1 || echo 0)
33 %_with_xenU %(test -d %{kmod_kernelsrcdir xenU} && echo 1 || echo 0)
34 %_with_xen %(test -d %{kmod_kernelsrcdir xen} && echo 1 || echo 0)
35
36 %kmod() \
37 %{expand:%%global _kmodname %1} \
38 %{expand:%%global _kmodversion %2} \
39 %{expand:%%global _kmodrelease %3} \
40 Name: kmod-%{_kmodname} \
41 Version: %{_kmodversion} \
42 Release: %{_kmodrelease}.%{_krelver} \
43 Packager: %{_packager} \
44 License: GPL \
45 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(id -u -n)-root
46
47 %kmod_kernel() \
48 %{expand:%%if %%{_with_%1}}\
49 %package %1 \
50 %{expand:%%kmod_dependencies %1} \
51 %{expand:%%kmod_desc %1} \
52 %{expand:%%kmod_scripts %1} \
53 %files %1 \
54 %defattr(-, root, root, -) \
55 %{expand:%%kmod_moduledir %1} \
56 %endif \
57 %{nil}
58
59 %kmod_dependencies() \
60 Summary: %{_kmodname} kernel module(s) \
61 Group: System Environment/Kernel \
62 BuildRequires: gcc \
63 BuildRequires: %(echo "kernel-%{?1}-devel" | sed -e's|--|-|') = %{_kversion} \
64 Requires: /sbin/depmod \
65 Requires: %(echo "kernel-%{?1}-%{_target_cpu}" | sed -e's|--|-|') = %{_kversion} \
66 Provides: %{_kmodname}-kmod = %{evr} \
67 Provides: kernel-modules = %{_kversion}%{?1} \
68 Provides: %(echo "kmod-%{_kmodname}-%{?1}" | sed -e's|-$||') = %{evr}
69
70 %kmod_desc() \
71 %description %{?1}\
72 This package provides the %{_kmodname} kernel modules built for the Linux \
73 kernel %{_kversion}%{?1} for the %{_target_cpu} family of processors.
74
75 %kmod_scripts() \
76 %post %{?1} \
77 depmod -aeF /boot/System.map-%{_kversion}%{?1} %{_kversion}%{?1} > /dev/null 2>&1 || : \
78 %postun %{?1} \
79 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