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