]> git.pld-linux.org Git - packages/apcupsd.git/blob - apcupsd.spec
- raw version.
[packages/apcupsd.git] / apcupsd.spec
1 Name: apcupsd
2 Version: 3.5.8
3 Release: 2
4 Copyright: GPL v2
5 Group: System Environment/Daemons
6 Url: http://www.brisse.dk/site/apcupsd/
7 Packager: Bert de Bruijn <bob@ccl.kuleuven.ac.be>
8 Source: http://www.brisse.dk/site/apcupsd/download/%{name}-%{version}.src.tar.gz
9 Patch0: apcups-initscript.patch
10 Patch1: apcups-makefile.patch
11 Summary: power management software for APC UPS hardware
12 BuildRoot: /var/tmp/%{name}-root
13 Prefix: /usr
14 Prefix: /etc
15 Prefix: /sbin
16 Prefix: /bin
17 Prefix: /var
18 #Icon: apcupsd-logo.xpm
19
20 %description
21 UPS power management under Linux for APCC Products.
22 It allows your computer/server to run during power problems
23 for a specified length of time or the life of the batteries
24 in your BackUPS, BackUPS Pro, SmartUPS v/s, or SmartUPS, and
25 then properly executes a controlled shutdown during an
26 extended power failure.
27
28 %prep
29 %setup -n %{name}-%{version}.src
30 %patch0 -p1
31 %patch1 -p1
32
33 %build
34 mv Makefile Makefile.orig
35 cat Makefile.orig \
36  | sed "s,^PREFIX    =,PREFIX    = ${RPM_BUILD_ROOT},"  \
37  | sed "s,^MANPREFIX = /usr,MANPREFIX = ${RPM_BUILD_ROOT}/usr," \
38  > Makefile
39 make linux
40
41 %install
42 # Some issues :
43 # - why doesn't the Makefile know that it should install *-linux ??
44 # - make install tries to stop apcupsd. That's not necessary (buildroot) (hany: not issue anymore)
45
46 mkdir -p ${RPM_BUILD_ROOT}/{sbin,bin,etc/rc.d/init.d,usr/man/man8,var/log}
47 NAME="-linux" make install
48 # hany: why this? we're just building. not installing
49 #[ -x /sbin/powersc ] && /sbin/powersc RESTARTME
50 gzip -9 -f ${RPM_BUILD_ROOT}/usr/man/*/*.?
51 cp -f installs/apcupsd.conf ${RPM_BUILD_ROOT}/etc
52 cp -f installs/apcups.rhs ${RPM_BUILD_ROOT}/etc/rc.d/init.d/apcups
53 touch ${RPM_BUILD_ROOT}/var/log/apcupsd.log
54 touch ${RPM_BUILD_ROOT}/etc/apcupsd.status
55
56 %clean
57 rm -rf ${RPM_BUILD_ROOT}
58
59 %post
60 /sbin/ldconfig
61 /sbin/chkconfig --add apcups
62 if !(grep /sbin/powersc /etc/rc.d/init.d/halt > /dev/null); then
63 cp -f /etc/rc.d/init.d/halt /etc/rc.d/init.d/halt.rpmorig
64 sed -e '/# Now halt or reboot./i\' \
65      -e '\
66 # See if this is a powerfail situation.\
67 if [ -f /etc/powerfail ]; then\
68   echo "APCUPSD to the Rescue!"\
69   echo\
70   /sbin/powersc KILL\
71   echo\
72   sleep 120\
73   exit 1\
74 fi\
75 ' /etc/rc.d/init.d/halt.rpmorig > /etc/rc.d/init.d/halt
76
77 fi
78 echo Check the documentation to see whether /etc/rc.d/init.d/halt has a
79 echo correct invocation of /sbin/powersc .
80
81 %preun
82 chkconfig --del apcups
83
84 %files
85 %defattr(-, root, root)
86 %attr(-, root, root) %doc README.NEW Changelog port.gif Statement.APCC
87 %attr(-, root, root) %doc %{name}-%{version}.src.lsm
88 %attr(-, root, root) %doc readmes/*
89 %attr(-, root, root) %doc docs/apcupsd.docs
90 %attr(-, root, root) %doc installs/halt.rhs installs/apcups.rhs installs/powersc
91 %attr(644, root, man) /usr/man/man8/apcupsd.8.gz
92 %attr(755, root, bin)  /sbin/apcupsd
93 %attr(755, root, root) /bin/apcaccess
94 %attr(755, root, bin)  %config /sbin/powersc
95 %attr(640, root, root) %config(noreplace) /etc/apcupsd.conf
96 %attr(755, root, root) %config /etc/rc.d/init.d/apcups
97 %ghost /var/log/apcupsd.log
98 %ghost /etc/apcupsd.status
99
100 %changelog
101 * Fri Aug  6 1999 Peter Hanecak <hanecak@megaloman.sk>
102 - build process cleaned (so non-root users can do that smoothly)
103 - build-root changed
104 - %defattr
105
106 * Sun Jun  6 1999 Bert de Bruijn <bob@ccl.kuleuven.ac.be>
107 - new spec file, first rpm release since source release under GPL ?
108 - use sed in %build to force buildroot.
This page took 0.109498 seconds and 3 git commands to generate.