- undo broken workaround to svn diff -c4481
[opensuse:build-service.git] / dist / obs-server-svn.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 svnversion updated_by_script
23
24 Version:        %{svnversion}
25 Release:        0
26 Url:            http://en.opensuse.org/Build_Service
27 Summary:        The openSUSE Build Service -- Server Component
28 Source:         %{name}-%{svnversion}.tar.bz2
29 Source1:        obsworker
30 Source3:        obspublisher
31 Source4:        obsrepserver
32 Source5:        obssrcserver
33 Source6:        obsscheduler
34 Source7:        obs.conf
35 Source8:        cleanurl-v5.lua
36 Source9:        rails.include
37 Source10:       README.SETUP
38 Source11:       sysconfig.obs-worker
39 Source12:       sysconfig.obs-server
40 Source13:       obs_mirror_project
41 Source14:       obs_mirror_project.py
42 Source15:       obsdispatcher
43 %if 0%{?suse_version} >= 1020
44 Recommends:     yum yum-metadata-parser repoview dpkg
45 Requires:       createrepo >= 0.4.10
46 %else
47 Requires:       yum yum-metadata-parser repoview dpkg
48 Requires:       createrepo >= 0.4.10
49 %endif
50 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
51 BuildArchitectures: noarch
52
53 %description
54 Authors:
55 --------
56     The openSUSE Team <opensuse-buildservice@opensuse.org>
57
58 %package -n obs-worker
59 Requires:       perl-TimeDate screen curl perl-XML-Parser perl-Compress-Zlib
60 %ifarch x86_64
61 Requires:       linux32
62 %endif
63 %ifarch ppc64
64 Requires:       powerpc32
65 %endif
66 %if 0%{?suse_version}
67 PreReq:         %fillup_prereq %insserv_prereq
68 %endif
69 Group:          Productivity/Networking/Web/Utilities
70 Summary:        The openSUSE Build Service -- Build Host Component
71
72 %description -n obs-worker
73
74 %package -n obs-api
75 %if 0%{?suse_version}
76 PreReq:         %fillup_prereq %insserv_prereq
77 %endif
78 Requires:       lighttpd ruby-fcgi lighttpd-mod_magnet mysql ruby-mysql rubygem-rake
79 Requires:       rubygem-rails >= 2.0
80 Group:          Productivity/Networking/Web/Utilities
81 Summary:        The openSUSE Build Service -- The Frontend part
82
83 %description -n obs-api
84
85 %prep
86 %setup -q -n buildservice
87 cp %SOURCE10 .
88
89 %build
90 #
91 # generate apidocs
92 #
93 cd docs/api/frontend
94 make apidocs
95 cd -
96
97 %install
98 #
99 # Install all web and frontend parts.
100 #
101 cd src
102 for i in common frontend webclient; do
103   mkdir -p $RPM_BUILD_ROOT/srv/www/obs/
104   cp -a $i $RPM_BUILD_ROOT/srv/www/obs/$i
105 done
106 # configure lighttpd web service
107 mkdir -p $RPM_BUILD_ROOT/etc/lighttpd/vhosts.d/
108 install -m 0644 %SOURCE7 $RPM_BUILD_ROOT/etc/lighttpd/vhosts.d/
109 install -m 0644 %SOURCE9 $RPM_BUILD_ROOT/etc/lighttpd/vhosts.d/rails.inc
110 install -m 0644 %SOURCE8 $RPM_BUILD_ROOT/etc/lighttpd/
111 rm $RPM_BUILD_ROOT/srv/www/obs/frontend/README_LOGIN
112 rm $RPM_BUILD_ROOT/srv/www/obs/frontend/files/specfiletemplate
113 # fix path
114 for i in $RPM_BUILD_ROOT/srv/www/obs/*/config/environment.rb; do
115   sed "s,/srv/www/opensuse/common/current/lib,/srv/www/obs/common/lib," \
116     "$i" > "$i"_ && mv "$i"_ "$i"
117 done
118
119 #
120 #set default api on localhost for the webclient
121
122 sed 's,FRONTEND_HOST.*,FRONTEND_HOST = "127.0.42.2",' \
123   $RPM_BUILD_ROOT/srv/www/obs/webclient/config/environments/development.rb > tmp-file \
124   && mv tmp-file "$RPM_BUILD_ROOT/srv/www/obs/webclient/config/environments/development.rb"
125 sed 's,FRONTEND_PORT.*,FRONTEND_PORT = 80,' \
126   $RPM_BUILD_ROOT/srv/www/obs/webclient/config/environments/development.rb > tmp-file \
127   && mv tmp-file "$RPM_BUILD_ROOT/srv/www/obs/webclient/config/environments/development.rb"
128 sed 's,api.opensuse.org,127.0.42.2,' \
129   $RPM_BUILD_ROOT/srv/www/obs/webclient/app/helpers/package_helper.rb > tmp-file \
130   && mv tmp-file "$RPM_BUILD_ROOT/srv/www/obs/webclient/app/helpers/package_helper.rb"
131
132 #
133 # install apidocs
134
135 mkdir -p $RPM_BUILD_ROOT/srv/www/obs/frontend/public/apidocs/html/
136 cp -a ../docs/api/html           $RPM_BUILD_ROOT/srv/www/obs/frontend/public/apidocs/
137 mkdir -p $RPM_BUILD_ROOT/srv/www/obs/frontend/public/schema/
138 cp -a ../docs/api/frontend/*.{rng,xsd}    $RPM_BUILD_ROOT/srv/www/obs/frontend/public/schema/
139 #
140 # Install all backend parts.
141 #
142 cd backend/
143 install -d -m 755 $RPM_BUILD_ROOT/usr/lib/obs/server/
144 install -d -m 755 $RPM_BUILD_ROOT/usr/sbin/
145 install -d -m 755 $RPM_BUILD_ROOT/etc/init.d/
146 install -d -m 755 $RPM_BUILD_ROOT/srv/obs/projects
147 install -d -m 755 $RPM_BUILD_ROOT/srv/obs/log
148 install -d -m 755 $RPM_BUILD_ROOT/srv/obs/run
149 # install executables and code
150 cp -a * $RPM_BUILD_ROOT/usr/lib/obs/server/
151 # install mirror script
152 install -m 0755 %SOURCE13 %SOURCE14 $RPM_BUILD_ROOT/usr/sbin/
153 # install  runlevel scripts
154 install -m 0755 %SOURCE1 %SOURCE3 %SOURCE4 %SOURCE5 %SOURCE6 %SOURCE15 \
155            $RPM_BUILD_ROOT/etc/init.d/
156 for i in obssrcserver obsrepserver obsscheduler obsworker obspublisher obsdispatcher ; do
157   ln -sf /etc/init.d/$i $RPM_BUILD_ROOT/usr/sbin/rc$i
158 done
159 # Ship latest version of build to be always in sync. do not use the symlink.
160 rm -rf $RPM_BUILD_ROOT/usr/lib/obs/server/build
161 cp -a ../build $RPM_BUILD_ROOT/usr/lib/obs/server/build
162 # install fillups
163 FILLUP_DIR=$RPM_BUILD_ROOT/var/adm/fillup-templates
164 mkdir -p $FILLUP_DIR
165 cp -a %SOURCE11 %SOURCE12 $FILLUP_DIR/
166
167 %pre
168 /usr/sbin/groupadd -r obsrun 2> /dev/null || :
169 /usr/sbin/useradd -r -o -s /bin/false -c "User for build service backend" -d /usr/lib/obs -g obsrun obsrun 2> /dev/null || :
170
171 %post -n obs-server
172 %{fillup_and_insserv -n obs-server}
173
174 %post -n obs-worker
175 %{fillup_and_insserv -n obs-worker}
176
177 %post -n obs-api
178 touch /srv/www/obs/{webclient,frontend}/log/development.log
179 chown lighttpd:lighttpd /srv/www/obs/{webclient,frontend}/log/development.log
180
181 %clean
182 rm -rf $RPM_BUILD_ROOT
183
184 %files
185 %defattr(-,root,root)
186 %dir /usr/lib/obs
187 %dir /usr/lib/obs/server
188 /etc/init.d/obsdispatcher
189 /etc/init.d/obspublisher
190 /etc/init.d/obsrepserver
191 /etc/init.d/obsscheduler
192 /etc/init.d/obssrcserver
193 /usr/sbin/rcobsdispatcher
194 /usr/sbin/rcobspublisher
195 /usr/sbin/rcobsrepserver
196 /usr/sbin/rcobsscheduler
197 /usr/sbin/rcobssrcserver
198 /usr/sbin/obs_mirror_project
199 /usr/sbin/obs_mirror_project.py
200 /usr/lib/obs/server/BSBuild.pm
201 /usr/lib/obs/server/BSConfig.pm
202 /usr/lib/obs/server/BSEvents.pm
203 /usr/lib/obs/server/BSFileDB.pm
204 /usr/lib/obs/server/BSHTTP.pm
205 /usr/lib/obs/server/BSHandoff.pm
206 /usr/lib/obs/server/BSRPC.pm
207 /usr/lib/obs/server/BSServer.pm
208 /usr/lib/obs/server/BSServerEvents.pm
209 /usr/lib/obs/server/BSSrcdiff.pm
210 /usr/lib/obs/server/BSSSL.pm
211 /usr/lib/obs/server/BSStdServer.pm
212 /usr/lib/obs/server/BSUtil.pm
213 /usr/lib/obs/server/BSVerify.pm
214 /usr/lib/obs/server/BSDB.pm
215 /usr/lib/obs/server/BSDBIndex.pm
216 /usr/lib/obs/server/BSXPathKeys.pm
217 /usr/lib/obs/server/BSWatcher.pm
218 /usr/lib/obs/server/BSXML.pm
219 /usr/lib/obs/server/BSXPath.pm
220 /usr/lib/obs/server/COPYING
221 /usr/lib/obs/server/DESIGN
222 /usr/lib/obs/server/License
223 /usr/lib/obs/server/README
224 /usr/lib/obs/server/TODO
225 /usr/lib/obs/server/XML
226 /usr/lib/obs/server/bs_*
227 /usr/lib/obs/server/build
228 /usr/lib/obs/server/worker
229 /usr/lib/obs/server/BSHermes.pm
230 %attr(-,obsrun,obsrun) /srv/obs
231 /var/adm/fillup-templates/sysconfig.obs-server
232
233 %files -n obs-worker
234 %defattr(-,root,root)
235 /var/adm/fillup-templates/sysconfig.obs-worker
236 /etc/init.d/obsworker
237 /usr/sbin/rcobsworker
238
239 %files -n obs-api
240 %defattr(-,root,root)
241 %doc README.SETUP docs/openSUSE.org.xml ReleaseNotes-0.9 ReleaseNotes-0.9.1
242 %dir /srv/www/obs
243 /srv/www/obs/common
244 %dir /srv/www/obs/frontend
245 /srv/www/obs/frontend/app
246 /srv/www/obs/frontend/Changelog
247 /srv/www/obs/frontend/components
248 /srv/www/obs/frontend/db
249 /srv/www/obs/frontend/doc
250 /srv/www/obs/frontend/files
251 /srv/www/obs/frontend/lib
252 /srv/www/obs/frontend/public
253 /srv/www/obs/frontend/Rakefile
254 /srv/www/obs/frontend/README
255 /srv/www/obs/frontend/script
256 /srv/www/obs/frontend/test
257 /srv/www/obs/frontend/vendor
258 %dir /srv/www/obs/webclient
259 /srv/www/obs/webclient/app
260 /srv/www/obs/webclient/Changelog
261 /srv/www/obs/webclient/components
262 /srv/www/obs/webclient/db
263 /srv/www/obs/webclient/doc
264 /srv/www/obs/webclient/lib
265 /srv/www/obs/webclient/public
266 /srv/www/obs/webclient/Rakefile
267 /srv/www/obs/webclient/README
268 /srv/www/obs/webclient/script
269 /srv/www/obs/webclient/test
270 /srv/www/obs/webclient/vendor
271 %config(noreplace) /srv/www/obs/frontend/config
272 %config(noreplace) /srv/www/obs/webclient/config
273 %attr(-,lighttpd,lighttpd) /srv/www/obs/frontend/log
274 %attr(-,lighttpd,lighttpd) /srv/www/obs/frontend/tmp
275 %attr(-,lighttpd,lighttpd) /srv/www/obs/webclient/log
276 %attr(-,lighttpd,lighttpd) /srv/www/obs/webclient/tmp
277 %config(noreplace) /etc/lighttpd/vhosts.d/obs.conf
278 %config /etc/lighttpd/cleanurl-v5.lua
279 %config /etc/lighttpd/vhosts.d/rails.inc
280
281 %changelog -n obs-server
282 * Fri Jan 26 2007 - poeml@suse.de
283 - implement status/restart in the init scripts
284 * Fri Jan 26 2007 - poeml@suse.de
285 - added dependency on createrepo
286 * Fri Jan 26 2007 - poeml@suse.de
287 - update to r1110
288   - revert last change, and do it the ruby way, by creating a new
289   migration for it... so existing installations are upgraded
290   - fix truncated line in sorting algorithm
291   - add missing mkdir
292   - add url to package metadata
293 - fix build / install sysconfig files
294 - fix copyright headers in init script
295 - fix path in README where to copy packages to
296 * Thu Jan 25 2007 - poeml@suse.de
297 - update to r1108
298   create a few more architectures, when initializing the database