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