forked from mkoppanen/php-aware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaware.spec
226 lines (182 loc) · 5.06 KB
/
aware.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# Available build options, you will need rpm-build >= 4.0.3 for this to work.
# Example: rpmbuild -ba --with email aware.spec
#
# Storage Options
# ===============
# --with email
# --with files
# --with snmp
# --with spread
# --with stomp
# --with tokyo
# --with zeromq2
#
# These setup the storage backends to off by default
#
%bcond_with email
%bcond_with files
%bcond_with snmp
%bcond_with spread
%bcond_with stomp
%bcond_with tokyo
%bcond_with zeromq2
# Define version and release number
%define version @PACKAGE_VERSION@
%define release 1
Name: php-aware
Version: %{version}
Release: %{release}%{?dist}
Packager: Mikko Koppanen <[email protected]>
Summary: PHP aware extension
License: PHP License
Group: Web/Applications
URL: http://github.com/mkoppanen/php-aware
Source: aware-%{version}.tgz
Prefix: %{_prefix}
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: php-devel, make, gcc, /usr/bin/phpize
%description
Monitoring extension for PHP
%package devel
Summary: Development headers for %{name}
Group: Web/Applications
Requires: %{name} = %{version}-%{release}
%description devel
Development headers for %{name}
### Conditional build for email
%if %{with email}
%package email
Summary: Email storage engine for %{name}
Group: Web/Applications
Requires: %{name} = %{version}-%{release}
%description email
%{name} backend implementation which sends email.
%endif
### Conditional build for files
%if %{with files}
%package files
Summary: File storage engine for %{name}
Group: Web/Applications
Requires: %{name} = %{version}-%{release}
%description files
%{name} backend implementation which stores events in files.
%endif
### Conditional build for snmp
%if %{with snmp}
%package snmp
Summary: SNMP storage engine for %{name}
Group: Web/Applications
Requires: %{name} = %{version}-%{release}
%description snmp
%{name} backend implementation which sends events as SNMP traps.
%endif
### Conditional build for spread
%if %{with spread}
%package spread
Summary: Spread storage engine for %{name}
Group: Web/Applications
Requires: %{name} = %{version}-%{release}
%description Spread
%{name} backend implementation which sends events via spread.
%endif
### Conditional build for stomp
%if %{with stomp}
%package stomp
Summary: Stomp storage engine for %{name}
Group: Web/Applications
Requires: %{name} = %{version}-%{release}
%description stomp
%{name} backend implementation which sends events via stomp.
%endif
### Conditional build for zeromq2
%if %{with zeromq2}
%package zeromq2
Summary: zeromq2 storage engine for %{name}
Group: Web/Applications
Requires: %{name} = %{version}-%{release}
%description zeromq2
%{name} backend implementation which sends events via zeromq2.
%endif
%prep
%setup -q -n aware-%{version}
%build
/usr/bin/phpize && %configure -C && %{__make} %{?_smp_mflags}
# Clean the buildroot so that it does not contain any stuff from previous builds
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
# Install the extension
%{__make} install INSTALL_ROOT=%{buildroot}
# Create the ini location
%{__mkdir} -p %{buildroot}/etc/php.d
# Preliminary extension ini
echo "extension=aware.so" > %{buildroot}/%{_sysconfdir}/php.d/aware.ini
%if %{with email}
pushd storage/email
/usr/bin/phpize && cp ../../config.cache . && %configure -C && %{__make} %{?_smp_mflags}
%{__make} install INSTALL_ROOT=%{buildroot}
popd
%endif
%if %{with files}
pushd storage/files
/usr/bin/phpize && cp ../../config.cache . && %configure -C && %{__make} %{?_smp_mflags}
%{__make} install INSTALL_ROOT=%{buildroot}
popd
%endif
%if %{with snmp}
pushd storage/snmp
/usr/bin/phpize && cp ../../config.cache . && %configure -C && %{__make} %{?_smp_mflags}
%{__make} install INSTALL_ROOT=%{buildroot}
popd
%endif
%if %{with spread}
pushd storage/spread
/usr/bin/phpize && cp ../../config.cache . && %configure -C && %{__make} %{?_smp_mflags}
%{__make} install INSTALL_ROOT=%{buildroot}
popd
%endif
%if %{with stomp}
pushd storage/stomp
/usr/bin/phpize && cp ../../config.cache . && %configure -C && %{__make} %{?_smp_mflags}
%{__make} install INSTALL_ROOT=%{buildroot}
popd
%endif
%if %{with zeromq2}
pushd storage/zeromq2
/usr/bin/phpize && cp ../../config.cache . && %configure -C && %{__make} %{?_smp_mflags}
%{__make} install INSTALL_ROOT=%{buildroot}
popd
%endif
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%files
%{_libdir}/php/modules/aware.so
%{_sysconfdir}/php.d/aware.ini
%files devel
%{_includedir}/php/ext/aware/php_aware.h
%{_includedir}/php/ext/aware/php_aware_storage.h
%if %{with email}
%files email
%{_libdir}/php/modules/aware_email.so
%endif
%if %{with files}
%files files
%{_libdir}/php/modules/aware_files.so
%endif
%if %{with snmp}
%files snmp
%{_libdir}/php/modules/aware_snmp.so
%endif
%if %{with spread}
%files spread
%{_libdir}/php/modules/aware_spread.so
%endif
%if %{with stomp}
%files stomp
%{_libdir}/php/modules/aware_stomp.so
%endif
%if %{with zeromq2}
%files zeromq2
%{_libdir}/php/modules/aware_zeromq2.so
%endif
%changelog
* Sat Dec 12 2009 Mikko Koppanen <[email protected]>
- Initial spec file