]> err.no Git - sope/blob - maintenance/mod_ngobjweb_rhel3.spec
Add libxml2-dev to libsope-xml4.7-dev deps
[sope] / maintenance / mod_ngobjweb_rhel3.spec
1 %define apache_modules_dir %{_usr}/lib/httpd/modules
2 %define apache_conf_dir    %{_sysconfdir}/httpd/conf.d
3 %define apache_initscript  %{_sysconfdir}/init.d/httpd
4 %define ngobjweb_requires  httpd
5
6 Summary:      mod_ngobjweb apache module
7 Name:         mod_ngobjweb
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>  
12 License:      LGPL
13 URL:          http://sope.opengroupware.org/
14 Group:        Development/Libraries
15 AutoReqProv:  off
16 Requires:     %{ngobjweb_requires}
17 Source:       %{mod_ngobjweb_source}
18 Prefix:       %{mod_ngobjweb_prefix}
19 BuildRoot:    %{_tmppath}/%{name}-%{version}-%{release}-root
20
21 %description
22 Enables apache to handle HTTP requests for the
23 OpenGroupware.org application server.
24
25 %prep
26 rm -fr ${RPM_BUILD_ROOT}
27 %setup -q -n sope-mod_ngobjweb
28
29 # ****************************** build ********************************
30 %build
31 export PATH=$PATH:/usr/sbin
32 make %{mod_ngobjweb_makeflags} APXS_INCLUDE_DIRS="-I/usr/include/httpd"
33
34 # ****************************** install ******************************
35 %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}/
39
40 mkdir -p ${RPM_BUILD_ROOT}%{apache_conf_dir}
41 echo "#Here we load the 'mod_ngobjweb.so' module
42 #
43 LoadModule ngobjweb_module %{apache_modules_dir}/mod_ngobjweb.so
44 " > ${RPM_BUILD_ROOT}%{apache_conf_dir}/ngobjweb.conf
45
46 # touch ghosts
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
50
51 # ****************************** post *********************************
52 %preun
53 if [ $1 = 0 ]; then
54   if [ -f %{apache_conf_dir}/ogo-webui.conf ]; then
55     rm -f %{apache_conf_dir}/ogo-webui.conf
56   fi
57   if [ -f %{apache_conf_dir}/ogo-xmlrpcd.conf ]; then
58     rm -f %{apache_conf_dir}/ogo-xmlrpcd.conf
59   fi
60   if [ -f %{apache_conf_dir}/ogo-zidestore.conf ]; then
61     rm -f %{apache_conf_dir}/ogo-zidestore.conf
62   fi
63 fi
64
65 # ****************************** trigger ******************************
66 %triggerin -- ogo-webui-app
67 if [ $2 = 1 ]; then
68 echo "# configuration needed to access the OGo webui
69 #
70 # explicitly allow access
71 <DirectoryMatch %{prefix}/share/opengroupware.org-([0-9a-zA-Z]{1}).([0-9a-zA-Z]{1,})/www> 
72   Order allow,deny 
73   Allow from all 
74 </DirectoryMatch>
75 # required aliases
76 AliasMatch ^/OpenGroupware([0-9a-zA-Z]{1})([0-9a-zA-Z]{1,})\.woa/WebServerResources/(.*) \
77            %{prefix}/share/opengroupware.org-\$1.\$2/www/\$3
78 Alias /ArticleImages %{_var}/lib/opengroupware.org/news
79 #
80 # hook up
81 <IfModule ngobjweb_module.c>
82   <LocationMatch "^/OpenGroupware*">
83     SetAppPort 20000
84     SetHandler ngobjweb-adaptor
85   </LocationMatch>
86 </IfModule>
87 " >%{apache_conf_dir}/ogo-webui.conf
88
89 %{apache_initscript} restart >/dev/null 2>&1
90 fi
91
92 %triggerin -- ogo-xmlrpcd
93 if [ $2 = 1 ]; then
94 echo "# configuration needed to access the OGo XMLRPCd via http
95 #
96 # hook up
97 <IfModule ngobjweb_module.c>
98   <LocationMatch "^/RPC2*">
99     SetAppPort 22000
100     SetHandler ngobjweb-adaptor
101   </LocationMatch>
102 </IfModule>
103 " >%{apache_conf_dir}/ogo-xmlrpcd.conf
104
105 %{apache_initscript} restart >/dev/null 2>&1
106 fi
107
108 %triggerin -- ogo-zidestore
109 if [ $2 = 1 ]; then
110 echo "# configuration needed to access the OGo ZideStore via http
111 #
112 # hook up
113 <IfModule ngobjweb_module.c>
114   <LocationMatch "^/zidestore/*">
115     SetAppPort 21000
116     SetHandler ngobjweb-adaptor
117   </LocationMatch>
118 </IfModule>
119 " >%{apache_conf_dir}/ogo-zidestore.conf
120
121 %{apache_initscript} restart >/dev/null 2>&1
122 fi
123
124 %triggerin -- ogoall
125 if [ $2 = 1 ]; then
126 echo "# configuration needed to access the OGo webui
127 #
128 # explicitly allow access
129 <DirectoryMatch %{prefix}/share/opengroupware.org-([0-9a-zA-Z]{1}).([0-9a-zA-Z]{1,})/www> 
130   Order allow,deny 
131   Allow from all 
132 </DirectoryMatch>
133 # required aliases
134 AliasMatch ^/OpenGroupware([0-9a-zA-Z]{1})([0-9a-zA-Z]{1,})\.woa/WebServerResources/(.*) \
135            %{prefix}/share/opengroupware.org-\$1.\$2/www/\$3
136 Alias /ArticleImages %{_var}/lib/opengroupware.org/news
137 #
138 # hook up
139 <IfModule ngobjweb_module.c>
140   <LocationMatch "^/OpenGroupware*">
141     SetAppPort 20000
142     SetHandler ngobjweb-adaptor
143   </LocationMatch>
144 </IfModule>
145 " >%{apache_conf_dir}/ogo-webui.conf
146 echo "# configuration needed to access the OGo XMLRPCd via http
147 #
148 # hook up
149 <IfModule ngobjweb_module.c>
150   <LocationMatch "^/RPC2*">
151     SetAppPort 22000
152     SetHandler ngobjweb-adaptor
153   </LocationMatch>
154 </IfModule>
155 " >%{apache_conf_dir}/ogo-xmlrpcd.conf
156 echo "# configuration needed to access the OGo ZideStore via http
157 #
158 # hook up
159 <IfModule ngobjweb_module.c>
160   <LocationMatch "^/zidestore/*">
161     SetAppPort 21000
162     SetHandler ngobjweb-adaptor
163   </LocationMatch>
164 </IfModule>
165 " >%{apache_conf_dir}/ogo-zidestore.conf
166
167 %{apache_initscript} restart >/dev/null 2>&1
168 fi
169
170 %triggerun -- ogoall
171 if [ $2 = 0 ]; then
172   if [ -f %{apache_conf_dir}/ogo-webui.conf ]; then
173     rm -f %{apache_conf_dir}/ogo-webui.conf
174   fi
175   if [ -f %{apache_conf_dir}/ogo-xmlrpcd.conf ]; then
176     rm -f %{apache_conf_dir}/ogo-xmlrpcd.conf
177   fi
178   if [ -f %{apache_conf_dir}/ogo-zidestore.conf ]; then
179     rm -f %{apache_conf_dir}/ogo-zidestore.conf
180   fi
181   %{apache_initscript} restart >/dev/null 2>&1
182 fi
183
184 %triggerun -- ogo-webui-app
185 if [ $2 = 0 ]; then
186   if [ -f %{apache_conf_dir}/ogo-webui.conf ]; then
187     rm -f %{apache_conf_dir}/ogo-webui.conf
188   fi
189   %{apache_initscript} restart >/dev/null 2>&1
190 fi
191
192 %triggerun -- ogo-xmlrpcd
193 if [ $2 = 0 ]; then
194   if [ -f %{apache_conf_dir}/ogo-xmlrpcd.conf ]; then
195     rm -f %{apache_conf_dir}/ogo-xmlrpcd.conf
196   fi
197   %{apache_initscript} restart >/dev/null 2>&1
198 fi
199
200 %triggerun -- ogo-zidestore
201 if [ $2 = 0 ]; then
202   if [ -f %{apache_conf_dir}/ogo-zidestore.conf ]; then
203     rm -f %{apache_conf_dir}/ogo-zidestore.conf
204   fi
205   %{apache_initscript} restart >/dev/null 2>&1
206 fi
207
208 # ****************************** clean ********************************
209 %clean
210 rm -fr ${RPM_BUILD_ROOT}
211
212 # ****************************** files ********************************
213 %files
214 %defattr(-,root,root,-)
215 %{apache_modules_dir}/mod_ngobjweb.so
216 %config %{apache_conf_dir}/ngobjweb.conf
217 %ghost %{apache_conf_dir}/ogo-webui.conf
218 %ghost %{apache_conf_dir}/ogo-xmlrpcd.conf
219 %ghost %{apache_conf_dir}/ogo-zidestore.conf
220
221 # ********************************* changelog *************************
222 %changelog
223 * Fri Jul 08 2005 Frank Reppin <frank@opengroupware.org>
224 - updated ogo-webui.conf to 1.1
225 * Tue Mar 01 2005 Frank Reppin <frank@opengroupware.org>
226 - drop dependency on ogo-environment
227 - allow triggers on ogoall package
228 * Sat Feb 19 2005 Frank Reppin <frank@opengroupware.org>
229 - replaced common vars with 2 new macros (will make editing safer)
230 - revisited last commit regarding OGo Bug #1254 and decided
231   to use triggers instead (and thus nothing moved into the application RPMS)
232 - application specific config files get installed/removed based on whether
233   the application itself is installed/removed and/or mod_ngobjweb itself gets
234   removed or installed
235 * Fri Feb 18 2005 Frank Reppin <frank@opengroupware.org>
236 - moved parts to application RPMS
237 * Thu Dec 23 2004 Frank Reppin <frank@opengroupware.org>
238 - requires httpd -obviously-
239 - mod_ngobjweb.so lives in /usr/lib/httpd/modules now
240 - OGo.conf lives in /etc/httpd/conf.d now...
241 * Wed Sep 09 2004 Frank Reppin <frank@opengroupware.org>
242 - initial build