%define name uptimed %define ver 0.3.1 %define rel 2mdk %define major 0 %define libname %mklibname %name %major Summary : A daemon to record and keep track of system uptimes Name : %{name} Version : %{ver} Release : %{rel} License : GPL Group : Monitoring URL : http://unixcode.org/uptimed/ Source : http://prdownloads.sourceforge.net/%{name}/%{name}-%{ver}.tar.bz2 Patch0 : %{name}-makefile.patch.bz2 Patch1 : %{name}-rc.patch.bz2 BuildRoot : %{_tmppath}/%{name}-buildroot %description Uptimed is an uptime record daemon keeping track of the highest uptimes the system ever had. Instead of using a pid file to keep sessions apart from each other, it uses the system boot time. Uptimed has the ability to inform you of records and milestones though syslog and e-mail, and comes with a console front end to parse the records, which can also easily be used to show your records on your Web page %package -n %libname Summary : Generic libraries need by uptimed Group : System/Libraries Provides : lib%name = %version-%release %description -n %libname Generic libraries need by uptimed %package -n %libname-devel Summary : Generic libraries need by uptimed Group : Development/Other Provides : lib%name-devel = %version-%release Provides : %name-devel = %version-%release Requires : %libname = %version-%release %description -n %libname-devel Development files from uptimed %prep %setup -q %patch0 -p1 -b .makefile %patch1 -p1 -b .rc %build %configure --localstatedir=%buildroot%{_var}/spool/uptimed %make %install rm -rf "$RPM_BUILD_ROOT" DESTDIR="$RPM_BUILD_ROOT" %makeinstall install -m 755 -d $RPM_BUILD_ROOT/%_docdir/%{name}-%{version}/sample-cgi install -m 644 sample-cgi/uprecords.* $RPM_BUILD_ROOT/%_docdir/%{name}-%{version}/sample-cgi install -m 755 -d $RPM_BUILD_ROOT/etc/rc.d/init.d install -m 755 etc/rc.uptimed $RPM_BUILD_ROOT%_initrddir/uptimed mv $RPM_BUILD_ROOT/etc/uptimed.conf-dist $RPM_BUILD_ROOT%_sysconfdir/uptimed.conf %post install -m 755 -d %{_var}/spool/uptimed /sbin/chkconfig --add uptimed if [ -f /etc/rc.d/rc.sysinit ] then if [ ! `grep "/sbin/service uptimed createbootid" /etc/rc.d/rc.sysinit > /dev/null` ] then echo "/sbin/service uptimed createbootid" >> /etc/rc.d/rc.sysinit fi else echo echo "Please add the following line to your rc.sysinit script" echo "/sbin/service uptimed createbootid" echo fi %post -n %libname -p /sbin/ldconfig %preun /sbin/chkconfig --del uptimed if [ -f /etc/rc.d/rc.sysinit ] then grep -v "/sbin/service uptimed createbootid" /etc/rc.d/rc.sysinit > /etc/rc.d/rc.sysinit.new && mv /etc/rc.d/rc.sysinit.new /etc/rc.d/rc.sysinit chmod 755 /etc/rc.d/rc.sysinit else echo echo "Please remove the following line to your rc.sysinit script" echo "/sbin/service uptimed createbootid" echo fi %postun -n %libname -p /sbin/ldconfig %clean rm -rf "$RPM_BUILD_ROOT" %files %defattr(-,root,root) %doc AUTHORS COPYING CREDITS ChangeLog INSTALL INSTALL.cgi INSTALL.upgrade README README.unsupported TODO sample-cgi/ %config(noreplace) %_sysconfdir/uptimed.conf %config(noreplace) %_initrddir/uptimed %{_sbindir}/uptimed %{_bindir}/uprecords %{_mandir}/*/* %files -n %libname %defattr(-,root,root) %{_libdir}/libuptimed.so.* %files -n %libname-devel %defattr(-,root,root) %{_libdir}/libuptimed.so %{_libdir}/libuptimed.a %{_libdir}/libuptimed.la %changelog * Mon Jan 19 2004 Olivier Thauvin <thauvin@aerov.jussieu.fr> 0.3.1-2mdk - remove uneed requires * Mon Jan 19 2004 Olivier Thauvin <thauvin@aerov.jussieu.fr> 0.3.1-1mdk - 0.3.1 - mklibname / make a devel package - cleanup * Fri Feb 14 2003 Tibor Pittich <Tibor.Pittich@phuture.sk> 0.3.0-3mdk - sorry, my fault about versioning of rpm build number * Fri Feb 14 2003 Tibor Pittich <Tibor.Pittich@phuture.sk> 0.3.0-2mdk - ah, libification now - some spec cleanup * Fri Feb 14 2003 Tibor Pittich <Tibor.Pittich@phuture.sk> 0.3.0-1mdk - why isn't this package in contrib?:) - used original spec file with small changes - totally rewrited SysV start script - libification