]>
Commit | Line | Data |
---|---|---|
f6248631 ER |
1 | Summary: The CA NetConsole Daemon |
2 | Name: cancd | |
3 | Version: 0.1.0 | |
3ac4b4c9 | 4 | Release: 0.4 |
f6248631 ER |
5 | License: GPL |
6 | Group: Applications/File | |
7 | Source0: http://oss.oracle.com/projects/cancd/dist/files/source/%{name}-%{version}.tar.gz | |
8 | # Source0-md5: 3eb4a75cfa4d1a860ea547fdc76c6d4d | |
3ac4b4c9 ER |
9 | Source1: %{name}.init |
10 | Source2: %{name}.sysconfig | |
f6248631 ER |
11 | Patch0: %{name}-make.patch |
12 | URL: http://oss.oracle.com/projects/cancd/ | |
13 | BuildRequires: rpmbuild(macros) >= 1.228 | |
14 | Requires(post,preun): /sbin/chkconfig | |
3ac4b4c9 ER |
15 | Requires(postun): /usr/sbin/groupdel |
16 | Requires(postun): /usr/sbin/userdel | |
17 | Requires(pre): /bin/id | |
18 | Requires(pre): /usr/bin/getgid | |
19 | Requires(pre): /usr/sbin/groupadd | |
20 | Requires(pre): /usr/sbin/useradd | |
f6248631 ER |
21 | Requires: /sbin/chkconfig |
22 | Requires: rc-scripts | |
3ac4b4c9 ER |
23 | Provides: group(cancd) |
24 | Provides: user(cancd) | |
f6248631 ER |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
26 | ||
27 | %description | |
28 | This is the CA NetConsole Daemon, a daemon to receive output from the | |
29 | Linux netconsole driver. | |
30 | ||
31 | %prep | |
32 | %setup -q | |
33 | %patch0 -p1 | |
34 | ||
35 | %build | |
36 | %{__make} \ | |
37 | CC="%{__cc}" \ | |
38 | OPTFLAGS="%{rpmcflags}" | |
39 | ||
40 | %install | |
41 | rm -rf $RPM_BUILD_ROOT | |
3ac4b4c9 | 42 | install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/log/cancd} |
f6248631 ER |
43 | %{__make} install \ |
44 | DESTDIR=$RPM_BUILD_ROOT | |
45 | ||
3ac4b4c9 ER |
46 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/cancd |
47 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cancd | |
f6248631 ER |
48 | |
49 | %clean | |
50 | rm -rf "$RPM_BUILD_ROOT" | |
51 | ||
3ac4b4c9 ER |
52 | %pre |
53 | %groupadd -g 162 cancd | |
54 | %useradd -u 162 -c "CA NetConsole Daemon" -g cancd cancd | |
55 | ||
f6248631 ER |
56 | %post |
57 | /sbin/chkconfig --add cancd | |
58 | %service cancd restart | |
59 | ||
60 | %preun | |
61 | if [ "$1" = "0" ]; then | |
62 | %service cancd stop | |
63 | /sbin/chkconfig --del cancd | |
64 | fi | |
65 | ||
3ac4b4c9 ER |
66 | %postun |
67 | if [ "$1" = "0" ]; then | |
68 | %userremove cancd | |
69 | %groupremove cancd | |
70 | fi | |
71 | ||
f6248631 ER |
72 | %files |
73 | %defattr(644,root,root,755) | |
74 | %attr(755,root,root) %{_sbindir}/cancd | |
75 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cancd | |
76 | %attr(754,root,root) %config /etc/rc.d/init.d/cancd | |
3ac4b4c9 | 77 | %attr(770,root,cancd) %dir /var/log/cancd |