- undo broken workaround to svn diff -c4481
[opensuse:build-service.git] / dist / obs-server-test.spec
1 #
2 # spec file for package obs-server (Version 0.1)
3 #
4 # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 # This file and all modifications and additions to the pristine
6 # package are under the same license as the package itself.
7 #
8 # Please submit bugfixes or comments via http://bugs.opensuse.org/
9 #
10
11
12 Name:           obs-server
13 Requires:       perl-Socket-MsgHdr perl-XML-Parser perl-Compress-Zlib createrepo perl-Net_SSLeay
14 BuildRequires:  rubygem-builder python-devel
15 %if 0%{?suse_version:1}
16 PreReq:         %fillup_prereq %insserv_prereq
17 %endif
18 License:        GPL
19 Group:          Productivity/Networking/Web/Utilities
20 Autoreqprov:    on
21
22 %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
23 %define py_sitedir %{python_sitelib}
24
25 %define svnversion updated_by_script
26
27 Version:        %{svnversion}
28 Release:        0
29 Url:            http://en.opensuse.org/Build_Service
30 Summary:        The openSUSE Build Service -- Server Component
31 Source:         %{name}-%{svnversion}.tar.bz2
32 Source1:        obsworker
33 Source3:        obspublisher
34 Source4:        obsrepserver
35 Source5:        obssrcserver
36 Source6:        obsscheduler
37 Source7:        obs.conf
38 Source8:        cleanurl-v5.lua
39 Source9:        rails.include
40 Source10:       README.SETUP
41 Source11:       sysconfig.obs-worker
42 Source12:       sysconfig.obs-server
43 Source13:       obs_mirror_project
44 Source14:       obs_mirror_project.py
45 Source15:       obsdispatcher
46 %if 0%{?suse_version} >= 1020
47 Recommends:     yum yum-metadata-parser repoview dpkg
48 Requires:       createrepo >= 0.4.10
49 %else
50 Requires:       yum yum-metadata-parser repoview dpkg
51 Requires:       createrepo >= 0.4.10
52 %endif
53 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
54
55 %description
56 Authors:
57 --------
58     The openSUSE Team <opensuse-buildservice@opensuse.org>
59
60
61 %package -n osc-obs
62 Group:          Development/Tools/Other
63 License:        GNU General Public License (GPL)
64 Requires:       python-urlgrabber
65 %if 0%{?suse_version}
66 %if %suse_version < 1020
67 Requires:       python-elementtree
68 %else
69 Requires:       python-xml
70 %endif
71 %if %suse_version > 1000
72 Recommends:     rpm-python
73 %endif
74 %endif
75 Summary:        openSUSE (build service) commander
76
77 %description -n osc-obs
78 Commandline client for the openSUSE build service.
79
80 See http://en.opensuse.org/Build_Service/CLI , as well as
81 http://en.opensuse.org/Build_Service_Tutorial for a general introduction.
82
83 Authors:
84 --------
85     Peter Poeml <poeml@suse.de>
86
87 %package -n build-obs
88 %ifarch x86_64
89 Requires:       linux32
90 %endif
91 %ifarch ppc64
92 Requires:       powerpc32
93 %endif
94 %if 0%{?suse_version}
95 PreReq:         %fillup_prereq %insserv_prereq
96 %endif
97 Group:          Development/Tools/Building
98 Summary:        A Script to Build SUSE Linux RPMs and Debian DEBs
99
100 %description -n build-obs
101 This package provides a script for building RPMs for SUSE Linux in a
102 chroot environment.
103
104 %package -n obs-worker
105 Requires:       perl-TimeDate screen curl perl-XML-Parser perl-Compress-Zlib
106 %ifarch x86_64
107 Requires:       linux32
108 %endif
109 %ifarch ppc64
110 Requires:       powerpc32
111 %endif
112 %if 0%{?suse_version}
113 PreReq:         %fillup_prereq %insserv_prereq
114 %endif
115 Group:          Productivity/Networking/Web/Utilities
116 Summary:        The openSUSE Build Service -- Build Host Component
117
118 %description -n obs-worker
119
120 %package -n obs-api
121 %if 0%{?suse_version}
122 PreReq:         %fillup_prereq %insserv_prereq
123 %endif
124 Requires:       lighttpd ruby-fcgi lighttpd-mod_magnet mysql ruby-mysql rubygem-rake
125 Requires:       rubygem-rails >= 2.0
126 Group:          Productivity/Networking/Web/Utilities
127 Summary:        The openSUSE Build Service -- The Frontend part
128
129 %description -n obs-api
130
131 %prep
132 %setup -q -n buildservice
133 cp %SOURCE10 .
134
135 %build
136 # generate apidocs
137 cd docs/api/frontend
138 make apidocs
139 cd -
140
141 # compile osc python files
142 cd src/clientlib/python/osc
143 CFLAGS="%{optflags}" %{__python} setup.py build
144 cd -
145
146 %install
147 rm -rf $RPM_BUILD_ROOT
148
149 #
150 # Install all osc files
151 #
152 cd src/clientlib/python/osc
153 %{__python} setup.py install --prefix=%{_prefix} --root %{buildroot}
154 ln -s osc-wrapper.py %{buildroot}/%{_bindir}/osc
155 mkdir -p %{buildroot}/var/lib/osc-plugins
156 cd -
157
158 #
159 # Install all build files
160 #
161 cd src/build
162 mkdir -p $RPM_BUILD_ROOT/usr/{bin,lib/build,lib/build/configs,lib/build/Build,share/man/man1}
163 cp -a unrpm $RPM_BUILD_ROOT/usr/bin
164 cp -a Build.pm build createrpmdeps order getbinaryid expanddeps extractbuild getmacros getoptflags init_buildsystem substitutedeps $RPM_BUILD_ROOT/usr/lib/build/
165 cp -a changelog2spec debtransform $RPM_BUILD_ROOT/usr/lib/build/
166 cp -a configs/* $RPM_BUILD_ROOT/usr/lib/build/configs
167 cp -a Build/* $RPM_BUILD_ROOT/usr/lib/build/Build
168 cp -a mkbaselibs baselibs.conf baselibs_global.conf $RPM_BUILD_ROOT/usr/lib/build/
169 cp -a build.1 $RPM_BUILD_ROOT/usr/share/man/man1
170 ln -s /usr/lib/build/build $RPM_BUILD_ROOT/usr/bin/build
171 cd -
172
173 #
174 # Install all web and frontend parts.
175 #
176 cd src
177 for i in common frontend webclient; do
178   mkdir -p $RPM_BUILD_ROOT/srv/www/obs/
179   cp -a $i $RPM_BUILD_ROOT/srv/www/obs/$i
180 done
181 # configure lighttpd web service
182 mkdir -p $RPM_BUILD_ROOT/etc/lighttpd/vhosts.d/
183 install -m 0644 %SOURCE7 $RPM_BUILD_ROOT/etc/lighttpd/vhosts.d/
184 install -m 0644 %SOURCE9 $RPM_BUILD_ROOT/etc/lighttpd/vhosts.d/rails.inc
185 install -m 0644 %SOURCE8 $RPM_BUILD_ROOT/etc/lighttpd/
186 rm $RPM_BUILD_ROOT/srv/www/obs/frontend/README_LOGIN
187 rm $RPM_BUILD_ROOT/srv/www/obs/frontend/files/specfiletemplate
188 # fix path
189 for i in $RPM_BUILD_ROOT/srv/www/obs/*/config/environment.rb; do
190   sed "s,/srv/www/opensuse/common/current/lib,/srv/www/obs/common/lib," \
191     "$i" > "$i"_ && mv "$i"_ "$i"
192 done
193 #set default api on localhost for the webclient
194 #sed 's,FRONTEND_HOST.*,FRONTEND_HOST = "127.0.42.2",' \
195 #  $RPM_BUILD_ROOT/srv/www/obs/webclient/config/environments/development.rb > tmp-file \
196 #  && mv tmp-file "$RPM_BUILD_ROOT/srv/www/obs/webclient/config/environments/development.rb"
197 #sed 's,FRONTEND_PORT.*,FRONTEND_PORT = 80,' \
198 #  $RPM_BUILD_ROOT/srv/www/obs/webclient/config/environments/development.rb > tmp-file \
199 #  && mv tmp-file "$RPM_BUILD_ROOT/srv/www/obs/webclient/config/environments/development.rb"
200 #sed 's,api.opensuse.org,127.0.42.2,' \
201 #  $RPM_BUILD_ROOT/srv/www/obs/webclient/app/helpers/package_helper.rb > tmp-file \
202 #  && mv tmp-file "$RPM_BUILD_ROOT/srv/www/obs/webclient/app/helpers/package_helper.rb"
203
204 #
205 # install apidocs
206
207 mkdir -p $RPM_BUILD_ROOT/srv/www/obs/frontend/public/apidocs/html/
208 cp -a ../docs/api/html           $RPM_BUILD_ROOT/srv/www/obs/frontend/public/apidocs/
209 mkdir -p $RPM_BUILD_ROOT/srv/www/obs/frontend/public/schema/
210 cp -a ../docs/api/frontend/*.{rng,xsd}    $RPM_BUILD_ROOT/srv/www/obs/frontend/public/schema/
211 #
212 # Install all backend parts.
213 #
214 cd backend/
215 install -d -m 755 $RPM_BUILD_ROOT/usr/lib/obs/server/
216 install -d -m 755 $RPM_BUILD_ROOT/usr/sbin/
217 install -d -m 755 $RPM_BUILD_ROOT/etc/init.d/
218 install -d -m 755 $RPM_BUILD_ROOT/srv/obs/projects
219 install -d -m 755 $RPM_BUILD_ROOT/srv/obs/log
220 install -d -m 755 $RPM_BUILD_ROOT/srv/obs/run
221 # install executables and code
222 cp -a * $RPM_BUILD_ROOT/usr/lib/obs/server/
223 # install mirror script
224 install -m 0755 %SOURCE13 %SOURCE14 $RPM_BUILD_ROOT/usr/sbin/
225 # install  runlevel scripts
226 install -m 0755 %SOURCE1 %SOURCE3 %SOURCE4 %SOURCE5 %SOURCE6 %SOURCE15 \
227            $RPM_BUILD_ROOT/etc/init.d/
228 for i in obssrcserver obsrepserver obsscheduler obsworker obspublisher obsdispatcher ; do
229   ln -sf /etc/init.d/$i $RPM_BUILD_ROOT/usr/sbin/rc$i
230 done
231 # Ship latest version of build to be always in sync. do not use the symlink.
232 rm -rf $RPM_BUILD_ROOT/usr/lib/obs/server/build
233 cp -a ../build $RPM_BUILD_ROOT/usr/lib/obs/server/build
234 # install fillups
235 FILLUP_DIR=$RPM_BUILD_ROOT/var/adm/fillup-templates
236 mkdir -p $FILLUP_DIR
237 cp -a %SOURCE11 %SOURCE12 $FILLUP_DIR/
238
239 %pre
240 /usr/sbin/groupadd -r obsrun 2> /dev/null || :
241 /usr/sbin/useradd -r -o -s /bin/false -c "User for build service backend" -d /usr/lib/obs -g obsrun obsrun 2> /dev/null || :
242
243 %post -n obs-server
244 %{fillup_and_insserv -n obs-server}
245
246 %post -n obs-worker
247 %{fillup_and_insserv -n obs-worker}
248
249 %post -n obs-api
250 touch /srv/www/obs/{webclient,frontend}/log/development.log
251 chown lighttpd:lighttpd /srv/www/obs/{webclient,frontend}/log/development.log
252
253 %clean
254 rm -rf $RPM_BUILD_ROOT
255
256 %files
257 %defattr(-,root,root)
258 %dir /usr/lib/obs
259 %dir /usr/lib/obs/server
260 /etc/init.d/obsdispatcher
261 /etc/init.d/obspublisher
262 /etc/init.d/obsrepserver
263 /etc/init.d/obsscheduler
264 /etc/init.d/obssrcserver
265 /usr/sbin/rcobsdispatcher
266 /usr/sbin/rcobspublisher
267 /usr/sbin/rcobsrepserver
268 /usr/sbin/rcobsscheduler
269 /usr/sbin/rcobssrcserver
270 /usr/sbin/obs_mirror_project
271 /usr/sbin/obs_mirror_project.py
272 /usr/lib/obs/server/BSBuild.pm
273 /usr/lib/obs/server/BSConfig.pm
274 /usr/lib/obs/server/BSEvents.pm
275 /usr/lib/obs/server/BSFileDB.pm
276 /usr/lib/obs/server/BSHTTP.pm
277 /usr/lib/obs/server/BSHandoff.pm
278 /usr/lib/obs/server/BSRPC.pm
279 /usr/lib/obs/server/BSServer.pm
280 /usr/lib/obs/server/BSServerEvents.pm
281 /usr/lib/obs/server/BSSrcdiff.pm
282 /usr/lib/obs/server/BSSSL.pm
283 /usr/lib/obs/server/BSStdServer.pm
284 /usr/lib/obs/server/BSUtil.pm
285 /usr/lib/obs/server/BSVerify.pm
286 /usr/lib/obs/server/BSDB.pm
287 /usr/lib/obs/server/BSDBIndex.pm
288 /usr/lib/obs/server/BSXPathKeys.pm
289 /usr/lib/obs/server/BSWatcher.pm
290 /usr/lib/obs/server/BSXML.pm
291 /usr/lib/obs/server/BSXPath.pm
292 /usr/lib/obs/server/COPYING
293 /usr/lib/obs/server/DESIGN
294 /usr/lib/obs/server/License
295 /usr/lib/obs/server/README
296 /usr/lib/obs/server/TODO
297 /usr/lib/obs/server/XML
298 /usr/lib/obs/server/bs_*
299 /usr/lib/obs/server/build
300 /usr/lib/obs/server/worker
301 /usr/lib/obs/server/BSHermes.pm
302 %attr(-,obsrun,obsrun) /srv/obs
303 /var/adm/fillup-templates/sysconfig.obs-server
304
305 %files -n osc-obs
306 %defattr(-,root,root)
307 %doc src/clientlib/python/osc/{README,TODO,NEWS}
308 %{_bindir}/osc*
309 %{python_sitelib}/*
310 %dir /var/lib/osc-plugins
311
312 %files -n build-obs
313 %defattr(-,root,root)
314 %doc src/build/README
315 /usr/bin/build
316 /usr/bin/unrpm
317 /usr/lib/build
318 %{_mandir}/man1/build.1.*
319
320 %files -n obs-worker
321 %defattr(-,root,root)
322 /var/adm/fillup-templates/sysconfig.obs-worker
323 /etc/init.d/obsworker
324 /usr/sbin/rcobsworker
325
326 %files -n obs-api
327 %defattr(-,root,root)
328 %doc README.SETUP docs/openSUSE.org.xml ReleaseNotes-0.9 ReleaseNotes-0.9.1
329 %dir /srv/www/obs
330 /srv/www/obs/common
331 %dir /srv/www/obs/frontend
332 /srv/www/obs/frontend/app
333 /srv/www/obs/frontend/Changelog
334 /srv/www/obs/frontend/components
335 /srv/www/obs/frontend/db
336 /srv/www/obs/frontend/doc
337 /srv/www/obs/frontend/files
338 /srv/www/obs/frontend/lib
339 /srv/www/obs/frontend/public
340 /srv/www/obs/frontend/Rakefile
341 /srv/www/obs/frontend/README
342 /srv/www/obs/frontend/script
343 /srv/www/obs/frontend/test
344 /srv/www/obs/frontend/vendor
345 %dir /srv/www/obs/webclient
346 /srv/www/obs/webclient/app
347 /srv/www/obs/webclient/Changelog
348 /srv/www/obs/webclient/components
349 /srv/www/obs/webclient/db
350 /srv/www/obs/webclient/doc
351 /srv/www/obs/webclient/lib
352 /srv/www/obs/webclient/public
353 /srv/www/obs/webclient/Rakefile
354 /srv/www/obs/webclient/README
355 /srv/www/obs/webclient/script
356 /srv/www/obs/webclient/test
357 /srv/www/obs/webclient/vendor
358 %config(noreplace) /srv/www/obs/frontend/config
359 %config(noreplace) /srv/www/obs/webclient/config
360 %attr(-,lighttpd,lighttpd) /srv/www/obs/frontend/log
361 %attr(-,lighttpd,lighttpd) /srv/www/obs/frontend/tmp
362 %attr(-,lighttpd,lighttpd) /srv/www/obs/webclient/log
363 %attr(-,lighttpd,lighttpd) /srv/www/obs/webclient/tmp
364 %config(noreplace) /etc/lighttpd/vhosts.d/obs.conf
365 %config /etc/lighttpd/cleanurl-v5.lua
366 %config /etc/lighttpd/vhosts.d/rails.inc
367
368 %changelog -n obs-server
369 * Fri Jan 26 2007 - poeml@suse.de
370 - implement status/restart in the init scripts
371 * Fri Jan 26 2007 - poeml@suse.de
372 - added dependency on createrepo
373 * Fri Jan 26 2007 - poeml@suse.de
374 - update to r1110
375   - revert last change, and do it the ruby way, by creating a new
376   migration for it... so existing installations are upgraded
377   - fix truncated line in sorting algorithm
378   - add missing mkdir
379   - add url to package metadata
380 - fix build / install sysconfig files
381 - fix copyright headers in init script
382 - fix path in README where to copy packages to
383 * Thu Jan 25 2007 - poeml@suse.de
384 - update to r1108
385   create a few more architectures, when initializing the database