]> git.pld-linux.org Git - packages/PowerChutePlus.git/blobdiff - PowerChutePlus.spec
- %%userremove/%%groupremove support, some unification
[packages/PowerChutePlus.git] / PowerChutePlus.spec
index 062b8f37cb7ac37d668837267a01d3786153533e..2ff05e4bb405f70b12afb3157e718b714d19082a 100644 (file)
@@ -1,20 +1,33 @@
 Summary:       UPS management software for APC UPS models
+Summary(pl):   Oprogramowanie do obs³ugi UPS-ów APC
 Name:          PowerChutePlus
-Version:       4.5.2.1
-Release:       2
-Copyright:     (c) 1999 APC, inc.
+Version:       4.5.3
+Release:       1
+License:       (c) 1999 APC, inc.
 Group:         Applications/System
-Group(de):     Applikationen/System
-Group(pl):     Aplikacje/System
-Source0:       ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/4521/pc4521_glibc.tar
-Source1:       ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/4521/pclinxug.pdf
+Source0:       ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/453/pcplus_453_caldera.tar
+# Source0-md5: 5eb99efd5561694b9f692aa713bd974d
+Source1:       ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/453/pc453ug.pdf
+# Source1-md5: 0c2a621adcad8fdcb6064ed3cb042711
 Source2:       upsd.init
 Source3:       %{name}-xpowerchute.sh
 Source4:       %{name}-Config.sh
 Source5:       %{name}-powerchute.ini
 Source6:       %{name}-powerchute.ini_templ
+Source7:       ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/settings.pdf
+# Source7-md5: c69abad141a836fd12ced0cc39049dc6
 Patch0:                %{name}-fix-sh.patch
-ExclusiveOS:   linux
+BuildRequires: rpmbuild(macros) >= 1.159
+PreReq:                rc-scripts
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/useradd
+Requires(pre): /usr/sbin/groupadd
+Requires(post,preun):  /sbin/chkconfig
+Requires(postun):      /usr/sbin/groupdel
+Requires(postun):      /usr/sbin/userdel
+Provides:      group(pwrchute)
+Provides:      user(pwrchute)
 ExclusiveArch: %{ix86}
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -26,6 +39,13 @@ configure and manage UPS models.
 Please note that /usr/lib/powerchute/Config.sh should be run in order
 to configure PowerChute plus.
 
+%description -l pl
+Ten program pozwala u¿ytkownikom bezpiecznie wy³±czyæ system w
+przypadku awarii zasilania. Pozwala tak¿e na skonfigurowanie UPS.
+
+Uwaga: aby skonfigurowaæ PowerChute Plus nale¿y uruchomiæ
+/usr/lib/powerchute/Config.sh .
+
 %prep
 %setup -q -c
 for i in BI_LINUX CI_LINUX COMMON FI_LINUX HELP ; do
@@ -34,22 +54,23 @@ done
 %patch0 -p1
 
 %build
-# No build, binaty package
+# No build, binary package
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_libdir}/powerchute} \
        $RPM_BUILD_ROOT/etc/rc.d/init.d \
-$RPM_BUILD_ROOT%{_prefix}/X11R6/{bin,lib/X11/{app-defaults,uid}}
+       $RPM_BUILD_ROOT%{_prefix}/X11R6/{bin,lib/X11/{app-defaults,uid}}
 
 install %{SOURCE1} .
+install %{SOURCE7} .
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsd
 install %{SOURCE3} $RPM_BUILD_ROOT%{_prefix}/X11R6/bin/xpowerchute
 install %{SOURCE4} $RPM_BUILD_ROOT%{_libdir}/powerchute/Config.sh
 install %{SOURCE6} $RPM_BUILD_ROOT%{_libdir}/powerchute/powerchute.ini_templ
 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/powerchute.ini
 
-ln -s %{_sysconfdir}/powerchute.ini $RPM_BUILD_ROOT%{_libdir}/powerchute/
+ln -sf %{_sysconfdir}/powerchute.ini $RPM_BUILD_ROOT%{_libdir}/powerchute
 
 install _upsd $RPM_BUILD_ROOT%{_sbindir}/upsd
 
@@ -71,42 +92,66 @@ install upsoff $RPM_BUILD_ROOT%{_libdir}/powerchute
 install upswrite $RPM_BUILD_ROOT%{_libdir}/powerchute
 install wall.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
 install what_os.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
-install pwrchute.uid $RPM_BUILD_ROOT%{_prefix}/X11R6/lib/X11/uid/
+install pwrchute.uid $RPM_BUILD_ROOT%{_prefix}/X11R6/lib/X11/uid
 
 install pwrchute.ad $RPM_BUILD_ROOT%{_prefix}/X11R6/lib/X11/app-defaults/pwrchute
 
-ln -s /var/run/upsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute/
-ln -s /var/run/bkupsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute/
+ln -sf /var/run/upsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute
+ln -sf /var/run/bkupsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute
 
-gzip -9nf language.txt readme_apache
+%clean
+rm -rf $RPM_BUILD_ROOT
 
 %pre
-GROUP=pwrchute; GID=68; %groupadd
-USER=pwrchute; UID=68; HOMEDIR=/dev/null; COMMENT="PowerChute Plus"
-%useradd
+if [ -n "`/usr/bin/getgid pwrchute`" ]; then
+       if [ "`/usr/bin/getgid pwrchute`" != 68 ]; then
+               echo "Error: group pwrchute doesn't have gid=68. Correct this before installing PowerChutePlus." 1>&2
+               exit 1
+       fi
+else
+       /usr/sbin/groupadd -g 68 pwrchute 1>&2
+fi
+if [ -n "`/bin/id -u pwrchute 2>/dev/null`" ]; then
+       if [ "`/bin/id -u pwrchute`" != 68 ]; then
+               echo "Error: user pwrchute doesn't have uid=68. Correct this before installing PowerChutePlus." 1>&2
+               exit 1
+       fi
+else
+       /usr/sbin/useradd -u 68 -g 68 -d /usr/share/empty -s /bin/false \
+               -c "PowerChute Plus" pwrchute
+fi
 
 %post
-NAME=upsd; DESC="UPSd server"; %chkconfig_post
+/sbin/chkconfig --add upsd
+if [ -f /var/lock/subsys/upsd ]; then
+       /etc/rc.d/init.d/upsd restart 1>&2
+else
+       echo "Type \"/etc/rc.d/init.d/upsd start\" to start UPSd server" 1>&2
+fi
 cd %{_libdir}/powerchute
 ./machine_id
 echo "You should run %{_libdir}/powerchute/Config.sh to configure PowerChute plus"
 echo "Remember to set the password for pwrchute account"
-       
+
 %preun
-NAME=upsd; %chkconfig_preun
+if [ "$1" = "0" ]; then
+       if [ -f /var/lock/subsys/upsd ]; then
+               /etc/rc.d/init.d/upsd stop 1>&2
+       fi
+       /sbin/chkconfig --del upsd
+fi
 
 %postun
-USER=pwrchute; %userdel
-GROUP=pwrchute; %groupdel
-
-%clean
-rm -rf $RPM_BUILD_ROOT
+if [ "$1" = "0" ]; then
+       %userremove pwrchute
+       %groupremove pwrchute
+fi
 
 %files
 %defattr(644,root,root,755)
-%doc help/* apachesh.pdf language.txt.gz readme_apache.gz pclinxug.pdf
+%doc help/* apachesh.pdf language.txt readme_apache pc453ug.pdf settings.pdf
 %attr(754,root,root) /etc/rc.d/init.d/upsd
-%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/powerchute.ini
+%attr(640,root,pwrchute) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/powerchute.ini
 %attr(755,root,root) %{_sbindir}/upsd
 %attr(755,root,root) %{_libdir}/powerchute/Config.sh
 %attr(755,root,root) %{_libdir}/powerchute/_xpwrchute
This page took 0.041763 seconds and 4 git commands to generate.