]> git.pld-linux.org Git - packages/acpi_call.git/blob - acpi_call.spec
use new kernel macros
[packages/acpi_call.git] / acpi_call.spec
1 # Conditional build:
2 %bcond_without  kernel          # don't build kernel modules
3 %bcond_without  userspace       # don't build userspace tools
4
5 %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
6 %{error:kernel and userspace cannot be built at the same time on PLD builders}
7 exit 1
8 %endif
9
10 %define         rel     1
11 %define         pname   acpi_call
12 Summary:        A linux kernel module that enables calls to ACPI methods through /proc/acpi/call
13 Name:           %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
14 Version:        1.1.0
15 Release:        %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
16 License:        GPL v2
17 Group:          Base/Kernel
18 Source0:        https://github.com/mkottman/acpi_call/archive/v%{version}/%{pname}-%{version}.tar.gz
19 # Source0-md5:  f69d40e130b0e5ed17ce8adb19e6dda1
20 Patch0:         %{pname}-build.patch
21 URL:            https://github.com/mkottman/acpi_call
22 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
23 BuildRequires:  rpmbuild(macros) >= 1.701
24 ExclusiveArch:  %{ix86} %{x8664}
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %description
28 A linux kernel module that enables calls to ACPI methods through
29 /proc/acpi/call.
30
31 %define kernel_pkg()\
32 %package -n kernel%{_alt_kernel}-misc-acpi_call\
33 Summary:        A linux kernel module that enables calls to ACPI methods through /proc/acpi/call\
34 Release:        %{rel}@%{_kernel_ver_str}\
35 Group:          Base/Kernel\
36 Requires(post,postun):  /sbin/depmod\
37 %requires_releq_kernel\
38 Requires(postun):       %releq_kernel\
39 \
40 %description -n kernel%{_alt_kernel}-misc-acpi_call\
41 A linux kernel module that enables calls to ACPI methods through\
42 /proc/acpi/call.\
43 %files -n kernel%{_alt_kernel}-misc-acpi_call\
44 %defattr(644,root,root,755)\
45 %doc README.md\
46 /lib/modules/%{_kernel_ver}/misc/acpi_call.ko*\
47 \
48 %post   -n kernel%{_alt_kernel}-misc-acpi_call\
49 %depmod %{_kernel_ver}\
50 \
51 %postun -n kernel%{_alt_kernel}-misc-acpi_call\
52 %depmod %{_kernel_ver}\
53 %{nil}
54
55 %define build_kernel_pkg()\
56 %build_kernel_modules -m acpi_call\
57 %install_kernel_modules -D installed -m acpi_call -d misc\
58 %{nil}
59
60 %{?with_kernel:%{expand:%create_kernel_packages}}
61
62 %prep
63 %setup -q -n %{pname}-%{version}
64 %patch0 -p1
65
66 %build
67 %{?with_kernel:%{expand:%build_kernel_packages}}
68
69 %install
70 rm -rf $RPM_BUILD_ROOT
71
72 %if %{with kernel}
73 install -d $RPM_BUILD_ROOT
74 cp -a installed/* $RPM_BUILD_ROOT
75 %endif
76
77 %clean
78 rm -rf $RPM_BUILD_ROOT
This page took 0.095663 seconds and 4 git commands to generate.