]> err.no Git - sope/blob - maintenance/mod_ngobjweb_rhel3.spec
fixed some NGMail framework build issue
[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 <Directory %{prefix}/share/opengroupware.org-1.1/www> 
72   Order allow,deny 
73   Allow from all 
74 </Directory>
75 # required aliases
76 Alias /OpenGroupware11.woa/WebServerResources/ %{prefix}/share/opengroupware.org-1.1/www/
77 Alias /ArticleImages %{_var}/lib/opengroupware.org/news
78 #
79 # hook up
80 <IfModule ngobjweb_module.c>
81   <LocationMatch "^/OpenGroupware*">
82     SetAppPort 20000
83     SetHandler ngobjweb-adaptor
84   </LocationMatch>
85 </IfModule>
86 " >%{apache_conf_dir}/ogo-webui.conf
87
88 %{apache_initscript} restart >/dev/null 2>&1
89 fi
90
91 %triggerin -- ogo-xmlrpcd
92 if [ $2 = 1 ]; then
93 echo "# configuration needed to access the OGo XMLRPCd via http
94 #
95 # hook up
96 <IfModule ngobjweb_module.c>
97   <LocationMatch "^/RPC2*">
98     SetAppPort 22000
99     SetHandler ngobjweb-adaptor
100   </LocationMatch>
101 </IfModule>
102 " >%{apache_conf_dir}/ogo-xmlrpcd.conf
103
104 %{apache_initscript} restart >/dev/null 2>&1
105 fi
106
107 %triggerin -- ogo-zidestore
108 if [ $2 = 1 ]; then
109 echo "# configuration needed to access the OGo ZideStore via http
110 #
111 # hook up
112 <IfModule ngobjweb_module.c>
113   <LocationMatch "^/zidestore/*">
114     SetAppPort 21000
115     SetHandler ngobjweb-adaptor
116   </LocationMatch>
117 </IfModule>
118 " >%{apache_conf_dir}/ogo-zidestore.conf
119
120 %{apache_initscript} restart >/dev/null 2>&1
121 fi
122
123 %triggerin -- ogoall
124 if [ $2 = 1 ]; then
125 echo "# configuration needed to access the OGo webui
126 #
127 # explicitly allow access
128 <Directory %{prefix}/share/opengroupware.org-1.1/www> 
129   Order allow,deny 
130   Allow from all 
131 </Directory>
132 # required aliases
133 Alias /OpenGroupware11.woa/WebServerResources/ %{prefix}/share/opengroupware.org-1.1/www/
134 Alias /ArticleImages %{_var}/lib/opengroupware.org/news
135 #
136 # hook up
137 <IfModule ngobjweb_module.c>
138   <LocationMatch "^/OpenGroupware*">
139     SetAppPort 20000
140     SetHandler ngobjweb-adaptor
141   </LocationMatch>
142 </IfModule>
143 " >%{apache_conf_dir}/ogo-webui.conf
144 echo "# configuration needed to access the OGo XMLRPCd via http
145 #
146 # hook up
147 <IfModule ngobjweb_module.c>
148   <LocationMatch "^/RPC2*">
149     SetAppPort 22000
150     SetHandler ngobjweb-adaptor
151   </LocationMatch>
152 </IfModule>
153 " >%{apache_conf_dir}/ogo-xmlrpcd.conf
154 echo "# configuration needed to access the OGo ZideStore via http
155 #
156 # hook up
157 <IfModule ngobjweb_module.c>
158   <LocationMatch "^/zidestore/*">
159     SetAppPort 21000
160     SetHandler ngobjweb-adaptor
161   </LocationMatch>
162 </IfModule>
163 " >%{apache_conf_dir}/ogo-zidestore.conf
164
165 %{apache_initscript} restart >/dev/null 2>&1
166 fi
167
168 %triggerun -- ogoall
169 if [ $2 = 0 ]; then
170   if [ -f %{apache_conf_dir}/ogo-webui.conf ]; then
171     rm -f %{apache_conf_dir}/ogo-webui.conf
172   fi
173   if [ -f %{apache_conf_dir}/ogo-xmlrpcd.conf ]; then
174     rm -f %{apache_conf_dir}/ogo-xmlrpcd.conf
175   fi
176   if [ -f %{apache_conf_dir}/ogo-zidestore.conf ]; then
177     rm -f %{apache_conf_dir}/ogo-zidestore.conf
178   fi
179   %{apache_initscript} restart >/dev/null 2>&1
180 fi
181
182 %triggerun -- ogo-webui-app
183 if [ $2 = 0 ]; then
184   if [ -f %{apache_conf_dir}/ogo-webui.conf ]; then
185     rm -f %{apache_conf_dir}/ogo-webui.conf
186   fi
187   %{apache_initscript} restart >/dev/null 2>&1
188 fi
189
190 %triggerun -- ogo-xmlrpcd
191 if [ $2 = 0 ]; then
192   if [ -f %{apache_conf_dir}/ogo-xmlrpcd.conf ]; then
193     rm -f %{apache_conf_dir}/ogo-xmlrpcd.conf
194   fi
195   %{apache_initscript} restart >/dev/null 2>&1
196 fi
197
198 %triggerun -- ogo-zidestore
199 if [ $2 = 0 ]; then
200   if [ -f %{apache_conf_dir}/ogo-zidestore.conf ]; then
201     rm -f %{apache_conf_dir}/ogo-zidestore.conf
202   fi
203   %{apache_initscript} restart >/dev/null 2>&1
204 fi
205
206 # ****************************** clean ********************************
207 %clean
208 rm -fr ${RPM_BUILD_ROOT}
209
210 # ****************************** files ********************************
211 %files
212 %defattr(-,root,root,-)
213 %{apache_modules_dir}/mod_ngobjweb.so
214 %config %{apache_conf_dir}/ngobjweb.conf
215 %ghost %{apache_conf_dir}/ogo-webui.conf
216 %ghost %{apache_conf_dir}/ogo-xmlrpcd.conf
217 %ghost %{apache_conf_dir}/ogo-zidestore.conf
218
219 # ********************************* changelog *************************
220 %changelog
221 * Fri Jul 08 2005 Frank Reppin <frank@opengroupware.org>
222 - updated ogo-webui.conf to 1.1
223 * Tue Mar 01 2005 Frank Reppin <frank@opengroupware.org>
224 - drop dependency on ogo-environment
225 - allow triggers on ogoall package
226 * Sat Feb 19 2005 Frank Reppin <frank@opengroupware.org>
227 - replaced common vars with 2 new macros (will make editing safer)
228 - revisited last commit regarding OGo Bug #1254 and decided
229   to use triggers instead (and thus nothing moved into the application RPMS)
230 - application specific config files get installed/removed based on whether
231   the application itself is installed/removed and/or mod_ngobjweb itself gets
232   removed or installed
233 * Fri Feb 18 2005 Frank Reppin <frank@opengroupware.org>
234 - moved parts to application RPMS
235 * Thu Dec 23 2004 Frank Reppin <frank@opengroupware.org>
236 - requires httpd -obviously-
237 - mod_ngobjweb.so lives in /usr/lib/httpd/modules now
238 - OGo.conf lives in /etc/httpd/conf.d now...
239 * Wed Sep 09 2004 Frank Reppin <frank@opengroupware.org>
240 - initial build