]>
Commit | Line | Data |
---|---|---|
3d28cc10 | 1 | # Conditional build: |
3d28cc10 | 2 | %bcond_without kernel # don't build kernel modules |
6f7075bf | 3 | %bcond_without userspace # don't build userspace tools |
3d28cc10 | 4 | |
6f7075bf JP |
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 | |
3d28cc10 | 8 | %endif |
3d28cc10 | 9 | |
6f7075bf | 10 | %define rel 1 |
3d28cc10 | 11 | %define pname acpi_call |
3d28cc10 | 12 | Summary: A linux kernel module that enables calls to ACPI methods through /proc/acpi/call |
6f7075bf | 13 | Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel} |
1cfa4a89 | 14 | Version: 1.1.0 |
6f7075bf | 15 | Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}} |
3d28cc10 SS |
16 | License: GPL v2 |
17 | Group: Base/Kernel | |
a6f339c0 | 18 | Source0: https://github.com/mkottman/acpi_call/archive/v%{version}/%{pname}-%{version}.tar.gz |
1cfa4a89 | 19 | # Source0-md5: f69d40e130b0e5ed17ce8adb19e6dda1 |
16da86e8 | 20 | Patch0: %{pname}-build.patch |
3d28cc10 | 21 | URL: https://github.com/mkottman/acpi_call |
6f7075bf JP |
22 | %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}} |
23 | BuildRequires: rpmbuild(macros) >= 1.701 | |
3d28cc10 SS |
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 | |
6f7075bf | 29 | /proc/acpi/call. |
3d28cc10 | 30 | |
64154a1f JP |
31 | %package -n %{pname}-scripts |
32 | Summary: This package contains sample scripts for acpi_call kernel module | |
33 | Group: Applications/System | |
64154a1f | 34 | BuildArch: noarch |
64154a1f JP |
35 | |
36 | %description -n %{pname}-scripts | |
37 | This package contains sample scripts for acpi_call kernel module. | |
38 | ||
6f7075bf JP |
39 | %define kernel_pkg()\ |
40 | %package -n kernel%{_alt_kernel}-misc-acpi_call\ | |
41 | Summary: A linux kernel module that enables calls to ACPI methods through /proc/acpi/call\ | |
42 | Release: %{rel}@%{_kernel_ver_str}\ | |
43 | Group: Base/Kernel\ | |
44 | Requires(post,postun): /sbin/depmod\ | |
45 | %requires_releq_kernel\ | |
46 | Requires(postun): %releq_kernel\ | |
47 | \ | |
48 | %description -n kernel%{_alt_kernel}-misc-acpi_call\ | |
49 | A linux kernel module that enables calls to ACPI methods through\ | |
50 | /proc/acpi/call.\ | |
51 | %files -n kernel%{_alt_kernel}-misc-acpi_call\ | |
52 | %defattr(644,root,root,755)\ | |
53 | %doc README.md\ | |
54 | /lib/modules/%{_kernel_ver}/misc/acpi_call.ko*\ | |
55 | \ | |
56 | %post -n kernel%{_alt_kernel}-misc-acpi_call\ | |
57 | %depmod %{_kernel_ver}\ | |
58 | \ | |
59 | %postun -n kernel%{_alt_kernel}-misc-acpi_call\ | |
60 | %depmod %{_kernel_ver}\ | |
61 | %{nil} | |
3d28cc10 | 62 | |
6f7075bf JP |
63 | %define build_kernel_pkg()\ |
64 | %build_kernel_modules -m acpi_call\ | |
65 | %install_kernel_modules -D installed -m acpi_call -d misc\ | |
66 | %{nil} | |
67 | ||
68 | %{?with_kernel:%{expand:%create_kernel_packages}} | |
3d28cc10 SS |
69 | |
70 | %prep | |
6f7075bf | 71 | %setup -q -n %{pname}-%{version} |
16da86e8 | 72 | %patch0 -p1 |
3d28cc10 SS |
73 | |
74 | %build | |
6f7075bf | 75 | %{?with_kernel:%{expand:%build_kernel_packages}} |
3d28cc10 SS |
76 | |
77 | %install | |
78 | rm -rf $RPM_BUILD_ROOT | |
3d28cc10 | 79 | |
6f7075bf | 80 | install -d $RPM_BUILD_ROOT |
64154a1f JP |
81 | |
82 | %if %{with userspace} | |
83 | install -d $RPM_BUILD_ROOT%{_datadir}/acpi_call | |
84 | cp -a examples/* $RPM_BUILD_ROOT%{_datadir}/acpi_call | |
85 | %endif | |
86 | ||
87 | %if %{with kernel} | |
6f7075bf | 88 | cp -a installed/* $RPM_BUILD_ROOT |
3d28cc10 | 89 | %endif |
6f7075bf JP |
90 | |
91 | %clean | |
92 | rm -rf $RPM_BUILD_ROOT | |
64154a1f | 93 | |
28ff8845 | 94 | %if %{with userspace} |
64154a1f JP |
95 | %files -n %{pname}-scripts |
96 | %defattr(644,root,root,755) | |
b95a005d | 97 | %dir %{_datadir}/acpi_call |
64154a1f | 98 | %attr(755,root,root) %{_datadir}/acpi_call/*.sh |
28ff8845 | 99 | %endif |