acpid-vl.spec 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. %bcond_with systemd
  2. Summary: ACPI Event Daemon
  3. Summary(ja): ACPI イベントデーモン
  4. Name: acpid
  5. Version: 2.0.32
  6. Release: 1%{?_dist_release}%{?with_systemd:.systemd}
  7. Group: System Environment/Daemons
  8. Vendor: Project Vine
  9. Distribution: Vine Linux
  10. Packager: daisuke
  11. License: GPL
  12. URL: https://sourceforge.net/projects/acpid2/
  13. Source: https://downloads.sourceforge.net/project/acpid2/acpid-%{version}.tar.xz
  14. Source1: acpid.init
  15. Source2: acpid.video.conf
  16. Source3: acpid.power.conf
  17. Source4: acpid.power.sh
  18. Source6: acpid.sysconfig
  19. Source7: acpid.service
  20. Source8: acpid.socket
  21. # https://sourceforge.net/p/acpid2/tickets/14/
  22. Patch0: acpid-2.0.32-kacpimon-dynamic-connections.patch
  23. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  24. %if %{with systemd}
  25. BuildRequires: systemd
  26. Requires(post): systemd
  27. Requires(preun): systemd
  28. Requires(postun): systemd
  29. Requires: systemd
  30. %else
  31. Requires(post): chkconfig
  32. Requires(preun): chkconfig, initscripts
  33. %endif
  34. ExclusiveArch: x86_64 %{ix86}
  35. %description
  36. acpid is a daemon that dispatches ACPI events to user-space programs.
  37. (bug reports to sunthockin@users.sourceforge.net)
  38. %description -l ja
  39. acpidはACPIイベントをユーザスペースのプログラムへ素早く伝えるデーモンです。
  40. (バグレポートはsunthockin@users.sourceforge.netに送ってください)
  41. %prep
  42. %setup -q
  43. %patch0 -p1 -b .kacpimon-dynamic-connections
  44. %build
  45. %configure
  46. make %{?_smp_mflags} CFLAGS="%{optflags} %{?harden}"
  47. %install
  48. rm -rf %{buildroot}
  49. mkdir -p %{buildroot}
  50. make install DESTDIR=%{buildroot}
  51. mkdir -p %{buildroot}%{_sysconfdir}/acpi/events
  52. mkdir -p %{buildroot}%{_sysconfdir}/acpi/actions
  53. mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
  54. chmod 755 %{buildroot}%{_sysconfdir}/acpi/events
  55. install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/acpi/events/video
  56. install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/acpi/events/power
  57. install -m 755 %{SOURCE4} %{buildroot}%{_sysconfdir}/acpi/actions/power.sh
  58. install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sysconfig/acpid
  59. %if %{with systemd}
  60. mkdir -p %{buildroot}%{_unitdir}
  61. install -p -m 644 %{SOURCE7} %{SOURCE8} %{buildroot}%{_unitdir}
  62. %else
  63. mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
  64. install -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/rc.d/init.d/acpid
  65. %endif
  66. rm -rf %{buildroot}%{_docdir}/%{name}
  67. %clean
  68. rm -rf %{buildroot}
  69. %post
  70. %if %{with systemd}
  71. %systemd_post %{name}.socket %{name}.service
  72. %else
  73. # only run on install, not upgrade
  74. if [ "$1" = "1" ]; then
  75. /sbin/chkconfig --add acpid
  76. fi
  77. if [ -e /var/log/acpid ]; then
  78. touch /var/log/acpid
  79. fi
  80. %endif
  81. %postun
  82. %if %{with systemd}
  83. %systemd_postun_with_restart %{name}.socket %{name}.service
  84. %else
  85. if [ "$1" -ge "1" ]; then
  86. /sbin/service acpid condrestart >/dev/null 2>&1
  87. fi
  88. %endif
  89. %preun
  90. %if %{with systemd}
  91. %systemd_preun %{name}.socket %{name}.service
  92. %else
  93. # only run if this is the last instance to be removed
  94. if [ "$1" = "0" ]; then
  95. /sbin/service acpid stop > /dev/null 2>&1
  96. /sbin/chkconfig --del acpid
  97. rm -f /var/run/acpid.socket
  98. fi
  99. %endif
  100. %files
  101. %defattr(-,root,root)
  102. %license COPYING
  103. %doc Changelog README TODO samples
  104. %dir %{_sysconfdir}/acpi
  105. %dir %{_sysconfdir}/acpi/events
  106. %dir %{_sysconfdir}/acpi/actions
  107. %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/acpi/events/video
  108. %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/acpi/events/power
  109. %config(noreplace) %attr(0755,root,root) %{_sysconfdir}/acpi/actions/power.sh
  110. %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/sysconfig/acpid
  111. %{_bindir}/acpi_listen
  112. %{_sbindir}/acpid
  113. %{_sbindir}/kacpimon
  114. %{_mandir}/man8/acpid.8*
  115. %{_mandir}/man8/acpi_listen.8*
  116. %{_mandir}/man8/kacpimon.8*
  117. %if %{with systemd}
  118. %{_unitdir}/%{name}.service
  119. %{_unitdir}/%{name}.socket
  120. %else
  121. %attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/acpid
  122. %endif
  123. %changelog
  124. * Sat Apr 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.32-1
  125. - new upstream release.
  126. - updated Patch0.
  127. * Sat Feb 09 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.30-1
  128. - new upstream release.
  129. - updated Source4 to support elogind.
  130. * Thu Feb 22 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.28-1
  131. - new upstream release.
  132. - updated Source4.
  133. - imported Patch0 from rawhide.
  134. * Fri Oct 05 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.0.17-1
  135. - new upstream release
  136. - remove Patch1 (acpid-2.0.2-makefile.patch)
  137. * Wed Feb 15 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0.14-1
  138. - new upstream release
  139. * Wed Nov 23 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.0.13-1
  140. - new upstream release
  141. - change filename in /etc/acpi/events
  142. * Sun Apr 17 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0.8-1
  143. - new upstream release
  144. - add acpid.sysconfig
  145. * Tue Mar 16 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0.2-1
  146. - new upstream release
  147. * Sat May 9 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 1.0.10-1
  148. - new upstream release: fixes CVE-2009-0798 (too many open files DoS)
  149. - fix power.sh (Source4) to work with ConsoleKit >= 0.3.0
  150. (ck-list-sessions now returns 'unix-user' instead of 'uid')
  151. without this fix, pressing power key will always goes to shutdown
  152. even if gnome-power-manager is active and running
  153. - add ExclusiveArch: x86_64 %%{ix86}
  154. * Mon Aug 11 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0.6-4
  155. - add patch10 to ignore .rpmnew file
  156. - add power button handling script and config
  157. - import some patches from fedora
  158. - add rpm's optflags to makefile
  159. - Fixed leak of a file descriptor
  160. - Fixed dumping useless info to log
  161. * Mon Aug 11 2008 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 1.0.6-3
  162. - spec in UTF-8
  163. - adjust start/stop priority not to conflict with HAL
  164. * Sun Apr 06 2008 Kazutaka HARADA <Kazutaka@dc4.so-net.ne.jp> 1.0.6-2
  165. - rebuild
  166. - apply new versioning policy
  167. * Sun Jul 1 2007 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 1.0.6-1vl2
  168. - remove %%{_sysconfdir}/logrotate.d/acpid from files
  169. (from this version, syslog is used for logging)
  170. - remove Source2 (from this version, syslog is used for logging)
  171. * Sun Jul 1 2007 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 1.0.6-1vl1
  172. - upstream release
  173. - update Source0 URL
  174. - drop Patch0 (merged into upstream source)
  175. - drop Patch1 (solved in another way on upstream source)
  176. * Sat May 26 2007 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 1.0.4-1vl3
  177. - add Patch1 to rebuild with new toolchain
  178. * Sat Nov 04 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0.4-1vl2
  179. - update acpid.init
  180. - check if ACPI interface is available or not. (<BTS:216>)
  181. * Thu Oct 21 2004 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 1.0.4-1vl1
  182. - upstream release
  183. - move sample.conf to %doc
  184. - add some new sample scripts to %doc
  185. - MEMO: file acpid-bindir.patch will be unnecessary in next upstream release,
  186. since the patch is accepted in upstream CVS
  187. * Thu Sep 23 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.0.3-1vl4
  188. - changed Group:
  189. - added %clean section
  190. * Wed Jul 21 2004 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 1.0.3-1vl3
  191. - changed redhat/acpid.init tarball into text file
  192. - added Source2: logrotate support
  193. * Thu Jun 24 2004 KANEKO Seiji <giraffe@m2.pbc.ne.jp> 1.0.3-1vl2
  194. - upstream release
  195. - extract redhat/acpid.init from acpid-1.0.2.tar.gz tarball
  196. - patch Makefile to mkdir %BINDIR before install
  197. - added Japanese Summary
  198. - remove /var/run/acpid.socket at preun
  199. - delete previously commented scripts
  200. * Sun Dec 21 2003 KAZUKI SHIMURA <rito@pos.to> 1.0.2-1vl3
  201. - removed name/version/release macros
  202. - added vendor/distribution tag
  203. - added %%doc (merged with 1.0.2-1vl2 in VinePlus/2.5)
  204. - removed needless chmod/attr
  205. - stop service before uninstall
  206. * Fri Nov 14 2003 Satoshi MACHINO <machino@vinelinux.org> 1.0.2-1vl2
  207. - rebuilt for Vine Seed
  208. - added japanese description
  209. - changed from Copylight to License
  210. * Sun Nov 2 2003 KANEKO Seiji <giraffe@m2.pbc.ne.jp>
  211. - 1.0.2-1vl1
  212. - Removed prefix definition
  213. - Remove /var/log/acpid from package file
  214. * Thu Aug 21 2003 KANEKO Seiji <giraffe@m2.pbc.ne.jp>
  215. - 1.0.2-1vl0.1
  216. - Spec file modified for Vine Linux 2.6r1
  217. * Tue May 13 2003 Tim Hockin <thockin@sun.com>
  218. - Fixed a dumb bug with %e expansion for commands
  219. - Add COPYING file
  220. - Add TODO file
  221. * Fri Mar 15 2002 Tim Hockin <thockin@sun.com>
  222. - Updated RPM spec with patch from sun for chkconfig on/off
  223. - Add Changelog, make 'make rpm' use it.
  224. - 1.0.1
  225. * Wed Mar 13 2002 Tim Hockin <thockin@sun.com>
  226. - Fixed logging bug - not appending to log (O_APPEND needed)
  227. - Fix 'make install' to not need root access
  228. - Fix RPM spec to not need root
  229. * Thu Sep 6 2001 Tim Hockin <thockin@sun.com>
  230. - 1.0.0
  231. * Thu Aug 16 2001 Tim Hockin <thockin@sun.com>
  232. - Added commandline options to actions
  233. * Wed Aug 15 2001 Tim Hockin <thockin@sun.com>
  234. - Added UNIX domain socket support
  235. - Changed /etc/acpid.d to /etc/acpid/events
  236. * Mon Aug 13 2001 Tim Hockin <thockin@sun.com>
  237. - added changelog
  238. - 0.99.1-1