]> git.pld-linux.org Git - packages/nut.git/blob - nut.spec
- added PLD-like init
[packages/nut.git] / nut.spec
1 Summary:        Network UPS Tools
2 Name:           nut
3 Version:        0.43.0
4 Release:        2
5 License:        GPL
6 Group:          Utilities/System
7 Group(pl):      Narzêdzia/System
8 Source0:        http://www.exploits.org/nut/release/%{name}-%{version}.tar.gz
9 Source1:        ups.init
10 URL:            http://www.exploits.org/nut/
11 Prereq:         chkconfig
12 Prereq:         fileutils
13 Requires:       nut-client
14 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
15
16 %define         _sysconfdir     /etc/ups
17
18 %description
19 These programs are part of a developing project to monitor the assortment
20 of UPSes that are found out there in the field. Many models have serial
21 serial ports of some kind that allow some form of state checking. This
22 capability has been harnessed where possible to allow for safe shutdowns,
23 live status tracking on web pages, and more.
24
25 %package client
26 Summary:        Multi-vendor UPS Monitoring Project Client Utilities
27 Group:          Utilities/System
28 Group(pl):      Narzêdzia/System
29
30 %description client
31 This package includes the client utilities that are required to monitor a
32 ups that the client host is plugged into but monitored via serial cable by
33 another host on the network....
34
35 %package cgi
36 Summary:        Multi-vendor UPS Monitoring Project Server - CGI utils
37 Group:          Utilities/System
38 Group(pl):      Narzêdzia/System
39
40 %description cgi
41 These programs are part of a developing project to monitor the assortment
42 of UPSes that are found out there in the field. Many models have serial
43 serial ports of some kind that allow some form of state checking. This
44 capability has been harnessed where possible to allow for safe shutdowns,
45 live status tracking on web pages, and more.
46
47 %prep
48 %setup -q
49
50 %build
51 LDFLAGS="-s"; export LDFLAGS
52 %configure \
53         --with-statepath=/var/lib/ups \
54         --with-uid=99 \
55         --with-gid=99
56 %{__make}
57
58 %install
59 rm -rf $RPM_BUILD_ROOT
60 install -d $RPM_BUILD_ROOT/{etc/{sysconfig,rc.d/init.d},var/lib/ups}
61 %{__make} CONFPATH=$RPM_BUILD_ROOT%{_sysconfdir} BASEPATH=$RPM_BUILD_ROOT%{_prefix} STATEPATH=$RPM_BUILD_ROOT/var/lib/ups install
62 %{__make} CONFPATH=$RPM_BUILD_ROOT%{_sysconfdir} BASEPATH=$RPM_BUILD_ROOT/home/httpd STATEPATH=$RPM_BUILD_ROOT/var/lib/ups install-cgi
63
64 install scripts/RedHat-6.0/ups-config $RPM_BUILD_ROOT/etc/sysconfig/ups
65 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d
66
67 %preun client
68 /etc/rc.d/init.d/ups stop
69
70 %postun
71 echo "You may want to chown root:tty /dev/ttyS#, where # is the \n"
72 echo "number of the serial port that the UPS was connected to... \n"
73
74 %postun client
75 /sbin/chkconfig --del ups
76
77 %post client
78 /sbin/chkconfig --add ups
79
80 %clean
81 rm -rf $RPM_BUILD_ROOT
82
83 %files
84 %defattr(644,root,root,755)
85 %doc CREDITS Changes QUICKSTART README docs
86 %attr(755,root,root) %{_bindir}/apcsmart
87 %attr(755,root,root) %{_bindir}/bestups
88 %attr(755,root,root) %{_bindir}/fentonups
89 %attr(755,root,root) %{_bindir}/genericups
90 %attr(755,root,root) %{_bindir}/optiups
91 %attr(755,root,root) %{_bindir}/ups-trust425+625
92 %attr(755,root,root) %{_bindir}/upsd
93 %attr(755,root,root) %{_bindir}/upslog
94
95 %files client
96 %defattr(644,root,root,755)
97 %config(noreplace) %{_sysconfdir}/hosts.conf
98 %config(noreplace) %{_sysconfdir}/multimon.conf
99 %attr(600,root,root) %config(noreplace) %{_sysconfdir}/upsd.conf
100 %attr(600,root,root) %config(noreplace) %{_sysconfdir}/upsmon.conf
101 %attr(644,root,root) %config(noreplace) /etc/sysconfig/ups
102 %attr(754,root,root) /etc/rc.d/init.d/ups
103 %attr(755,root,root) %{_bindir}/upsc
104 %attr(755,root,root) %{_bindir}/upsct
105 %attr(755,root,root) %{_bindir}/upsct2
106 %attr(755,root,root) %{_bindir}/upsmon
107 %dir %attr(755,nobody,nobody) /var/lib/ups
108
109 %files cgi
110 %defattr(644,root,root,755)
111 %doc CREDITS Changes QUICKSTART README docs
112 /home/httpd/cgi-bin/cgi-bin/multimon.cgi
113 /home/httpd/cgi-bin/upsimage.cgi
114 /home/httpd/cgi-bin/upsset.cgi
115 /home/httpd/cgi-bin/upsstats.cgi
116 %attr(600,root,root) %config(noreplace) %{_sysconfdir}/upsset.passwd
This page took 1.040328 seconds and 4 git commands to generate.