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