systemd switch [release 2.0.23-2mamba;Thu Feb 12 2015]

This commit is contained in:
Silvan Calarco 2024-01-05 20:12:05 +01:00
parent 008d1030fe
commit 07f87dc953
2 changed files with 38 additions and 16 deletions

9
acpid.service Normal file
View File

@ -0,0 +1,9 @@
[Unit]
Description=ACPI event daemon
Documentation=man:acpid(8)
[Service]
ExecStart=/usr/sbin/acpid --foreground --netlink
[Install]
WantedBy=multi-user.target

View File

@ -1,6 +1,6 @@
Name: acpid
Version: 2.0.23
Release: 1mamba
Release: 2mamba
Summary: The ACPI event daemon
Group: System/Kernel and Hardware
Vendor: openmamba
@ -10,11 +10,13 @@ URL: http://sourceforge.net/projects/acpid2
Source0: http://downloads.sourceforge.net/project/acpid2/acpid-%{version}.tar.xz
Source1: acpid-initscript
Source2: acpi-sysconfig
Source3: acpid.service
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
## AUTOBUILDREQ-END
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%systemd_requires
Requires(pre): chkconfig
Requires(pre): sed
@ -33,8 +35,8 @@ The programs it executes are configured through a set of configuration files, wh
%install
%makeinstall
install -D -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/acpid
install -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/acpi
#install -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/acpi
install -D -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/acpid.service
install -d -m 755 %{buildroot}/etc/acpi/events
#install -m 644 samples/sample.conf %{buildroot}/etc/acpi/events
@ -49,20 +51,27 @@ chmod 640 %{buildroot}/var/log/acpid
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post
if [ $1 -eq 1 ]; then
# new install
chkconfig --add acpid
%systemd_post acpid
systemctl -q daemon-reload
if [ $1 -eq 1 -o -e /etc/rc5.d/S44acpid ]; then
systemctl -q enable acpid
systemctl -q start acpid
fi
[ -e %{_sysconfdir}/sysconfig/acpi ] && sed -i "/CPU_FREQ=.*/d" %{_sysconfdir}/sysconfig/acpi
exit 0
#[ -e %{_sysconfdir}/sysconfig/acpi ] && sed -i "/CPU_FREQ=.*/d" %{_sysconfdir}/sysconfig/acpi
:
%preun
if [ $1 -eq 0 ]; then
# erase
chkconfig --del acpid
service acpid stop
fi
exit 0
%systemd_preun acpid
:
%postun
%systemd_postun acpid
:
%posttrans
# clean broken old sysv links
find /etc/rc[0-6].d/ -type l -xtype l -exec rm -f {} \;
:
%files
%defattr(-,root,root)
@ -70,11 +79,12 @@ exit 0
%dir %{_sysconfdir}/acpi/events
%dir %{_sysconfdir}/acpi/actions
#%attr(0644,root,root) %{_sysconfdir}/acpi/events/sample.conf
%attr(0755,root,root) %{_initrddir}/acpid
%config(noreplace) %{_sysconfdir}/sysconfig/acpi
#%attr(0755,root,root) %{_initrddir}/acpid
#%config(noreplace) %{_sysconfdir}/sysconfig/acpi
%{_bindir}/acpi_listen
%{_sbindir}/acpid
%{_sbindir}/kacpimon
%{_unitdir}/acpid.service
%{_localstatedir}/log/acpid
%{_mandir}/man8/acpi_listen.8*
%{_mandir}/man8/acpid.8*
@ -83,6 +93,9 @@ exit 0
%{_datadir}/doc/acpid/*
%changelog
* Thu Feb 12 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 2.0.23-2mamba
- systemd switch
* Sun Aug 24 2014 Automatic Build System <autodist@mambasoft.it> 2.0.23-1mamba
- automatic version update by autodist