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