]> git.pld-linux.org Git - packages/apcupsd.git/blob - apcupsd.spec
- adapterized (sorted %verify attrs)
[packages/apcupsd.git] / apcupsd.spec
1 #
2 # Conditional build:
3 %bcond_without  test    # without TEST support
4 %bcond_without  usb     # without USB support
5 %bcond_without  net     # without network support
6 %bcond_with     snmp    # with SNMP support
7 #
8 Summary:        Power management software for APC UPS hardware
9 Summary(pl):    Oprogramowanie do zarz±dzania energi± dla UPS-ów APC
10 Name:           apcupsd
11 Version:        3.10.18
12 Release:        3
13 License:        GPL v2
14 Group:          Networking/Daemons
15 Source0:        http://dl.sourceforge.net/apcupsd/%{name}-%{version}.tar.gz
16 # Source0-md5:  64104a1fface0253e77318ca84948bac
17 Source1:        %{name}.init
18 Source2:        %{name}.logrotate
19 Source3:        %{name}.sysconfig
20 Patch0:         %{name}-configure.patch
21 URL:            http://www.apcupsd.com/
22 BuildRequires:  autoconf
23 BuildRequires:  automake
24 %{?with_snmp:BuildRequires:     net-snmp-devel}
25 Requires(post): fileutils
26 Requires(post,preun):   /sbin/chkconfig
27 Requires:       rc-scripts
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %define         _sysconfdir     /etc/apcupsd
31
32 %description
33 UPS power management under Linux for APCC Products. It allows your
34 computer/server to run during power problems for a specified length of
35 time or the life of the batteries in your BackUPS, BackUPS Pro,
36 SmartUPS v/s, or SmartUPS, and then properly executes a controlled
37 shutdown during an extended power failure.
38
39 %description -l pl
40 Oprogramowanie do zarz±dzania energi± dla UPS-ów APC. Pozwala
41 komputerowi dzia³aæ po awarii zasilania przez okre¶lony czas lub czas
42 ¿ycia akumulatorów w BackUPS, BackUPS Pro, SmartUPS v/s, SmartUPS oraz
43 odpowiednio uruchamia kontrolowany shutdown przy d³u¿szej awarii
44 zasilania.
45
46 %prep
47 %setup -q
48 %patch0 -p1
49
50 %build
51 cd autoconf
52 cp -f /usr/share/automake/config.sub .
53 %{__autoconf}
54 cp -f configure ..
55 cd ..
56 %configure \
57         --with-log-dir=%{_var}/log \
58         --with-stat-dir=%{_var}/lib/apcupsd \
59         %{?with_test:--enable-test} \
60 %if %{with net}
61         --enable-net \
62         --enable-master-slave \
63 %endif
64         %{?with_snmp:--enable-snmp} \
65         %{?with_usb:--enable-usb}
66
67 %{__make}
68
69 %install
70 rm -rf $RPM_BUILD_ROOT
71 install -d $RPM_BUILD_ROOT/etc/{apcupsd,logrotate.d,rc.d/init.d,sysconfig} \
72         $RPM_BUILD_ROOT/var/{log,lib/apcupsd}
73
74 %{__make} install \
75         DESTDIR=$RPM_BUILD_ROOT
76
77 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
78 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/apcupsd
79 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/apcupsd
80
81 touch $RPM_BUILD_ROOT/var/log/apcupsd.events
82 touch $RPM_BUILD_ROOT/var/lib/apcupsd/apcupsd.status
83
84 cat > $RPM_BUILD_ROOT/etc/rc.d/init.d/halt << EOF
85 #!/bin/sh
86 /etc/rc.d/init.d/apcupsd powerdown
87 EOF
88
89 %clean
90 rm -rf $RPM_BUILD_ROOT
91
92 %post
93 /sbin/chkconfig --add apcupsd
94 if [ -f /var/lock/subsys/apcupsd ]; then
95         /etc/rc.d/init.d/apcupsd restart >&2
96 else
97         echo "Run \"/etc/rc.d/init.d/apcupsd start\" to start apcupsd daemon."
98 fi
99
100 %preun
101 if [ "$1" = "0" ]; then
102         if [ -f /var/lock/subsys/apcupsd ]; then
103                 /etc/rc.d/init.d/apcupsd stop >&2
104         fi
105         /sbin/chkconfig --del apcupsd
106 fi
107
108 %files
109 %defattr(644,root,root,755)
110 %doc ChangeLog Developers doc/{README.apcaccess,README.solaris}
111 %attr(755,root,root) %{_sbindir}/*
112 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apcupsd.conf
113 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/apcupsd
114 %attr(754,root,root) %{_sysconfdir}/apccontrol
115 %attr(754,root,root) %{_sysconfdir}/changeme
116 %attr(754,root,root) %{_sysconfdir}/commfailure
117 %attr(754,root,root) %{_sysconfdir}/commok
118 %attr(754,root,root) %{_sysconfdir}/mainsback
119 %attr(754,root,root) %{_sysconfdir}/masterconnect
120 %attr(754,root,root) %{_sysconfdir}/mastertimeout
121 %attr(754,root,root) %{_sysconfdir}/onbattery
122 %attr(754,root,root) /etc/rc.d/init.d/apcupsd
123 %attr(754,root,root) /etc/rc.d/init.d/halt
124 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/apcupsd
125 %dir %{_sysconfdir}
126 %dir /var/lib/apcupsd
127 %attr(640,root,root) %ghost /var/log/apcupsd.events
128 %attr(640,root,root) %ghost /var/lib/apcupsd/apcupsd.status
129 %{_mandir}/man8/apcupsd.*
This page took 0.05314 seconds and 3 git commands to generate.