1 %define apache_modules_dir %{_usr}/lib/apache2
2 %define apache_conf_dir %{_sysconfdir}/apache2/conf.d
3 %define apache_initscript %{_sysconfdir}/init.d/apache2
4 %define ngobjweb_requires apache2
6 Summary: mod_ngobjweb apache module
8 Version: %{mod_ngobjweb_version}
9 Release: %{mod_ngobjweb_release}.%{mod_ngobjweb_buildcount}%{dist_suffix}
10 Vendor: OpenGroupware.org
11 Packager: Frank Reppin <frank@opengroupware.org>
13 URL: http://sope.opengroupware.org/
14 Group: Development/Libraries
16 Requires: %{ngobjweb_requires}
17 Source: %{mod_ngobjweb_source}
18 Prefix: %{mod_ngobjweb_prefix}
19 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
22 Enables apache to handle HTTP requests for the
23 OpenGroupware.org application server.
26 rm -fr ${RPM_BUILD_ROOT}
27 %setup -q -n sope-mod_ngobjweb
29 # ****************************** build ********************************
31 export PATH=$PATH:/usr/sbin
32 make %{mod_ngobjweb_makeflags} APXS="/usr/sbin/apxs2" APXS_INCLUDE_DIRS="-I/usr/include/apache2"
34 # ****************************** install ******************************
36 export PATH=$PATH:/usr/sbin
37 mkdir -p ${RPM_BUILD_ROOT}%{apache_modules_dir}
38 cp mod_ngobjweb.so ${RPM_BUILD_ROOT}%{apache_modules_dir}/
40 mkdir -p ${RPM_BUILD_ROOT}%{apache_conf_dir}
41 echo "#Here we load the 'mod_ngobjweb.so' module
43 LoadModule ngobjweb_module %{apache_modules_dir}/mod_ngobjweb.so
44 " > ${RPM_BUILD_ROOT}%{apache_conf_dir}/ngobjweb.conf
47 touch ${RPM_BUILD_ROOT}%{apache_conf_dir}/ogo-webui.conf
48 touch ${RPM_BUILD_ROOT}%{apache_conf_dir}/ogo-xmlrpcd.conf
49 touch ${RPM_BUILD_ROOT}%{apache_conf_dir}/ogo-zidestore.conf
51 # ****************************** post *********************************
54 if [ -f %{apache_conf_dir}/ogo-webui.conf ]; then
55 rm -f %{apache_conf_dir}/ogo-webui.conf
57 if [ -f %{apache_conf_dir}/ogo-xmlrpcd.conf ]; then
58 rm -f %{apache_conf_dir}/ogo-xmlrpcd.conf
60 if [ -f %{apache_conf_dir}/ogo-zidestore.conf ]; then
61 rm -f %{apache_conf_dir}/ogo-zidestore.conf
63 %{apache_initscript} restart >/dev/null 2>&1
66 # ****************************** trigger ******************************
67 %triggerin -- ogo-webui-app
69 echo "# configuration needed to access the OGo webui
71 # explicitly allow access
72 <DirectoryMatch %{prefix}/share/opengroupware.org-([0-9a-zA-Z]{1}).([0-9a-zA-Z]{1,})/www>
77 AliasMatch ^/OpenGroupware([0-9a-zA-Z]{1})([0-9a-zA-Z]{1,})\.woa/WebServerResources/(.*) \
78 %{prefix}/share/opengroupware.org-\$1.\$2/www/\$3
79 Alias /ArticleImages %{_var}/lib/opengroupware.org/news
82 <IfModule ngobjweb_module.c>
83 <LocationMatch "^/OpenGroupware*">
85 SetHandler ngobjweb-adaptor
88 " >%{apache_conf_dir}/ogo-webui.conf
90 %{apache_initscript} restart >/dev/null 2>&1
93 %triggerin -- ogo-xmlrpcd
95 echo "# configuration needed to access the OGo XMLRPCd via http
98 <IfModule ngobjweb_module.c>
99 <LocationMatch "^/RPC2*">
101 SetHandler ngobjweb-adaptor
104 " >%{apache_conf_dir}/ogo-xmlrpcd.conf
106 %{apache_initscript} restart >/dev/null 2>&1
109 %triggerin -- ogo-zidestore
111 echo "# configuration needed to access the OGo ZideStore via http
114 <IfModule ngobjweb_module.c>
115 <LocationMatch "^/zidestore/*">
117 SetHandler ngobjweb-adaptor
120 " >%{apache_conf_dir}/ogo-zidestore.conf
122 %{apache_initscript} restart >/dev/null 2>&1
127 echo "# configuration needed to access the OGo webui
129 # explicitly allow access
130 <DirectoryMatch %{prefix}/share/opengroupware.org-([0-9a-zA-Z]{1}).([0-9a-zA-Z]{1,})/www>
135 AliasMatch ^/OpenGroupware([0-9a-zA-Z]{1})([0-9a-zA-Z]{1,})\.woa/WebServerResources/(.*) \
136 %{prefix}/share/opengroupware.org-\$1.\$2/www/\$3
137 Alias /ArticleImages %{_var}/lib/opengroupware.org/news
140 <IfModule ngobjweb_module.c>
141 <LocationMatch "^/OpenGroupware*">
143 SetHandler ngobjweb-adaptor
146 " >%{apache_conf_dir}/ogo-webui.conf
147 echo "# configuration needed to access the OGo XMLRPCd via http
150 <IfModule ngobjweb_module.c>
151 <LocationMatch "^/RPC2*">
153 SetHandler ngobjweb-adaptor
156 " >%{apache_conf_dir}/ogo-xmlrpcd.conf
157 echo "# configuration needed to access the OGo ZideStore via http
160 <IfModule ngobjweb_module.c>
161 <LocationMatch "^/zidestore/*">
163 SetHandler ngobjweb-adaptor
166 " >%{apache_conf_dir}/ogo-zidestore.conf
168 %{apache_initscript} restart >/dev/null 2>&1
173 if [ -f %{apache_conf_dir}/ogo-webui.conf ]; then
174 rm -f %{apache_conf_dir}/ogo-webui.conf
176 if [ -f %{apache_conf_dir}/ogo-xmlrpcd.conf ]; then
177 rm -f %{apache_conf_dir}/ogo-xmlrpcd.conf
179 if [ -f %{apache_conf_dir}/ogo-zidestore.conf ]; then
180 rm -f %{apache_conf_dir}/ogo-zidestore.conf
182 %{apache_initscript} restart >/dev/null 2>&1
185 %triggerun -- ogo-webui-app
187 if [ -f %{apache_conf_dir}/ogo-webui.conf ]; then
188 rm -f %{apache_conf_dir}/ogo-webui.conf
190 %{apache_initscript} restart >/dev/null 2>&1
193 %triggerun -- ogo-xmlrpcd
195 if [ -f %{apache_conf_dir}/ogo-xmlrpcd.conf ]; then
196 rm -f %{apache_conf_dir}/ogo-xmlrpcd.conf
198 %{apache_initscript} restart >/dev/null 2>&1
201 %triggerun -- ogo-zidestore
203 if [ -f %{apache_conf_dir}/ogo-zidestore.conf ]; then
204 rm -f %{apache_conf_dir}/ogo-zidestore.conf
206 %{apache_initscript} restart >/dev/null 2>&1
209 # ****************************** clean ********************************
211 rm -fr ${RPM_BUILD_ROOT}
213 # ****************************** files ********************************
215 %defattr(-,root,root,-)
216 %{apache_modules_dir}/mod_ngobjweb.so
217 %config %{apache_conf_dir}/ngobjweb.conf
218 %ghost %{apache_conf_dir}/ogo-webui.conf
219 %ghost %{apache_conf_dir}/ogo-xmlrpcd.conf
220 %ghost %{apache_conf_dir}/ogo-zidestore.conf
222 # ********************************* changelog *************************
224 * Fri Jul 08 2005 Frank Reppin <frank@opengroupware.org>
225 - updated ogo-webui.conf to 1.1
226 * Tue Mar 01 2005 Frank Reppin <frank@opengroupware.org>
227 - drop dependency on ogo-environment
228 - allow triggers on ogoall package
229 * Sat Feb 19 2005 Frank Reppin <frank@opengroupware.org>
230 - replaced common vars with 2 new macros (will make editing safer)
231 - revisited last commit regarding OGo Bug #1254 and decided
232 to use triggers instead (and thus nothing moved into the application RPMS)
233 - application specific config files get installed/removed based on whether
234 the application itself is installed/removed and/or mod_ngobjweb itself gets
236 * Fri Feb 18 2005 Frank Reppin <frank@opengroupware.org>
237 - moved parts to application RPMS
238 * Thu Dec 23 2004 Frank Reppin <frank@opengroupware.org>
239 - requires apache2 -obviously-
240 - mod_ngobjweb.so lives in /usr/lib/apache2/modules now
241 - OGo.conf lives in /etc/apache2/conf.d now...
242 which fixes -> http://bugzilla.opengroupware.org/bugzilla/show_bug.cgi?id=1020
243 * Wed Dec 21 2004 Frank Reppin <frank@opengroupware.org>
244 - dealt with http://bugzilla.opengroupware.org/bugzilla/show_bug.cgi?id=1084
245 * Wed Sep 09 2004 Frank Reppin <frank@opengroupware.org>