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