X-Git-Url: http://git.pld-linux.org/?p=packages%2FPowerChutePlus.git;a=blobdiff_plain;f=PowerChutePlus.spec;h=478f1b543e97f7419249f539f9e29f24efc5fd40;hp=6d93fda2bbc49c3b88c58fd0c398e9dd720ea1f0;hb=86b126175db41eba2f09afafb2cc11a477096fa1;hpb=f48c0a1aa00e5737fa48d30112d42fea552cf4b4 diff --git a/PowerChutePlus.spec b/PowerChutePlus.spec index 6d93fda..478f1b5 100644 --- a/PowerChutePlus.spec +++ b/PowerChutePlus.spec @@ -6,17 +6,29 @@ Release: 1 License: (c) 1999 APC, inc. Group: Applications/System 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.202 +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} -Prereq: chkconfig BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -58,7 +70,7 @@ 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 -sf %{_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 @@ -80,25 +92,19 @@ 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 -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 +ln -sf /var/run/upsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute +ln -sf /var/run/bkupsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute %clean rm -rf $RPM_BUILD_ROOT %pre -if ! id -g pwrchute > /dev/null 2>&1 ; then - %{_sbindir}/groupadd -g 68 pwrchute -fi -if ! id -u pwrchute > /dev/null 2>&1 ; then - %{_sbindir}/useradd -u 68 -g 68 -d /dev/null -s /bin/false -c "PowerChute Plus" pwrchute -fi +%groupadd -g 68 pwrchute +%useradd -u 68 -g 68 -d /usr/share/empty -s /bin/false -c "PowerChute Plus" pwrchute %post /sbin/chkconfig --add upsd @@ -111,7 +117,7 @@ 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 if [ "$1" = "0" ]; then if [ -f /var/lock/subsys/upsd ]; then @@ -122,16 +128,17 @@ fi %postun if [ "$1" = "0" ]; then - %{_sbindir}/userdel pwrchute - %{_sbindir}/groupdel pwrchute + %userremove pwrchute + %groupremove pwrchute fi %files %defattr(644,root,root,755) -%doc help/* apachesh.pdf language.txt.gz readme_apache.gz pc453ug.pdf settings.pdf +%doc help/* apachesh.pdf language.txt readme_apache pc453ug.pdf settings.pdf %attr(754,root,root) /etc/rc.d/init.d/upsd %attr(640,root,pwrchute) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/powerchute.ini %attr(755,root,root) %{_sbindir}/upsd +%dir %{_libdir}/powerchute %attr(755,root,root) %{_libdir}/powerchute/Config.sh %attr(755,root,root) %{_libdir}/powerchute/_xpwrchute %attr(755,root,root) %{_libdir}/powerchute/addpage.sh