]> git.pld-linux.org Git - packages/poldek.git/blame - poldek.spec
- commented out adding the .UTF-8 suffix to the lang
[packages/poldek.git] / poldek.spec
CommitLineData
7638abfc 1#
de1099c4 2# Conditional build:
9fe14a3f 3%bcond_with static # don't use shared libraries
4%bcond_without imode # don't build interactive mode
58c31de0 5%bcond_without python # don't build python bindings
7638abfc 6#
373c6f03 7# required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
4d7ffb0a 8%if "%{pld_release}" == "ti"
530c8c41 9%define ver_db 4.5.20
473ce98d 10%define ver_db_rel 8
4d7ffb0a 11%else
530c8c41 12%define ver_db 4.7.25
473ce98d 13%define ver_db_rel 1
4d7ffb0a 14%endif
2b6db74f 15%define ver_rpm 4.5-5
5486bf2e 16#
04a91ad3 17%define snap 20080820.23
05e22a22 18%define rel 11
b44549bf 19Summary: RPM packages management helper tool
9faf625a 20Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
b44549bf 21Name: poldek
24ad8b8d 22Version: 0.30
78b0cd64 23Release: 0.%{snap}.%{rel}
9f931ada 24License: GPL v2
8efee472 25Group: Applications/System
85398bac 26#Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
c0898992 27Source0: http://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}-cvs%{snap}.tar.bz2
04a91ad3 28# Source0-md5: 2738eb3996f1cdf1e5d74b913d6e7414
911a8560 29Source1: %{name}.conf
b25cb9a7 30Source2: %{name}-multilib.conf
2ccd5d66 31Source3: %{name}-ti.conf
32Source4: %{name}-multilib-ti.conf
33Source5: %{name}-aliases.conf
34Source6: %{name}.desktop
35Source7: %{name}.png
85398bac
MB
36Patch0: %{name}-vserver-packages.patch
37Patch1: %{name}-config.patch
38Patch2: %{name}-abort-on-upgrade.patch
04a91ad3
MB
39Patch3: %{name}-inline.patch
40Patch4: %{name}-ls-llu.patch
41Patch5: %{name}-op-ldalldesc.patch
25838a54 42Patch6: %{name}-nocolor-upgrade.patch
f4114128
ER
43Patch7: %{name}-upgrade-dist.patch
44Patch8: %{name}-keep-reinstalled-provides.patch
bf43a3ac 45Patch9: %{name}-dont-ask-for-suggests-on-errors.patch
c7d7bdf5 46Patch10: %{name}-crash-on-invalid-locale.patch
5fd70439 47Patch11: %{name}-up_mini18n.patch
f031015c 48Patch12: %{name}-dont-suggests-required-packages.patch
05e22a22 49Patch13: %{name}-tty-for-erasures.patch
39ca2371 50URL: http://poldek.pld-linux.org/
a4268952 51BuildRequires: autoconf
b25cb9a7 52BuildRequires: automake
373c6f03 53BuildRequires: bzip2-devel
b25cb9a7 54BuildRequires: check
530c8c41 55BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
c0d8905a 56BuildRequires: gettext-autopoint
b25cb9a7
JB
57BuildRequires: libtool
58BuildRequires: libxml2-devel
cbc6f56b 59BuildRequires: openssl-devel >= 0.9.7d
13fd950e 60BuildRequires: pcre-devel
f373d903 61BuildRequires: perl-tools-pod
b3ea4b51 62BuildRequires: pkgconfig
13fd950e 63BuildRequires: popt-devel
58c31de0 64%{?with_python:BuildRequires: python-devel}
b25cb9a7 65BuildRequires: readline-devel >= 5.0
373c6f03 66BuildRequires: rpm-devel >= %{ver_rpm}
300927eb 67%{?with_python:BuildRequires: rpm-pythonprov}
282cfaec 68BuildRequires: xmlto
96475e5e 69BuildRequires: zlib-devel
373c6f03
JB
70%if %{with static}
71BuildRequires: bzip2-static
530c8c41 72BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
2fac0b02 73BuildRequires: glibc-static
acb26797 74BuildRequires: libselinux-static
b25cb9a7 75BuildRequires: libxml2-static
373c6f03
JB
76BuildRequires: ncurses-static
77BuildRequires: openssl-static
78BuildRequires: pcre-static
79BuildRequires: popt-static
80BuildRequires: readline-static
81BuildRequires: rpm-static
82BuildRequires: zlib-static
373c6f03 83%endif
b25cb9a7 84Requires(triggerpostun): awk
168acc54 85Requires(triggerpostun): sed >= 4.0
09d4c571 86Requires: %{name}-libs = %{version}-%{release}
530c8c41 87Requires: db >= %{ver_db}-%{ver_db_rel}
373c6f03 88Requires: rpm >= %{ver_rpm}
530c8c41 89Requires: rpm-db-ver = %{ver_db}
78b0cd64 90Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
e202a52a
ER
91# vf* scripts use sed
92Requires: sed
b44549bf 93BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
94
95%description
0fa0dc36 96poldek is an RPM package management tool which allows you to easily
97perform package verification, installation (including system
13fd950e 98installation from scratch), upgrading, and removal.
0fa0dc36 99
13fd950e
JB
100Program can be used in batch (like apt-get from Debian's APT) or
101interactive mode. The interactive mode puts you into a readline
102interface with command line autocompletion and history, similar to the
103shell mode of Perl's CPAN.
8efee472 104
9fe14a3f 105%{?with_static:This version is statically linked.}
d94b28a6 106
9fe14a3f 107%{!?with_imode:This version hasn't got interactive mode.}
7f07e487 108#'vim
1f84648f 109
caed9b36
JR
110%description -l pl.UTF-8
111poldek jest narzędziem linii poleceń służącym do weryfikacji,
112instalacji (włączając instalację systemu od zera), aktualizacji i
113usuwania pakietów.
56e1ab51 114
caed9b36 115Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
d82a9cb2 116interaktywnym. Tryb interaktywny posiada interfejs readline z
caed9b36
JR
117dopełnianiem komend i historią, podobny do trybu shell perlowego
118modułu CPAN.
8efee472 119
9fe14a3f 120%{?with_static:Ta wersja jest konsolidowana statycznie.}
a611e0bc 121
9fe14a3f 122%{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
b44549bf 123
b25cb9a7 124%package libs
168acc54 125Summary: poldek libraries
9faf625a 126Summary(pl.UTF-8): Biblioteki poldka
168acc54 127Group: Libraries
b25cb9a7
JB
128
129%description libs
130poldek libraries.
131
caed9b36 132%description libs -l pl.UTF-8
b25cb9a7
JB
133Biblioteki poldka.
134
135%package devel
168acc54 136Summary: Header files for poldek libraries
9faf625a 137Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
168acc54 138Group: Development/Libraries
09d4c571 139Requires: %{name}-libs = %{version}-%{release}
b25cb9a7
JB
140
141%description devel
142Header files for poldek libraries.
143
caed9b36
JR
144%description devel -l pl.UTF-8
145Pliki nagłówkowe bibliotek poldka.
b25cb9a7
JB
146
147%package static
168acc54 148Summary: poldek static libraries
9faf625a 149Summary(pl.UTF-8): Biblioteki statyczne poldka
168acc54 150Group: Development/Libraries
09d4c571 151Requires: %{name}-devel = %{version}-%{release}
b25cb9a7
JB
152
153%description static
154poldek static libraries.
155
caed9b36 156%description static -l pl.UTF-8
b25cb9a7
JB
157Biblioteki statyczne poldka.
158
58c31de0
JB
159%package -n python-poldek
160Summary: Python modules for poldek
9faf625a 161Summary(pl.UTF-8): Moduły języka Python dla poldka
58c31de0
JB
162Group: Libraries/Python
163Requires: %{name}-libs = %{version}-%{release}
164%pyrequires_eq python-libs
165
166%description -n python-poldek
167Python modules for poldek.
168
caed9b36
JR
169%description -n python-poldek -l pl.UTF-8
170Moduły języka Python dla poldka.
58c31de0 171
03159b71 172%prep
78b0cd64 173%setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
85398bac 174%patch0 -p1
13aa6434
AM
175%patch1 -p1
176%patch2 -p1
04a91ad3 177%patch3 -p1
2a61c5d4 178%patch4 -p1
c826891f 179%patch5 -p1
25838a54 180%patch6 -p0
f4114128
ER
181%patch7 -p0
182%patch8 -p0
bf43a3ac 183%patch9 -p0
c7d7bdf5 184%patch10 -p1
182ec4cf 185#%patch11 -p1
f031015c 186%patch12 -p1
05e22a22 187%patch13 -p1
b44549bf 188
0579f9b7
ER
189# cleanup backups after patching
190find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
191
b44549bf 192%build
bef9d2a3 193%{__libtoolize}
21a83253
MM
194%{__aclocal} -I m4
195%{__autoconf}
196%{__automake}
63bd61a7 197cp -f config.sub trurlib
b25cb9a7 198
97ecf213 199CPPFLAGS="-std=gnu99"
1f84648f 200%configure \
b25cb9a7 201 %{?with_static:--enable-static --disable-shared} \
9fe14a3f 202 %{!?with_imode:--disable-imode} \
58c31de0
JB
203 --enable-nls \
204 %{?with_python:--with-python}
03159b71 205%{__make}
8efee472 206
b44549bf 207%install
208rm -rf $RPM_BUILD_ROOT
08335479 209install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
8efee472 210
c8f7d829 211%{__make} install \
212 DESTDIR=$RPM_BUILD_ROOT
de1099c4 213
58c31de0
JB
214%if %{with python}
215%{__make} -C python install \
216 DESTDIR=$RPM_BUILD_ROOT \
217 libdir=%{py_sitedir}
218%endif
219
9fe14a3f 220%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
a49836bb 221
9639596f 222%ifarch i486 i686 ppc sparc alpha athlon
a49836bb 223%define _ftp_arch %{_target_cpu}
36004ea3 224%endif
9639596f 225%ifarch %{x8664}
590302c4 226%define _ftp_arch x86_64
b25cb9a7 227%define _ftp_alt_arch i686
36004ea3 228%endif
9639596f 229%ifarch i586
58820d9b 230%if "%{pld_release}" == "ti"
231%define _ftp_arch i586
232%else
9639596f 233%define _ftp_arch i486
36004ea3 234%endif
58820d9b 235%endif
a49836bb 236%ifarch pentium2 pentium3 pentium4
237%define _ftp_arch i686
36004ea3 238%endif
a49836bb 239%ifarch sparcv9 sparc64
240%define _ftp_arch sparc
241%endif
a49836bb 242
b25cb9a7 243%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
32697bd0 244
2ccd5d66 245%if "%{pld_release}" == "ti"
246sed -e '
247 s|%%ARCH%%|%{_ftp_arch}|g
248' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
249
250%ifarch %{x8664}
251sed '
252 s|%%ARCH%%|%{_ftp_alt_arch}|g
253' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
254%endif
255%else
7adf66ff
ER
256sed -e '
257 s|%%ARCH%%|%{_ftp_arch}|g
b43abde7 258' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
b44549bf 259
590302c4 260%ifarch %{x8664}
7adf66ff
ER
261sed '
262 s|%%ARCH%%|%{_ftp_alt_arch}|g
b43abde7 263' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
b25cb9a7 264%endif
2ccd5d66 265%endif
b25cb9a7 266
2ccd5d66 267install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
b25cb9a7 268
9e6ff4ef 269%if %{with imode}
270# add desktop file and icon
271install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
2ccd5d66 272install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
273install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
9e6ff4ef 274%endif
275
b43abde7
ER
276# sources we don't package
277rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
b25cb9a7
JB
278# include them in %doc
279rm -rf configs
280cp -a conf configs
281rm -f configs/Makefile*
282
62e80071 283%if %{with python}
58c31de0
JB
284%py_postclean
285rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
62e80071 286%endif
58c31de0 287
b25cb9a7 288%find_lang %{name}
f373d903 289
b44549bf 290%clean
291rm -rf $RPM_BUILD_ROOT
292
3896c8b1
ER
293%post -p /sbin/postshell
294-/usr/sbin/fix-info-dir -c %{_infodir}
b25cb9a7 295
3896c8b1
ER
296%postun -p /sbin/postshell
297-/usr/sbin/fix-info-dir -c %{_infodir}
b25cb9a7
JB
298
299%post libs -p /sbin/ldconfig
300%postun libs -p /sbin/ldconfig
301
b25cb9a7
JB
302%triggerpostun -- poldek < 0.19.0-1.20050613.22.0
303if [ -f /etc/poldek.conf.rpmsave ]; then
304 awk '/^source/ {
305 name = $3;
306 path = $4;
307 auto = "yes";
308 autoup = "yes";
309 type = "pdir";
f154dd55 310 pri = "";
b25cb9a7
JB
311
312 if (sub(",noauto", "", name)) {
313 auto = "no";
314 }
315
f154dd55
ER
316 # process pri=\d+
317 if (match(name, /,pri=[0-9]+/)) {
318 pri = substr(name, RSTART + 5, RLENGTH - 5);
319 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
320 }
321
b25cb9a7
JB
322 # skip ac sources. already in new config.
323 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
324 print "";
325 print "[source]";
326 print "name = " name;
327 print "type = " type;
328 print "path = " path;
329 print "auto = " auto;
330 print "autoup = " autoup;
f154dd55
ER
331 if (pri) {
332 print "pri = " pri;
333 }
b25cb9a7
JB
334 }
335
336 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
19cae196 337 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
b25cb9a7
JB
338
339 # copy hold=
340 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
341 if [ "$hold" ]; then
342 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
343 fi
344fi
345
b43abde7
ER
346%triggerpostun -- poldek < 0.30-0.20080225.00.1
347if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
348 %{__sed} -i -e '/^%%include source.conf/{
349 a
350 a# /etc/poldek/repos.d/*.conf
351 a%%includedir repos.d
352 }' %{_sysconfdir}/%{name}/poldek.conf
353fi
354
355%{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
356%{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
357
358if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
359 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
478b6a69 360 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
b43abde7
ER
361fi
362
363%ifarch %{x8664}
364if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
365 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
478b6a69 366 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
b43abde7
ER
367fi
368%endif
369
767366b0 370%files -f %{name}.lang
b44549bf 371%defattr(644,root,root,755)
b43abde7 372%doc README* NEWS TODO configs
b25cb9a7 373%dir %{_sysconfdir}/%{name}
08335479 374%dir %{_sysconfdir}/%{name}/repos.d
168acc54 375%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
b43abde7 376%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
8efee472 377%attr(755,root,root) %{_bindir}/*
b25cb9a7
JB
378%dir %{_libdir}/%{name}
379%attr(755,root,root) %{_libdir}/%{name}/*
b44549bf 380%{_mandir}/man1/%{name}*
d8826405 381%lang(pl) %{_mandir}/pl/man1/%{name}*
b25cb9a7 382%{_infodir}/poldek.info*
9e6ff4ef 383%if %{with imode}
384%{_desktopdir}/%{name}.desktop
385%{_pixmapsdir}/%{name}.png
386%endif
b25cb9a7 387
b43abde7 388%if %{without static}
b25cb9a7
JB
389%files libs
390%defattr(644,root,root,755)
d8aeff9a
MB
391%attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
392%attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
393%attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
394%attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
395%attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
396%attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
397%attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
398%attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
399%attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
400%attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
b25cb9a7
JB
401%endif
402
403%files devel
404%defattr(644,root,root,755)
405%{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
406%{_libdir}/lib*.la
407%{_includedir}/*
408
409%files static
410%defattr(644,root,root,755)
411%{_libdir}/lib*.a
58c31de0
JB
412
413%if %{with python}
414%files -n python-poldek
415%defattr(644,root,root,755)
416%attr(755,root,root) %{py_sitedir}/_poldekmod.so
417%{py_sitescriptdir}/poldek.py[co]
418%{py_sitescriptdir}/poldekmod.py[co]
419%endif
This page took 2.718901 seconds and 4 git commands to generate.