-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathallview.spec
178 lines (142 loc) · 4.81 KB
/
allview.spec
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
%define apxs /usr/sbin/apxs2
%define apache_datadir %(%{apxs} -q DATADIR)
%define apache_sysconfdir %(%{apxs} -q SYSCONFDIR)
Name: allview
Version: 1.0 Release6
Release: 1
Group: System Environment/Daemons
License: GPL
Source: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-root
BuildPrereq: mysql-client, mysql-devel, ucdsnmp
Requires: mysql-client, ucdsnmp
Summary: A network monitor.
%define allview_prefix /opt/%{name}
%define allview_bindir %{allview_prefix}/bin
%define allview_confdir %{_sysconfdir}/%{name}
%define allview_phpfrontend %{allview_prefix}/frontends/php
%description
allview is a network monitor.
%package agent
Summary: Allview agent
Group: System Environment/Daemons
%description agent
the allview network monitor agent.
%package phpfrontend
Summary: Allview web frontend (php).
Group: System Environment/Daemons
Requires: php
%description phpfrontend
a php frontend for allview.
%prep
%setup -q
%build
%configure --with-mysql --with-ucd-snmp
make
# adjust in several files /home/allview
for allviewfile in misc/conf/* misc/init.d/suse/*/allview_agentd src/allview_server/{alerter,server}.c; do
sed -i -e "s#/home/allview/bin#%{allview_bindir}#g" \
-e "s#PidFile=/var/tmp#PidFile=%{_localstatedir}/run#g" \
-e "s#LogFile=/tmp#LogFile=%{_localstatedir}/log#g" \
-e "s#/home/allview/lock#%{_localstatedir}/lock#g" $allviewfile
done
# adjust /home/allview to /usr/share/doc/packages/
sed -i -e "s#/home/allview#%{_defaultdocdir}#g" create/data/images.sql
%pre
if [ -z "`grep allview etc/group`" ]; then
usr/sbin/groupadd allview >/dev/null 2>&1
fi
if [ -z "`grep allview etc/passwd`" ]; then
usr/sbin/useradd -g allview allview >/dev/null 2>&1
fi
%pre agent
if [ -z "`grep allview etc/group`" ]; then
usr/sbin/groupadd allview >/dev/null 2>&1
fi
if [ -z "`grep allview etc/passwd`" ]; then
usr/sbin/useradd -g allview allview >/dev/null 2>&1
fi
%post agent
%{fillup_and_insserv -f allview_agentd}
if [ -z "`grep allview_agent etc/services`" ]; then
cat >>etc/services <<EOF
allview_agent 10050/tcp
EOF
fi
if [ -z "`grep allview_trap etc/services`" ]; then
cat >>etc/services <<EOF
allview_trap 10051/tcp
EOF
fi
%postun agent
%{insserv_cleanup}
%clean
rm -fr $RPM_BUILD_ROOT
%install
rm -fr $RPM_BUILD_ROOT
#make install DESTDIR=$RPM_BUILD_ROOT
# create directory structure
install -d %{buildroot}%{allview_bindir}
install -d %{buildroot}%{allview_confdir}
install -d %{buildroot}%{_sysconfdir}/init.d
install -d %{buildroot}%{apache_sysconfdir}/conf.d
# copy binaries
install -m 755 bin/allview_* %{buildroot}%{allview_bindir}
# copy conf files
install -m 755 misc/conf/allview_*.conf %{buildroot}%{allview_confdir}
# copy frontends
cp -r frontends %{buildroot}%{allview_prefix}
# apache2 config
cat >allview.conf <<EOF
Alias /%{name} %{allview_phpfrontend}
<Directory "%{allview_phpfrontend}">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
EOF
install -m 644 allview.conf %{buildroot}%{apache_sysconfdir}/conf.d
# SuSE Start Scripts
install -m 755 misc/init.d/suse/9.1/allview_* %{buildroot}%{_sysconfdir}/init.d/
%files
%defattr(-,root,root)
%doc AUTHORS COPYING NEWS README INSTALL create upgrades
%dir %attr(0755,root,root) %{allview_confdir}
%attr(0644,root,root) %config(noreplace) %{allview_confdir}/allview_server.conf
%dir %attr(0755,root,root) %{allview_prefix}
%dir %attr(0755,root,root) %{allview_bindir}
%attr(0755,root,root) %{allview_bindir}/allview_server
%files agent
%defattr(-,root,root)
%dir %attr(0755,root,root) %{allview_confdir}
%attr(0644,root,root) %config(noreplace) %{allview_confdir}/allview_agent.conf
%attr(0644,root,root) %config(noreplace) %{allview_confdir}/allview_agentd.conf
%config(noreplace) %{_sysconfdir}/init.d/allview_agentd
%dir %attr(0755,root,root) %{allview_prefix}
%dir %attr(0755,root,root) %{allview_bindir}
%attr(0755,root,root) %{allview_bindir}/allview_agent
%attr(0755,root,root) %{allview_bindir}/allview_agentd
%attr(0755,root,root) %{allview_bindir}/allview_sender
%files phpfrontend
%defattr(-,root,root)
%attr(0644,root,root) %config(noreplace) %{apache_sysconfdir}/conf.d/allview.conf
%dir %attr(0755,root,root) %{allview_prefix}
%dir %attr(0755,root,root) %{allview_prefix}/frontends
%attr(0755,root,root) %{allview_phpfrontend}
%changelog
* Sun Mar 07 2006 Myleft Studio <[email protected]>
- update to 1.1
%changelog
* Fri Jan 29 2005 Dirk Datzert <[email protected]>
- update to 1.1aplha6
* Tue Jun 01 2003 Allview team <[email protected]>
- update to 1.0beta10
* Tue Jun 01 2003 Harald Holzer <[email protected]>
- update to 1.0beta9
- move phpfrontend config to /etc/allview
* Tue May 23 2003 Harald Holzer <[email protected]>
- split the php frontend in a extra package
* Tue May 20 2003 Harald Holzer <[email protected]>
- 1.0beta8
- initial packaging