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