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