pmud-vl.spec 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. %define _sysconfdir /etc
  2. %define pmudver 0.10
  3. %define pmudrel 1
  4. Name: pmud
  5. Version: %{pmudver}
  6. Release: %{pmudrel}vl15
  7. Summary: Power Manager daemon for Apple PowerBooks
  8. Summary(ja): PowerBook 用パワーマネージメントデーモン
  9. Source: http://prdownloads.sourceforge.net/apmud/pmud-%{pmudver}.%{pmudrel}.tar.gz
  10. Patch1: pmud_0.10-4.diff.gz
  11. Patch2: Batmon-comet.patch
  12. ## Vine Source(s)/Patch(es)
  13. Patch10: pmud-0.10-trackpad.patch
  14. Patch11: pmud-0.10-backlight.patch
  15. Patch12: pmud-0.10-comet.patch
  16. Patch13: pmud-0.10-pwrctl.patch
  17. Patch14: pmud-0.10-power.conf.patch
  18. Patch30: pmud-0.10-misc.patch
  19. License: GPL
  20. Group: Utilities/System
  21. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  22. Provides: apmd
  23. Prereq: chkconfig, coreutils
  24. ExclusiveArch: ppc
  25. Requires: hdparm
  26. Obsoletes: trackpad
  27. %description
  28. pmud is a daemon which periodically polls the PMU (power manager) and performs
  29. functions such as enabling or disabling devices appropriately when the power
  30. source changes. It can also be instructed to signal init(8) that a power-
  31. failure has occured.
  32. %description -l ja
  33. PMUD は Apple Powerbook のパワーマネージメントシステムを
  34. 制御するデーモンです。pmud は、PowerBook の蓋を閉じたり、
  35. バッテリの残り容量が 5分を切った時などに自動的にスリープします。
  36. マシンの負荷が高い時にはスリープは行われません。
  37. Batmon という Tcl ベースのユーティリティも付属しており、
  38. 現在のバッテリ状況をモニタしたり、ボタンを押すことで
  39. スリープさせたりすることが可能です。
  40. %package tools
  41. Summary: Several front end tools for PowerBooks
  42. Summary(ja): PowerBook 用各種フロントエンドツール
  43. Group: Utilities/System
  44. Obsoletes: gfblevel
  45. Provides: gfblevel
  46. %description tools
  47. Batmon - TK-based battery status monitor
  48. gfblevel - graphical front-end to set LCD backlight level
  49. xmouse - X mouse setting tool
  50. %description tools -l ja
  51. Batmon - tk ベースのバッテリ残量モニタ
  52. gfblevel - LCD バックライト調節を行うグラフィカルフロントエンド
  53. xmouse - X マウス設定ツール
  54. %prep
  55. %setup
  56. %patch1 -p1 -b .deb
  57. %patch2 -p1 -b .comet-bat
  58. %patch10 -p1
  59. %patch11 -p1
  60. %patch12 -p1 -b .comet
  61. %patch13 -p1
  62. %patch14 -p1
  63. %patch30 -p1
  64. %build
  65. make clean
  66. make
  67. make -C contrib clean
  68. make -C contrib
  69. # compile even contrib/fblevel_misc/gfblevel.c
  70. ( cd contrib/fblevel_misc;
  71. make clean;
  72. make && mv gfblevel ../../.
  73. )
  74. %install
  75. rm -rf ${RPM_BUILD_ROOT}
  76. # pmud binaries and conffiles
  77. mkdir -p ${RPM_BUILD_ROOT}%{_syssbindir}
  78. mkdir -p ${RPM_BUILD_ROOT}%{_sbindir}
  79. install -c pmud ${RPM_BUILD_ROOT}%{_syssbindir}
  80. install -c snooze ${RPM_BUILD_ROOT}%{_syssbindir}
  81. install -c wakebay ${RPM_BUILD_ROOT}%{_syssbindir}
  82. mkdir -p ${RPM_BUILD_ROOT}/etc/sysconfig
  83. install -m 0644 power.conf ${RPM_BUILD_ROOT}/etc/sysconfig/power
  84. mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/power
  85. install -c pwrctl ${RPM_BUILD_ROOT}%{_sysconfdir}/power
  86. mkfifo -m 644 ${RPM_BUILD_ROOT}%{_sysconfdir}/power/apm
  87. # We need our own default /etc/power/levels
  88. # The first value is the battery policy, the second value is
  89. # the AC policy. Valid values are 1 (minimum power consumption),
  90. # 2 (medium power consumption) and 3 (maximum power consumption).
  91. cat > ${RPM_BUILD_ROOT}%{_sysconfdir}/power/levels <<EOF
  92. 2 3
  93. EOF
  94. mkdir -p ${RPM_BUILD_ROOT}%{_initdir}
  95. #install -c pmud.rc.debian ${RPM_BUILD_ROOT}%{_initdir}/pmud
  96. install -c pmud.rc ${RPM_BUILD_ROOT}%{_initdir}/pmud
  97. mkdir -p $RPM_BUILD_ROOT%{_bindir}
  98. install -c on_ac_power ${RPM_BUILD_ROOT}%{_bindir}
  99. (cd $RPM_BUILD_ROOT%{_bindir} ; ln -sf ../../sbin/snooze apm)
  100. # pmud-utils binaries
  101. install -c Batmon ${RPM_BUILD_ROOT}%{_bindir}
  102. #install -c trackpad ${RPM_BUILD_ROOT}%{_bindir}
  103. install -c gfblevel ${RPM_BUILD_ROOT}%{_bindir}
  104. install -c fblevel ${RPM_BUILD_ROOT}%{_syssbindir}
  105. #install -c backlight ${RPM_BUILD_ROOT}%{_syssbindir}
  106. mkdir -p ${RPM_BUILD_ROOT}/usr/X11R6/bin
  107. install -c xmouse ${RPM_BUILD_ROOT}/usr/X11R6/bin
  108. # install man pages
  109. mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man8
  110. install -m 644 pmud.8 fblevel.8 snooze.8 xmouse.8 \
  111. ${RPM_BUILD_ROOT}%{_mandir}/man8
  112. install -m 644 batmon.8 \
  113. ${RPM_BUILD_ROOT}%{_mandir}/man8/Batmon.8
  114. make PREFIX=${RPM_BUILD_ROOT} -C contrib install
  115. make -C contrib clean
  116. %clean
  117. rm -rf $RPM_BUILD_ROOT
  118. %pre
  119. [ -c /dev/pmu ] || {
  120. echo "creating /dev/pmu"
  121. mknod /dev/pmu c 10 154
  122. chmod 666 /dev/pmu
  123. }
  124. [ -c /dev/adb ] || {
  125. echo "creating /dev/adb"
  126. mknod /dev/adb c 56 0
  127. chmod 666 /dev/adb
  128. }
  129. #[ -p /etc/power/apm ] || {
  130. # echo "creating /etc/power/apm"
  131. # mkfifo -m 644 /etc/power/apm
  132. #}
  133. %post
  134. /sbin/chkconfig --add pmud
  135. %preun
  136. if [ $1 = 0 ]; then
  137. /sbin/chkconfig --del pmud
  138. fi
  139. %triggerpostun -- pmud < 0.10-0vl7
  140. /sbin/chkconfig --add pmud
  141. %files
  142. %defattr(-,root,root)
  143. %doc TODO BUGS README INSTALL CHANGES pwrctl-local contrib
  144. %doc powerfail debian
  145. %{_syssbindir}/backlight
  146. %{_syssbindir}/fblevel
  147. %{_syssbindir}/pmud
  148. %{_syssbindir}/snooze
  149. %{_syssbindir}/wakebay
  150. %{_sbindir}/m3mirror
  151. %{_sbindir}/m6mirror
  152. %{_bindir}/apm
  153. %{_bindir}/trackpad
  154. %{_bindir}/on_ac_power
  155. %config /etc/sysconfig/power
  156. %{_sysconfdir}/power/pwrctl
  157. %{_sysconfdir}/power/apm
  158. %{_sysconfdir}/power/levels
  159. %{_initdir}/pmud
  160. %{_mandir}/man8/fblevel*
  161. %{_mandir}/man8/pmud*
  162. %{_mandir}/man8/snooze*
  163. %files tools
  164. %defattr(-,root,root)
  165. %{_bindir}/Batmon
  166. %{_bindir}/gfblevel
  167. /usr/X11R6/bin/xmouse
  168. %{_mandir}/man8/Batmon*
  169. %{_mandir}/man8/xmouse*
  170. %changelog
  171. * Mon May 21 2007 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 0.10-1vl15
  172. - rebuilt with new toolchain
  173. * Sun Jan 21 2007 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 0.10-1vl14
  174. - add PreReq: coreutils
  175. * Wed Oct 11 2006 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 0.10-1vl13
  176. - split graphical frontends to -tools subpackage
  177. - make -C contrib clean before they are stored into docdir
  178. * Wed Oct 11 2006 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 0.10-1vl12
  179. - added Patch30 (include m3mirror and m6mirror, gfblevel with gtk2, misc fixes)
  180. * Sun Dec 21 2003 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 0.10-1vl11
  181. - rebuilt with kernel-2.3.23-0vl2
  182. * Wed Dec 10 2003 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 0.10-1vl10
  183. - rebuild with kernel-2.4.23-0vl1
  184. * Mon Nov 10 2003 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 0.10-1vl9
  185. - update Patch1
  186. - rebuild with kernel-2.4.22-0vl11
  187. * Fri Jul 25 2003 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 0.10-1vl8
  188. - rebuild with kernel-2.4.21-0vl19
  189. * Sun Mar 10 2002 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 0.10-1vl7
  190. - added %%triggerpostun
  191. * Sun Mar 03 2002 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 0.10-1vl6
  192. - modified %preun; not to delete rc? entries at package update
  193. * Sun Feb 24 2002 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 0.10-1vl5
  194. - added Patch14 to set "-a -K" as default
  195. - /etc/sysconfig/power now set to %%config
  196. * Thu Feb 22 2002 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 0.10-1vl4
  197. - fixed Batmon for PB2400/3400/3500
  198. - fixed pmud.c for PB2400/3400/3500
  199. * Thu Jan 31 2002 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 0.10-1vl3
  200. - fixed generating /etc/power/apm
  201. - fixed pmud.c for PB2400
  202. * Thu Jan 10 2002 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 0.10-1vl2
  203. - fixed contrib/backlight.c
  204. * Tue Dec 25 2001 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 0.8-1vl3
  205. - added some contrib binaries
  206. - gfblevel is now a seperated subpackage
  207. * Wed Dec 12 2001 KONAYASHI R. Taizo <tkoba@vinelinux.org>
  208. - pmud-0.8-1vl2
  209. - update to Debian pmud-0.8-1
  210. * Fri Aug 03 2001 KONAYASHI R. Taizo <tkoba@vinelinux.org>
  211. - added pwrctl-notap.patch
  212. * Fri Jul 06 2001 KONAYASHI R. Taizo <tkoba@ike-dyn.ritsumei.ac.jp>
  213. - rebuild for 2.4.6
  214. * Sun May 13 2001 KONAYASHI R. Taizo <tkoba@ike-dyn.ritsumei.ac.jp>
  215. - rebuild for 2.4
  216. * Sun Jan 21 2001 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
  217. - 0.7-1vl4
  218. - use better macros (%%{_syssbindir}, %%{_bindir}, %%{_sysconfdir},
  219. %%{_mandir}, %%{_initdir})
  220. * Fri Oct 13 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
  221. - 0.7-1vl3
  222. - disabled %post section
  223. (pmud seems to be unstable under certain environments....)
  224. * Fri Oct 13 2000 T.R. Kobayashi <tkoba@ike-dyn.ritsumei.ac.jp>
  225. - 0.7-1vl2
  226. - update to 0.7
  227. * Mon May 15 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
  228. - 0.6-2vl1
  229. - added %preun section
  230. - modified %version -> %pmudver, %release -> %pmudrel
  231. * Fri May 12 2000 T.R. Kobayashi <tkoba@ike-dyn.ritsumei.ac.jp>
  232. - 0.6.1-0.6.2
  233. - Fixed Batmon on 2400