]> err.no Git - sope/blob - maintenance/mod_ngobjweb_suse82.spec
work on OSX packaging
[sope] / maintenance / mod_ngobjweb_suse82.spec
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
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 <Directory %{prefix}/share/opengroupware.org-1.1/www> 
73   Order allow,deny 
74   Allow from all 
75 </Directory>
76 # required aliases
77 Alias /OpenGroupware11.woa/WebServerResources/ %{prefix}/share/opengroupware.org-1.1/www/
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 <Directory %{prefix}/share/opengroupware.org-1.1/www> 
130   Order allow,deny 
131   Allow from all 
132 </Directory>
133 # required aliases
134 Alias /OpenGroupware11.woa/WebServerResources/ %{prefix}/share/opengroupware.org-1.1/www/
135 Alias /ArticleImages %{_var}/lib/opengroupware.org/news
136 #
137 # hook up
138 <IfModule ngobjweb_module.c>
139   <LocationMatch "^/OpenGroupware*">
140     SetAppPort 20000
141     SetHandler ngobjweb-adaptor
142   </LocationMatch>
143 </IfModule>
144 " >%{apache_conf_dir}/ogo-webui.conf
145 echo "# configuration needed to access the OGo XMLRPCd via http
146 #
147 # hook up
148 <IfModule ngobjweb_module.c>
149   <LocationMatch "^/RPC2*">
150     SetAppPort 22000
151     SetHandler ngobjweb-adaptor
152   </LocationMatch>
153 </IfModule>
154 " >%{apache_conf_dir}/ogo-xmlrpcd.conf
155 echo "# configuration needed to access the OGo ZideStore via http
156 #
157 # hook up
158 <IfModule ngobjweb_module.c>
159   <LocationMatch "^/zidestore/*">
160     SetAppPort 21000
161     SetHandler ngobjweb-adaptor
162   </LocationMatch>
163 </IfModule>
164 " >%{apache_conf_dir}/ogo-zidestore.conf
165
166 %{apache_initscript} restart >/dev/null 2>&1
167 fi
168
169 %triggerun -- ogoall
170 if [ $2 = 0 ]; then
171   if [ -f %{apache_conf_dir}/ogo-webui.conf ]; then
172     rm -f %{apache_conf_dir}/ogo-webui.conf
173   fi
174   if [ -f %{apache_conf_dir}/ogo-xmlrpcd.conf ]; then
175     rm -f %{apache_conf_dir}/ogo-xmlrpcd.conf
176   fi
177   if [ -f %{apache_conf_dir}/ogo-zidestore.conf ]; then
178     rm -f %{apache_conf_dir}/ogo-zidestore.conf
179   fi
180   %{apache_initscript} restart >/dev/null 2>&1
181 fi
182
183 %triggerun -- ogo-webui-app
184 if [ $2 = 0 ]; then
185   if [ -f %{apache_conf_dir}/ogo-webui.conf ]; then
186     rm -f %{apache_conf_dir}/ogo-webui.conf
187   fi
188   %{apache_initscript} restart >/dev/null 2>&1
189 fi
190
191 %triggerun -- ogo-xmlrpcd
192 if [ $2 = 0 ]; then
193   if [ -f %{apache_conf_dir}/ogo-xmlrpcd.conf ]; then
194     rm -f %{apache_conf_dir}/ogo-xmlrpcd.conf
195   fi
196   %{apache_initscript} restart >/dev/null 2>&1
197 fi
198
199 %triggerun -- ogo-zidestore
200 if [ $2 = 0 ]; then
201   if [ -f %{apache_conf_dir}/ogo-zidestore.conf ]; then
202     rm -f %{apache_conf_dir}/ogo-zidestore.conf
203   fi
204   %{apache_initscript} restart >/dev/null 2>&1
205 fi
206
207 # ****************************** clean ********************************
208 %clean
209 rm -fr ${RPM_BUILD_ROOT}
210
211 # ****************************** files ********************************
212 %files
213 %defattr(-,root,root,-)
214 %{apache_modules_dir}/mod_ngobjweb.so
215 %config %{apache_conf_dir}/ngobjweb.conf
216 %ghost %{apache_conf_dir}/ogo-webui.conf
217 %ghost %{apache_conf_dir}/ogo-xmlrpcd.conf
218 %ghost %{apache_conf_dir}/ogo-zidestore.conf
219
220 # ********************************* changelog *************************
221 %changelog
222 * Fri Jul 08 2005 Frank Reppin <frank@opengroupware.org>
223 - updated ogo-webui.conf to 1.1
224 * Tue Mar 01 2005 Frank Reppin <frank@opengroupware.org>
225 - drop dependency on ogo-environment
226 - allow triggers on ogoall package
227 * Sat Feb 19 2005 Frank Reppin <frank@opengroupware.org>
228 - replaced common vars with 2 new macros (will make editing safer)
229 - revisited last commit regarding OGo Bug #1254 and decided
230   to use triggers instead (and thus nothing moved into the application RPMS)
231 - application specific config files get installed/removed based on whether
232   the application itself is installed/removed and/or mod_ngobjweb itself gets
233   removed or installed
234 * Fri Feb 18 2005 Frank Reppin <frank@opengroupware.org>
235 - moved parts to application RPMS
236 * Thu Dec 23 2004 Frank Reppin <frank@opengroupware.org>
237 - requires apache2 -obviously-
238 - mod_ngobjweb.so lives in /usr/lib/apache2/modules now
239 - OGo.conf lives in /etc/apache2/conf.d now...
240   which fixes -> http://bugzilla.opengroupware.org/bugzilla/show_bug.cgi?id=1020
241 * Wed Sep 09 2004 Frank Reppin <frank@opengroupware.org>
242 - initial build