1 | #
|
---|
2 | # $Id$
|
---|
3 | #
|
---|
4 | Summary: A utility to collect various linux performance data
|
---|
5 |
|
---|
6 | Name: PBPKG
|
---|
7 | Version: PBVER
|
---|
8 | Release: PBTAGPBSUF
|
---|
9 | License: GPL
|
---|
10 | Group: PBGRP
|
---|
11 | Source: PBSRC
|
---|
12 | Url: PBURL
|
---|
13 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
|
---|
14 | BuildArch: noarch
|
---|
15 |
|
---|
16 | %description
|
---|
17 | A utility to collect linux performance data
|
---|
18 |
|
---|
19 | %prep
|
---|
20 | %setup -q
|
---|
21 |
|
---|
22 | %build
|
---|
23 |
|
---|
24 | %clean
|
---|
25 | %{__rm} -rf %{buildroot}
|
---|
26 |
|
---|
27 | %install
|
---|
28 | %{__rm} -rf %{buildroot}
|
---|
29 |
|
---|
30 | # create required directories
|
---|
31 | mkdir -p ${RPM_BUILD_ROOT}/var/log/%{name} ${RPM_BUILD_ROOT}%{_sbindir} ${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{version} ${RPM_BUILD_ROOT}%{_sysconfdir}/init.d/ ${RPM_BUILD_ROOT}%{_mandir}/man1/
|
---|
32 |
|
---|
33 | # install the files, setting the mode
|
---|
34 | install -m 755 %{name}.pl ${RPM_BUILD_ROOT}%{_sbindir}/%{name}
|
---|
35 |
|
---|
36 | # Should be put elsewhere normaly
|
---|
37 | install -m 755 formatit.ph ${RPM_BUILD_ROOT}/%{_sbindir}/formatit.ph
|
---|
38 | #install -m 444 RELEASE-%{name} FAQ-%{name}.html GPL ARTISTIC COPYING ${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{version}
|
---|
39 | # Needs more work of course
|
---|
40 | install -m 755 initd/%{name}-generic ${RPM_BUILD_ROOT}%{_sysconfdir}/init.d/%{name}
|
---|
41 | install -m 644 %{name}.conf ${RPM_BUILD_ROOT}%{_sysconfdir}
|
---|
42 | install -m 644 man1/%{name}*.1 ${RPM_BUILD_ROOT}%{_mandir}/man1/
|
---|
43 |
|
---|
44 | # lspci is under /usr/bin
|
---|
45 | echo "Lspci = /usr/bin/lspci" >> ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}.conf
|
---|
46 |
|
---|
47 | %files
|
---|
48 | %defattr(-,root,root)
|
---|
49 | %doc RELEASE-%{name} FAQ-%{name}.html GPL ARTISTIC COPYING
|
---|
50 | %config(noreplace) %{_sysconfdir}/%{name}.conf
|
---|
51 | %dir /var/log/%{name}
|
---|
52 | %{_sbindir}/*
|
---|
53 | %{_mandir}/man1/*
|
---|
54 | %{_sysconfdir}/init.d/%{name}
|
---|
55 |
|
---|
56 | %preun
|
---|
57 | # If collectl is running, stop it before removing.
|
---|
58 | /etc/init.d/%{name} stop
|
---|
59 | chkconfig --del %{name} 2>&1 > /dev/null
|
---|
60 |
|
---|
61 | %post
|
---|
62 | chkconfig --add %{name} 2>&1 > /dev/null
|
---|
63 | /etc/init.d/%{name} start
|
---|
64 |
|
---|
65 | %changelog
|
---|
66 | PBLOG
|
---|