]> git.pld-linux.org Git - packages/zabbix.git/blob - zabbix.spec
- fixed conditional building
[packages/zabbix.git] / zabbix.spec
1 #
2 # Conditional build:
3 # _with_pgsql - enable postgresql support (by default use mysql)
4 #
5 %define _beta   beta8
6 Summary:        zabbix
7 Summary(pl):    zabbix
8 Name:           zabbix
9 Version:        1.0
10 Release:        0.%{_beta}.0.1
11 License:        GPL v2+
12 Group:          Networking/Admin
13 Source0:        http://dl.sourceforge.net/%{name}/%{name}-%{version}%{_beta}.tar.gz
14 Source1:        %{name}-agent.inetd
15 Source2:        %{name}-trapper.inetd
16 URL:            http://zabbix.sourceforge.net/
17 %{!?_with_pgsql:BuildRequires:   mysql-devel}
18 %{?_with_pgsql:BuildRequires:   postgresql-devel}
19 BuildRequires:  ucd-snmp-devel
20 BuildRequires:  openssl-devel >= 0.9.6j
21 #PreReq:        -
22 #Requires       -
23 #Requires(pre,post):    -
24 #Requires(preun):       -
25 #Requires(postun):      -
26 #Provides:      -
27 #Obsoletes:     -
28 #Conflicts:     -
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %define _sysconfdir     /etc/%{name}
32
33 %description
34 none yet
35
36 %package frontend-php
37 Summary:        PHP frontend for zabbix
38 Group:          Networking/Admin
39 Requires:       apache
40 Requires:       php
41
42 %description frontend-php
43 blah
44
45 %package agent-inetd
46 Summary:        inetd agent for zabbix
47 Group:          Networking/Admin
48 Requires:       %{name}
49 Requires:       inetdaemon
50 Obsoletes:      %{name}-agent-standalone
51
52 %description agent-inetd
53 blah
54
55 %package agent-standalone
56 Summary:        standalone agent for zabbix
57 Group:          Networking/Admin
58 Requires:       %{name}
59 Obsoletes:      %{name}-agent-inetd
60
61 %description agent-standalone
62 blah
63
64 %package suckerd
65 Summary:        sucker daemon for zabbix
66 Group:          Networking/Admin
67 Requires:       %{name}
68 %{!?_with_pgsql:Requires:   mysql}
69 %{?_with_pgsql:Requires:   postgresql}
70
71 %description suckerd
72 blah
73
74 %package trapper-inetd
75 Summary:        inetd trapper for zabbix
76 Group:          Networking/Admin
77 Requires:       %{name}
78 Requires:       inetdaemon
79 Obsoletes:      %{name}-trapper-standalone
80
81 %description trapper-inetd
82 blah
83
84 %package trapper-standalone
85 Summary:        standalone trapper for zabbix
86 Group:          Networking/Admin
87 Requires:       %{name}
88 Obsoletes:      %{name}-trapper-inetd
89
90 %description trapper-standalone
91 blah
92
93 %package sender
94 Summary:        zabbix's sender
95 Group:          Networking/Admin
96
97 %description sender
98 blah
99
100 %prep
101 %setup -q -n %{name}-%{version}%{_beta}
102
103 %build
104 rm -f missing
105 %{__aclocal}
106 %{__autoconf}
107 %configure \
108         %{!?_with_pgsql:--with-mysql} \
109         %{?_with_pgsql:--with-pgsql}
110
111 %{__make}
112
113 %install
114 rm -rf $RPM_BUILD_ROOT
115 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/sysconfig/rc-inetd,%{_sbindir},/home/services/html/zabbix}
116
117 install bin/zabbix_* $RPM_BUILD_ROOT%{_sbindir}
118 install misc/conf/* $RPM_BUILD_ROOT%{_sysconfdir}
119 cp -r frontends/php/* $RPM_BUILD_ROOT/home/services/html/zabbix
120
121 install %SOURCE1 $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/zabbix-agent
122 install %SOURCE2 $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/zabbix-trapper
123
124 %clean
125 rm -rf $RPM_BUILD_ROOT
126
127 %pre
128 if [ -z "`/usr/bin/getgid zabbix`" ]; then
129         /usr/sbin/groupadd zabbix
130 fi
131 if [ -z "`/bin/id -u zabbix 2>/dev/null`" ]; then
132         /usr/sbin/useradd -d / -g zabbix -c "Zabbix User" -s /bin/false zabbix
133 fi
134
135 %postun
136 if [ "$1" = "0" ]; then
137         /usr/sbin/userdel zabbix
138         /usr/sbin/groupdel zabbix
139 fi
140
141 %post agent-inetd
142 if [ -f /var/lock/subsys/rc-inetd ]; then
143         /etc/rc.d/init.d/rc-inetd reload
144 else
145         echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet server" 1>&2
146 fi
147
148 %postun agent-inetd
149 if [ -f /var/lock/subsys/rc-inetd ]; then
150         /etc/rc.d/init.d/rc-inetd reload
151 fi
152
153 %post trapper-inetd
154 if [ -f /var/lock/subsys/rc-inetd ]; then
155         /etc/rc.d/init.d/rc-inetd reload
156 else
157         echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet server" 1>&2
158 fi
159
160 %postun trapper-inetd
161 if [ -f /var/lock/subsys/rc-inetd ]; then
162         /etc/rc.d/init.d/rc-inetd reload
163 fi
164
165 %files
166 %defattr(644,root,root,755)
167 %doc doc/manual.pdf AUTHORS ChangeLog FAQ TODO create bin/ZabbixW32.exe
168 %attr(750,root,zabbix) %dir %{_sysconfdir}
169
170 %files frontend-php
171 %defattr(644,root,root,755)
172 /home/services/html/zabbix
173
174 %files agent-inetd
175 %defattr(644,root,root,755)
176 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agent.conf
177 %attr(640,root,root) %config(noreplace) %verify(not mtime md5 size) /etc/sysconfig/rc-inetd/zabbix-agent
178 %attr(755,root,root) %{_sbindir}/zabbix_agent
179
180 %files agent-standalone
181 %defattr(644,root,root,755)
182 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_agentd.conf
183 %attr(755,root,root) %{_sbindir}/zabbix_agentd
184
185 %files suckerd
186 %defattr(644,root,root,755)
187 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_suckerd.conf
188 %attr(755,root,root) %{_sbindir}/zabbix_suckerd
189
190 %files trapper-inetd
191 %defattr(644,root,root,755)
192 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_trapper.conf
193 %attr(640,root,root) %config(noreplace) %verify(not mtime md5 size) /etc/sysconfig/rc-inetd/zabbix-trapper
194 %attr(755,root,root) %{_sbindir}/zabbix_trapper
195
196 %files trapper-standalone
197 %defattr(644,root,root,755)
198 %attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_trapperd.conf
199 %attr(755,root,root) %{_sbindir}/zabbix_trapperd
200
201 %files sender
202 %defattr(644,root,root,755)
203 %attr(755,root,root) %{_sbindir}/zabbix_sender
This page took 0.040454 seconds and 4 git commands to generate.