File: uptimed.spec.in

package info (click to toggle)
uptimed 1%3A0.4.0%2Bgit20150923.6b22106-1.1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 748 kB
  • ctags: 226
  • sloc: ansic: 2,634; sh: 293; perl: 55; makefile: 51
file content (108 lines) | stat: -rw-r--r-- 3,031 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
%define release	1

Summary:	A daemon to record and keep track of system uptimes
Name:	@PACKAGE@
Version:	@VERSION@
Release:	%{release}
License:	GPL
Group:	System Environment/Daemons
Source:	http://prdownloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
BuildRoot:	/var/tmp/%{name}-%{version}-buildroot
PreReq:	chkconfig >= 0.9

%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

%prep
%setup -q

%build
%configure
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"

%install
rm -rf "$RPM_BUILD_ROOT"
make DESTDIR="$RPM_BUILD_ROOT" install
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/etc/rc.d/init.d/uptimed
mv $RPM_BUILD_ROOT/etc/uptimed.conf-dist $RPM_BUILD_ROOT/etc/uptimed.conf

%post
/sbin/ldconfig
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

%postun
/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 > /tmp/rc.sysinit.$$ && mv /tmp/rc.sysinit.$$ /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

%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) /etc/uptimed.conf
%config /etc/rc.d/init.d/uptimed
%{_sbindir}/uptimed
%{_bindir}/uprecords
%{_mandir}/*/*
%{_libdir}/libuptimed.*

%changelog
* Tue May 14 2002 Brett Pemberton <generica@email.com>
- Reset release to 0 for uptimed-2.0
- Change source location

* Sat Mar 16 2002 Brett Pemberton <generica@email.com>
- Add /etc/rc.d/init.d/uptimed
- Use chkconfig

* Wed Mar 13 2002 Brett Pemberton <generica@email.com>
- Automate rc.{sysinit,local} add/remove
- Warn if rc.{sysinit,local} not found

* Fri Dec 21 2001 Brett Pemberton <generica@email.com>
- Handle sample-cgi dir properly
- Install uptimed.conf properly
- Install /var/spool/uptimed
- Warn user to finish configuring

* Thu Dec 20 2001 Brett Pemberton <generica@email.com>
- Initial spec-file