]> git.pld-linux.org Git - packages/pld-builder.git/blob - pld-builder.spec
- remove srpms_builder, ftpac those are on ep09
[packages/pld-builder.git] / pld-builder.spec
1 Summary:        PLD RPM builder environment
2 Summary(pl.UTF-8):      Środowisko budowniczego pakietów RPM dla PLD
3 Name:           pld-builder
4 Version:        0.2
5 Release:        0.5
6 License:        GPL
7 Group:          Development/Building
8 Source0:        %{name}-%{version}.tar.bz2
9 # Source0-md5:  7699bd2ac6da8f5f771ed4a5725acaa6
10 Source1:        %{name}.init
11 Source2:        %{name}.sysconfig
12 URL:            http://cvs.pld-linux.org/cgi-bin/cvsweb/pld-builder.new/
13 BuildRequires:  python
14 BuildRequires:  rpm-pythonprov
15 BuildRequires:  rpmbuild(macros) >= 1.469
16 BuildRequires:  sed >= 4.0
17 Requires(post,preun):   /sbin/chkconfig
18 Requires(postun):       /usr/sbin/userdel
19 Requires(pre):  /bin/id
20 Requires(pre):  /usr/bin/getgid
21 Requires(pre):  /usr/sbin/groupadd
22 Requires(pre):  /usr/sbin/useradd
23 Requires:       bash
24 Requires:       crondaemon
25 Requires:       gnupg
26 Requires:       libuuid
27 Requires:       python
28 Requires:       python-pld-builder = %{version}-%{release}
29 Requires:       rc-scripts
30 Provides:       group(builder)
31 Provides:       user(builder)
32 BuildArch:      noarch
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35 %define         _sysconfdir     /etc/pld-builder
36 %define         _datadir        /usr/share/%{name}
37
38 %description
39 PLD RPM builder environment. This is the freshest "new" builder.
40
41 Other new and older attempts can be found from:
42 http://cvs.pld-linux.org/cgi-bin/cvsweb/pld-builder/
43 http://cvs.pld-linux.org/cgi-bin/cvsweb/pld-builder.old/
44 http://cvs.pld-linux.org/cgi-bin/cvsweb/builder_ng/
45
46 %description -l pl.UTF-8
47 Środowisko budowniczego pakietów RPM dla PLD. To jest najnowszy "nowy"
48 builder.
49
50 Inne nowe i starsze próby można znaleźć pod:
51 http://cvs.pld-linux.org/cgi-bin/cvsweb/pld-builder/
52 http://cvs.pld-linux.org/cgi-bin/cvsweb/pld-builder.old/
53 http://cvs.pld-linux.org/cgi-bin/cvsweb/builder_ng/
54
55 %package -n python-pld-builder
56 Summary:        PLD Builder
57 Summary(pl.UTF-8):      Budowniczy PLD
58 Group:          Development/Building
59 %pyrequires_eq  python-modules
60
61 %description -n python-pld-builder
62 PLD Builder Python code.
63
64 %description -n python-pld-builder -l pl.UTF-8
65 Kod pythonowy budowniczego PLD.
66
67 %package chroot
68 Summary:        PLD Builder chroot
69 Summary(pl.UTF-8):      Środowisko chroot buildera PLD
70 Group:          Development/Building
71 Requires(postun):       /usr/sbin/userdel
72 Requires(pre):  /bin/id
73 Requires(pre):  /usr/bin/getgid
74 Requires(pre):  /usr/sbin/groupadd
75 Requires(pre):  /usr/sbin/useradd
76 Requires:       bash
77 Requires:       poldek >= 0.21-0.20070703.00.16
78 Requires:       rpm-build
79 Requires:       tmpwatch
80 Provides:       group(builder)
81 Provides:       user(builder)
82
83 %description chroot
84 This is the package to be installed in builder chroot.
85
86 %description chroot -l pl.UTF-8
87 Ten pakiet należy zainstalować w środowisku chroot buildera.
88
89 %prep
90 %setup -q
91
92 mv jak-wysy?a?-zlecenia.txt jak-wysylac-zlecenia.txt
93
94 %{__sed} -i -e '
95         s,~/pld-builder.new/,%{_sharedstatedir}/%{name}/,
96         /^conf_dir/s,=.*,= "%{_sysconfdir}/",
97
98 ' PLD_Builder/path.py
99
100 %{__sed} -i -e '
101         s,pld-linux\.org,example.org,g
102         s,/spools/ready,/var/cache/%{name}/ready,
103 ' config/builder.conf
104
105 cat <<'EOF' > poldek.conf
106 # locally cached rpms
107 [source]
108 name = ready
109 pri  = -1
110 type = pndir
111 path = /var/cache/%{name}/ready
112 EOF
113
114 cat <<'EOF' > crontab
115 SHELL=/bin/sh
116 MAILTO=root
117
118 #* * * * * builder exec nice -n 19 %{_datadir}/bin/request-fetcher.sh
119 #* * * * * builder exec nice -n 19 %{_datadir}/bin/load-balancer.sh
120 #* * * * * builder exec nice -n 19 %{_datadir}/bin/file-sender.sh
121
122 #0 0 * * * chroot /home/users/builder/chroot-ac nice -n 19 tmpwatch -m 240 /var/cache/%{name}/ready
123 EOF
124
125 cat <<'EOF' > rpm.macros
126 # rpm macros for pld builder chroot
127
128 # A colon separated list of desired locales to be installed;
129 # "all" means install all locale specific files.
130 %%_install_langs en_US
131
132 # If non-zero, all erasures will be automagically repackaged.
133 %%_repackage_all_erasures    0
134
135 # Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files
136 # marked as %doc should be installed.
137 # FIXME: excludedocs breaks kde build
138 #%%_excludedocs   1
139 EOF
140
141 %build
142 %{__make}
143 %py_lint PLD_Builder
144
145 %install
146 rm -rf $RPM_BUILD_ROOT
147
148 # python
149 install -d $RPM_BUILD_ROOT%{py_scriptdir}/PLD_Builder
150 cp -a PLD_Builder/*.py[co] $RPM_BUILD_ROOT%{py_scriptdir}/PLD_Builder
151
152 # other
153 install -d $RPM_BUILD_ROOT%{_sysconfdir}
154 cp -a config/{rsync-passwords,*.conf} $RPM_BUILD_ROOT%{_sysconfdir}
155 install -d $RPM_BUILD_ROOT%{_datadir}/{bin,admin}
156 for a in bin/*.sh; do
157 sed -e '
158         /cd ~\/pld-builder.new/d
159         s,python \(PLD_Builder.*.py\),python %{py_scriptdir}/\1c,
160 ' $a > $RPM_BUILD_ROOT%{_datadir}/bin/$(basename $a)
161 done
162 cp -a admin/*.sh $RPM_BUILD_ROOT%{_datadir}/admin
163
164 # dirs
165 install -d $RPM_BUILD_ROOT{%{_sharedstatedir}/%{name}/{spool/{buildlogs,builds,ftp,notify},lock,www/{s,}rpms},/etc/{sysconfig,rc.d/init.d}}
166 install -d $RPM_BUILD_ROOT/home/services/builder/.gnupg
167 install -d $RPM_BUILD_ROOT/home/services/builder/.ssh
168 install -d $RPM_BUILD_ROOT/home/services/builder/rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
169 install -d $RPM_BUILD_ROOT/var/cache/%{name}/ready
170
171 install -d $RPM_BUILD_ROOT/etc/poldek/repos.d
172 cp -a poldek.conf $RPM_BUILD_ROOT/etc/poldek/repos.d/%{name}.conf
173
174 install -d $RPM_BUILD_ROOT/etc/rpm
175 cp -a rpm.macros $RPM_BUILD_ROOT/etc/rpm/macros.builder
176
177 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/pld-builder
178 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/pld-builder
179
180 # from admin/fresh-queue.sh
181 cd $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}
182 install -d spool/{builds,buildlogs,notify,ftp} www/srpms lock
183 echo 0 > www/max_req_no
184 echo 0 > spool/last_req_no
185 echo -n > spool/processed_ids
186 echo -n > spool/got_lock
187 echo '<queue/>' > spool/queue
188 echo '<queue/>' > spool/req_queue
189 if [ "$binary_builders" ]; then
190         for bb in $binary_builders; do
191                 echo '<queue/>' > spool/queue-$bb
192         done
193 fi
194 # crontab
195 install -d $RPM_BUILD_ROOT/etc/cron.d
196 cp -a crontab $RPM_BUILD_ROOT/etc/cron.d/%{name}
197
198 %clean
199 rm -rf $RPM_BUILD_ROOT
200
201 %pre
202 %groupadd -g 181 builder
203 %useradd -u 182 -g builder -c "bin builder" -s /bin/bash -d /home/services/builder builder
204
205 %pre chroot
206 %groupadd -g 181 builder
207 %useradd -u 182 -g builder -c "bin builder" -s /bin/bash -d /home/services/builder builder
208
209 %post
210 /sbin/chkconfig --add %{name}
211 %service %{name} restart
212
213 %preun
214 if [ "$1" = "0" ]; then
215         %service %{name} stop
216         /sbin/chkconfig --del %{name}
217 fi
218
219 %postun
220 if [ "$1" = "0" ]; then
221         %userremove builder
222         %groupremove builder
223 fi
224
225 %postun chroot
226 if [ "$1" = "0" ]; then
227         %userremove builder
228         %groupremove builder
229 fi
230
231 %files
232 %defattr(644,root,root,755)
233 %doc README TODO
234 %doc user-manual.txt
235 %lang(pl) %doc jak-to-dziala.txt jak-wysylac-zlecenia.txt
236
237 %attr(754,root,root) /etc/rc.d/init.d/pld-builder
238 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/pld-builder
239
240 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
241
242 %dir %{_sysconfdir}
243 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
244
245 %dir %{_datadir}
246 %dir %{_datadir}/bin
247 %attr(755,root,root) %{_datadir}/bin/*
248 %dir %{_datadir}/admin
249 %attr(755,root,root) %{_datadir}/admin/*
250
251 %dir %{_sharedstatedir}/%{name}
252
253 %dir %attr(775,root,builder) %{_sharedstatedir}/%{name}/spool
254 %dir %attr(775,root,builder) %{_sharedstatedir}/%{name}/spool/buildlogs
255 %dir %attr(775,root,builder) %{_sharedstatedir}/%{name}/spool/builds
256 %dir %attr(775,root,builder) %{_sharedstatedir}/%{name}/spool/ftp
257 %dir %attr(775,root,builder) %{_sharedstatedir}/%{name}/spool/notify
258
259 %attr(644,builder,builder) %config(noreplace) %verify(not md5 mtime size) %{_sharedstatedir}/%{name}/spool/got_lock
260 %attr(644,builder,builder) %config(noreplace) %verify(not md5 mtime size) %{_sharedstatedir}/%{name}/spool/last_req_no
261 %attr(644,builder,builder) %config(noreplace) %verify(not md5 mtime size) %{_sharedstatedir}/%{name}/spool/processed_ids
262 %attr(644,builder,builder) %config(noreplace) %verify(not md5 mtime size) %{_sharedstatedir}/%{name}/spool/queue
263 %attr(644,builder,builder) %config(noreplace) %verify(not md5 mtime size) %{_sharedstatedir}/%{name}/spool/req_queue
264
265 %dir %attr(775,root,builder) %{_sharedstatedir}/%{name}/lock
266
267 %dir %{_sharedstatedir}/%{name}/www
268 %dir %{_sharedstatedir}/%{name}/www/rpms
269 %dir %{_sharedstatedir}/%{name}/www/srpms
270 %attr(644,builder,builder) %config(noreplace) %verify(not md5 mtime size) %{_sharedstatedir}/%{name}/www/max_req_no
271
272 %dir %attr(750,builder,builder) /home/services/builder
273 %dir %attr(750,builder,builder) /home/services/builder/.gnupg
274 %dir %attr(700,builder,builder) /home/services/builder/.ssh
275
276 %files chroot
277 %defattr(644,root,root,755)
278 %dir %attr(750,builder,builder) /home/services/builder
279 %dir %attr(750,builder,builder) /home/services/builder/rpm
280 %dir %attr(750,builder,builder) /home/services/builder/rpm/BUILD
281 %dir %attr(750,builder,builder) /home/services/builder/rpm/RPMS
282 %dir %attr(750,builder,builder) /home/services/builder/rpm/SOURCES
283 %dir %attr(750,builder,builder) /home/services/builder/rpm/SPECS
284 %dir %attr(750,builder,builder) /home/services/builder/rpm/SRPMS
285
286 # minimal but sane defaults for rpm inside chroot
287 %config(noreplace) %verify(not md5 mtime size) /etc/rpm/macros.builder
288
289 # locally cached rpms from bin-builder
290 %config(noreplace) %verify(not md5 mtime size) /etc/poldek/repos.d/%{name}.conf
291 %dir /var/cache/%{name}
292 %dir %attr(775,root,builder) /var/cache/%{name}/ready
293
294 %files -n python-pld-builder
295 %defattr(644,root,root,755)
296 %{py_scriptdir}/PLD_Builder
This page took 0.047448 seconds and 4 git commands to generate.