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