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