]> err.no Git - sope/blob - maintenance/mod_ngobjweb_mdk100.spec
Drop apache 1 build-dependency
[sope] / maintenance / mod_ngobjweb_mdk100.spec
1 %define apache_modules_dir %{_usr}/lib/apache2
2 %define apache_conf_dir    %{_sysconfdir}/httpd/conf.d
3 %define apache_initscript  %{_sysconfdir}/init.d/httpd
4 %define ngobjweb_requires  apache2
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="/usr/sbin/apxs2" APXS_INCLUDE_DIRS="-I/usr/include/apache2"
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   %{apache_initscript} restart >/dev/null 2>&1
64 fi
65
66 # ****************************** trigger ******************************
67 %triggerin -- ogo-webui-app
68 if [ $2 = 1 ]; then
69 echo "# configuration needed to access the OGo webui
70 #
71 # explicitly allow access
72 <DirectoryMatch %{prefix}/share/opengroupware.org-([0-9a-zA-Z]{1}).([0-9a-zA-Z]{1,})/www> 
73   Order allow,deny 
74   Allow from all 
75 </DirectoryMatch>
76 # required aliases
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
80 #
81 # hook up
82 <IfModule ngobjweb_module.c>
83   <LocationMatch "^/OpenGroupware*">
84     SetAppPort 20000
85     SetHandler ngobjweb-adaptor
86   </LocationMatch>
87 </IfModule>
88 " >%{apache_conf_dir}/ogo-webui.conf
89
90 %{apache_initscript} restart >/dev/null 2>&1
91 fi
92
93 %triggerin -- ogo-xmlrpcd
94 if [ $2 = 1 ]; then
95 echo "# configuration needed to access the OGo XMLRPCd via http
96 #
97 # hook up
98 <IfModule ngobjweb_module.c>
99   <LocationMatch "^/RPC2*">
100     SetAppPort 22000
101     SetHandler ngobjweb-adaptor
102   </LocationMatch>
103 </IfModule>
104 " >%{apache_conf_dir}/ogo-xmlrpcd.conf
105
106 %{apache_initscript} restart >/dev/null 2>&1
107 fi
108
109 %triggerin -- ogo-zidestore
110 if [ $2 = 1 ]; then
111 echo "# configuration needed to access the OGo ZideStore via http
112 #
113 # hook up
114 <IfModule ngobjweb_module.c>
115   <LocationMatch "^/zidestore/*">
116     SetAppPort 21000
117     SetHandler ngobjweb-adaptor
118   </LocationMatch>
119 </IfModule>
120 " >%{apache_conf_dir}/ogo-zidestore.conf
121
122 %{apache_initscript} restart >/dev/null 2>&1
123 fi
124
125 %triggerin -- ogoall
126 if [ $2 = 1 ]; then
127 echo "# configuration needed to access the OGo webui
128 #
129 # explicitly allow access
130 <DirectoryMatch %{prefix}/share/opengroupware.org-([0-9a-zA-Z]{1}).([0-9a-zA-Z]{1,})/www> 
131   Order allow,deny 
132   Allow from all 
133 </DirectoryMatch>
134 # required aliases
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
138 #
139 # hook up
140 <IfModule ngobjweb_module.c>
141   <LocationMatch "^/OpenGroupware*">
142     SetAppPort 20000
143     SetHandler ngobjweb-adaptor
144   </LocationMatch>
145 </IfModule>
146 " >%{apache_conf_dir}/ogo-webui.conf
147 echo "# configuration needed to access the OGo XMLRPCd via http
148 #
149 # hook up
150 <IfModule ngobjweb_module.c>
151   <LocationMatch "^/RPC2*">
152     SetAppPort 22000
153     SetHandler ngobjweb-adaptor
154   </LocationMatch>
155 </IfModule>
156 " >%{apache_conf_dir}/ogo-xmlrpcd.conf
157 echo "# configuration needed to access the OGo ZideStore via http
158 #
159 # hook up
160 <IfModule ngobjweb_module.c>
161   <LocationMatch "^/zidestore/*">
162     SetAppPort 21000
163     SetHandler ngobjweb-adaptor
164   </LocationMatch>
165 </IfModule>
166 " >%{apache_conf_dir}/ogo-zidestore.conf
167
168 %{apache_initscript} restart >/dev/null 2>&1
169 fi
170
171 %triggerun -- ogoall
172 if [ $2 = 0 ]; then
173   if [ -f %{apache_conf_dir}/ogo-webui.conf ]; then
174     rm -f %{apache_conf_dir}/ogo-webui.conf
175   fi
176   if [ -f %{apache_conf_dir}/ogo-xmlrpcd.conf ]; then
177     rm -f %{apache_conf_dir}/ogo-xmlrpcd.conf
178   fi
179   if [ -f %{apache_conf_dir}/ogo-zidestore.conf ]; then
180     rm -f %{apache_conf_dir}/ogo-zidestore.conf
181   fi
182   %{apache_initscript} restart >/dev/null 2>&1
183 fi
184
185 %triggerun -- ogo-webui-app
186 if [ $2 = 0 ]; then
187   if [ -f %{apache_conf_dir}/ogo-webui.conf ]; then
188     rm -f %{apache_conf_dir}/ogo-webui.conf
189   fi
190   %{apache_initscript} restart >/dev/null 2>&1
191 fi
192
193 %triggerun -- ogo-xmlrpcd
194 if [ $2 = 0 ]; then
195   if [ -f %{apache_conf_dir}/ogo-xmlrpcd.conf ]; then
196     rm -f %{apache_conf_dir}/ogo-xmlrpcd.conf
197   fi
198   %{apache_initscript} restart >/dev/null 2>&1
199 fi
200
201 %triggerun -- ogo-zidestore
202 if [ $2 = 0 ]; then
203   if [ -f %{apache_conf_dir}/ogo-zidestore.conf ]; then
204     rm -f %{apache_conf_dir}/ogo-zidestore.conf
205   fi
206   %{apache_initscript} restart >/dev/null 2>&1
207 fi
208
209 # ****************************** clean ********************************
210 %clean
211 rm -fr ${RPM_BUILD_ROOT}
212
213 # ****************************** files ********************************
214 %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
221
222 # ********************************* changelog *************************
223 %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
235   removed or installed
236 * Fri Feb 18 2005 Frank Reppin <frank@opengroupware.org>
237 - moved parts to the 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 now
241 - OGo.conf lives in /etc/httpd/conf.d now...
242 * Wed Sep 09 2004 Frank Reppin <frank@opengroupware.org>
243 - initial build