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