]> git.pld-linux.org Git - packages/poldek.git/blob - poldek.spec
- rel 33
[packages/poldek.git] / poldek.spec
1 #
2 # Conditional build:
3 %bcond_with     static  # don't use shared libraries
4 %bcond_without  imode   # don't build interactive mode
5 %bcond_without  python  # don't build python bindings
6 #
7 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
8 %if "%{pld_release}" == "ti"
9 %define ver_db  4.5.20
10 %define ver_db_rel      8
11 %else
12 %define ver_db  4.7.25
13 %define ver_db_rel      1
14 %endif
15 %define ver_rpm 4.5-5
16 #
17 %define         snap    20080820.23
18 %define         rel             33
19 Summary:        RPM packages management helper tool
20 Summary(pl.UTF-8):      Pomocnicze narzędzie do zarządzania pakietami RPM
21 Name:           poldek
22 Version:        0.30
23 Release:        0.%{snap}.%{rel}
24 License:        GPL v2
25 Group:          Applications/System
26 #Source0:       http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
27 Source0:        http://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}-cvs%{snap}.tar.bz2
28 # Source0-md5:  2738eb3996f1cdf1e5d74b913d6e7414
29 Source1:        %{name}.conf
30 Source2:        %{name}-multilib.conf
31 Source3:        %{name}-ti.conf
32 Source4:        %{name}-multilib-ti.conf
33 Source5:        %{name}-aliases.conf
34 Source6:        %{name}.desktop
35 Source7:        %{name}.png
36 Source8:        %{name}-debuginfo.conf
37 Source9:        %{name}-aidath.conf
38 Source10:       %{name}-multilib-aidath.conf
39 Patch0:         %{name}-vserver-packages.patch
40 Patch1:         %{name}-config.patch
41 Patch2:         %{name}-abort-on-upgrade.patch
42 Patch3:         %{name}-inline.patch
43 Patch4:         %{name}-ls-llu.patch
44 Patch5:         %{name}-op-ldalldesc.patch
45 Patch6:         %{name}-nocolor-upgrade.patch
46 Patch7:         %{name}-upgrade-dist.patch
47 Patch8:         %{name}-keep-reinstalled-provides.patch
48 Patch9:         %{name}-dont-ask-for-suggests-on-errors.patch
49 Patch10:        %{name}-crash-on-invalid-locale.patch
50 Patch11:        %{name}-noutf8.patch
51 Patch12:        %{name}-dont-suggests-required-packages.patch
52 Patch13:        %{name}-tty-for-erasures.patch
53 Patch14:        %{name}-both_langs.patch
54 Patch15:        %{name}-317130.patch
55 Patch16:        %{name}-321546.patch
56 Patch17:        %{name}-size-type.patch
57 Patch18:        %{name}-no-inlines.patch
58 Patch19:        %{name}-export-missing-symbol.patch
59 Patch20:        %{name}-skip-suggests-on-upgrade.patch
60 Patch21:        %{name}-po.patch
61 Patch22:        %{name}-refcnt.patch
62 Patch23:        %{name}-assertion-failed.patch
63 Patch24:        %{name}-unescape-urlencoded-strings.patch
64 Patch25:        %{name}-ls-source-rpm.patch
65 Patch26:        %{name}-add-arch-match.patch
66 Patch27:        %{name}-multilib-upgrade.patch
67 Patch28:        %{name}-score-reqs-marked-to-install.patch
68 Patch29:        %{name}-dont-be-greedy.patch
69 URL:            http://poldek.pld-linux.org/
70 BuildRequires:  autoconf
71 BuildRequires:  automake
72 BuildRequires:  bzip2-devel
73 BuildRequires:  check
74 BuildRequires:  db-devel >= %{ver_db}-%{ver_db_rel}
75 BuildRequires:  gettext-autopoint
76 BuildRequires:  libtool
77 BuildRequires:  libxml2-devel
78 BuildRequires:  openssl-devel >= 0.9.7d
79 BuildRequires:  pcre-devel
80 BuildRequires:  perl-tools-pod
81 BuildRequires:  pkgconfig
82 BuildRequires:  popt-devel
83 %{?with_python:BuildRequires:   python-devel}
84 BuildRequires:  readline-devel >= 5.0
85 BuildRequires:  rpm-devel >= %{ver_rpm}
86 %{?with_python:BuildRequires:   rpm-pythonprov}
87 BuildRequires:  xmlto
88 BuildRequires:  zlib-devel
89 %if %{with static}
90 BuildRequires:  bzip2-static
91 BuildRequires:  db-static >= %{ver_db}-%{ver_db_rel}
92 BuildRequires:  glibc-static
93 BuildRequires:  libselinux-static
94 BuildRequires:  libxml2-static
95 BuildRequires:  ncurses-static
96 BuildRequires:  openssl-static
97 BuildRequires:  pcre-static
98 BuildRequires:  popt-static
99 BuildRequires:  readline-static
100 BuildRequires:  rpm-static
101 BuildRequires:  zlib-static
102 %endif
103 Requires(triggerpostun):        awk
104 Requires(triggerpostun):        sed >= 4.0
105 Requires:       %{name}-libs = %{version}-%{release}
106 Requires:       db >= %{ver_db}-%{ver_db_rel}
107 Requires:       rpm >= %{ver_rpm}
108 Requires:       rpm-db-ver = %{ver_db}
109 Requires:       rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
110 # vf* scripts use sed
111 Requires:       sed
112 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
113
114 %description
115 poldek is an RPM package management tool which allows you to easily
116 perform package verification, installation (including system
117 installation from scratch), upgrading, and removal.
118
119 Program can be used in batch (like apt-get from Debian's APT) or
120 interactive mode. The interactive mode puts you into a readline
121 interface with command line autocompletion and history, similar to the
122 shell mode of Perl's CPAN.
123
124 %{?with_static:This version is statically linked.}
125
126 %{!?with_imode:This version hasn't got interactive mode.}
127 #'vim
128
129 %description -l pl.UTF-8
130 poldek jest narzędziem linii poleceń służącym do weryfikacji,
131 instalacji (włączając instalację systemu od zera), aktualizacji i
132 usuwania pakietów.
133
134 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
135 interaktywnym. Tryb interaktywny posiada interfejs readline z
136 dopełnianiem komend i historią, podobny do trybu shell perlowego
137 modułu CPAN.
138
139 %{?with_static:Ta wersja jest konsolidowana statycznie.}
140
141 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
142
143 %package libs
144 Summary:        poldek libraries
145 Summary(pl.UTF-8):      Biblioteki poldka
146 Group:          Libraries
147
148 %description libs
149 poldek libraries.
150
151 %description libs -l pl.UTF-8
152 Biblioteki poldka.
153
154 %package devel
155 Summary:        Header files for poldek libraries
156 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek poldka
157 Group:          Development/Libraries
158 Requires:       %{name}-libs = %{version}-%{release}
159 Requires:       rpm-devel >= %{ver_rpm}
160
161 %description devel
162 Header files for poldek libraries.
163
164 %description devel -l pl.UTF-8
165 Pliki nagłówkowe bibliotek poldka.
166
167 %package static
168 Summary:        poldek static libraries
169 Summary(pl.UTF-8):      Biblioteki statyczne poldka
170 Group:          Development/Libraries
171 Requires:       %{name}-devel = %{version}-%{release}
172
173 %description static
174 poldek static libraries.
175
176 %description static -l pl.UTF-8
177 Biblioteki statyczne poldka.
178
179 %package -n python-poldek
180 Summary:        Python modules for poldek
181 Summary(pl.UTF-8):      Moduły języka Python dla poldka
182 Group:          Libraries/Python
183 Requires:       %{name}-libs = %{version}-%{release}
184 %pyrequires_eq  python-libs
185
186 %description -n python-poldek
187 Python modules for poldek.
188
189 %description -n python-poldek -l pl.UTF-8
190 Moduły języka Python dla poldka.
191
192 %prep
193 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
194 %patch0 -p1
195 %patch1 -p1
196 %patch2 -p1
197 %patch3 -p1
198 %patch4 -p1
199 %patch5 -p1
200 %patch6 -p0
201 %patch7 -p0
202 %patch8 -p0
203 %patch9 -p0
204 %patch10 -p1
205 %patch11 -p1
206 %patch12 -p1
207 %patch13 -p1
208 %patch14 -p1
209 %patch15 -p1
210 %patch16 -p1
211 %patch17 -p1
212 %patch18 -p1
213 %patch19 -p0
214 %patch20 -p1
215 %patch21 -p1
216 %patch22 -p0
217 %patch23 -p1
218 %patch24 -p1
219 # LP#392984
220 %patch25 -p1
221 # LP#408036
222 %patch26 -p1
223 # LP#408034
224 %patch27 -p1
225 # score reqs already marked to install
226 %patch28 -p1
227 # dont be greedy if upgraded pkg has needed capabilities
228 %patch29 -p1
229
230 # cleanup backups after patching
231 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
232
233 %build
234 %{__libtoolize}
235 %{__aclocal} -I m4
236 %{__autoconf}
237 %{__automake}
238 cp -f config.sub trurlib
239
240 CPPFLAGS="-std=gnu99"
241 %configure \
242         %{?with_static:--enable-static --disable-shared} \
243         %{!?with_imode:--disable-imode} \
244         --enable-nls \
245         %{?with_python:--with-python}
246 %{__make}
247 #       --enable-trace
248
249 %install
250 rm -rf $RPM_BUILD_ROOT
251 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
252
253 %{__make} install \
254         DESTDIR=$RPM_BUILD_ROOT
255
256 %if %{with python}
257 %{__make} -C python install \
258         DESTDIR=$RPM_BUILD_ROOT \
259         libdir=%{py_sitedir}
260 %endif
261
262 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
263
264 %ifarch i486 i686 ppc sparc alpha athlon
265 %define         _ftp_arch       %{_target_cpu}
266 %endif
267 %ifarch %{x8664}
268 %define         _ftp_arch       x86_64
269 %define         _ftp_alt_arch   i686
270 %endif
271 %ifarch i586
272 %if "%{pld_release}" == "ti"
273 %define         _ftp_arch       i586
274 %else
275 %define         _ftp_arch       i486
276 %endif
277 %endif
278 %ifarch pentium2 pentium3 pentium4
279 %define         _ftp_arch       i686
280 %endif
281 %ifarch sparcv9 sparc64
282 %define         _ftp_arch       sparc
283 %if "%{pld_release}" == "th"
284 %define         _ftp_arch       %{_target_cpu}
285 %ifarch sparc64
286 %define         _ftp_alt_arch   sparcv9
287 %endif
288 %endif
289 %endif
290
291 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
292
293 %if "%{pld_release}" == "ti"
294 sed -e '
295         s|%%ARCH%%|%{_ftp_arch}|g
296 ' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
297
298 %ifarch %{x8664}
299 sed '
300         s|%%ARCH%%|%{_ftp_alt_arch}|g
301 ' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
302 %endif
303 %else
304 # pld_release = th
305 %ifarch sparcv9 sparc64
306 sed -e '
307         s|%%ARCH%%|%{_ftp_arch}|g
308 ' < %{SOURCE9} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
309
310 %ifarch sparc64
311 sed '
312         s|%%ARCH%%|%{_ftp_alt_arch}|g
313 ' < %{SOURCE10} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
314 %endif
315
316 %else
317 sed -e '
318         s|%%ARCH%%|%{_ftp_arch}|g
319 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
320 sed -e '
321         s|%%ARCH%%|%{_ftp_arch}|g
322 ' < %{SOURCE8} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf
323
324 %ifarch %{x8664}
325 sed '
326         s|%%ARCH%%|%{_ftp_alt_arch}|g
327 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
328 %endif
329 %endif
330 %endif
331
332 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
333
334 %if %{with imode}
335 # add desktop file and icon
336 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
337 install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
338 install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
339 %endif
340
341 # sources we don't package
342 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
343 # include them in %doc
344 rm -rf configs
345 cp -a conf configs
346 rm -f configs/Makefile*
347
348 %if %{with python}
349 %py_postclean
350 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
351 %endif
352
353 %find_lang %{name}
354
355 %clean
356 rm -rf $RPM_BUILD_ROOT
357
358 %post
359 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
360 if [ "$1" = "1" ]; then
361         # remove ignore = vserver-packages inside vserver on first install
362         {
363                 while read f ctx; do
364                         [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
365                 done </proc/self/status
366         } 2>/dev/null
367         if [ -z "$ctx" -o "$ctx" = "0" ]; then
368                 VSERVER=no
369         else
370                 VSERVER=yes
371         fi
372         if [ "$VSERVER" = "yes" ]; then
373                 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
374         fi
375 fi
376
377 %postun -p      /sbin/postshell
378 -/usr/sbin/fix-info-dir -c %{_infodir}
379
380 %post   libs -p /sbin/ldconfig
381 %postun libs -p /sbin/ldconfig
382
383 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
384 if [ -f /etc/poldek.conf.rpmsave ]; then
385         awk '/^source/ {
386         name = $3;
387         path = $4;
388         auto = "yes";
389         autoup = "yes";
390         type = "pdir";
391         pri = "";
392
393         if (sub(",noauto", "", name)) {
394                 auto = "no";
395         }
396
397         # process pri=\d+
398         if (match(name, /,pri=[0-9]+/)) {
399                 pri = substr(name, RSTART + 5, RLENGTH - 5);
400                 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
401         }
402
403         # skip ac sources. already in new config.
404         if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
405                 print "";
406                 print "[source]";
407                 print "name = " name;
408                 print "type = " type;
409                 print "path = " path;
410                 print "auto = " auto;
411                 print "autoup = " autoup;
412                 if (pri) {
413                         print "pri = " pri;
414                 }
415         }
416
417         }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
418         echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
419
420         # copy hold=
421         hold=$(grep ^hold /etc/poldek.conf.rpmsave)
422         if [ "$hold" ]; then
423                 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
424         fi
425 fi
426
427 %triggerpostun -- poldek < 0.30-0.20080225.00.1
428 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
429         %{__sed} -i -e '/^%%include source.conf/{
430                 a
431                 a# /etc/poldek/repos.d/*.conf
432                 a%%includedir repos.d
433         }' %{_sysconfdir}/%{name}/poldek.conf
434 fi
435
436 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
437 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
438
439 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
440         cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
441         cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
442 fi
443
444 %ifarch %{x8664}
445 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
446         cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
447         cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
448 fi
449 %endif
450
451 %files -f %{name}.lang
452 %defattr(644,root,root,755)
453 %doc README* NEWS TODO configs
454 %dir %{_sysconfdir}/%{name}
455 %dir %{_sysconfdir}/%{name}/repos.d
456 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
457 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
458 %attr(755,root,root) %{_bindir}/*
459 %dir %{_libdir}/%{name}
460 %attr(755,root,root) %{_libdir}/%{name}/*
461 %{_mandir}/man1/%{name}*
462 %lang(pl) %{_mandir}/pl/man1/%{name}*
463 %{_infodir}/poldek.info*
464 %if %{with imode}
465 %{_desktopdir}/%{name}.desktop
466 %{_pixmapsdir}/%{name}.png
467 %endif
468
469 %if %{without static}
470 %files libs
471 %defattr(644,root,root,755)
472 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
473 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
474 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
475 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
476 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
477 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
478 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
479 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
480 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
481 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
482 %endif
483
484 %files devel
485 %defattr(644,root,root,755)
486 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
487 %{_libdir}/lib*.la
488 %{_includedir}/*
489
490 %files static
491 %defattr(644,root,root,755)
492 %{_libdir}/lib*.a
493
494 %if %{with python}
495 %files -n python-poldek
496 %defattr(644,root,root,755)
497 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
498 %{py_sitescriptdir}/poldek.py[co]
499 %{py_sitescriptdir}/poldekmod.py[co]
500 %endif
This page took 0.066249 seconds and 4 git commands to generate.