]> git.pld-linux.org Git - packages/poldek.git/blame - poldek.spec
- rel .6 ; add nohold fix from ac-branch
[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)
ad60ba0e 8%define ver_db 4.3.27-1
75ff0ed8 9%define ver_rpm 4.4.9-1
7617242e 10#
3dd29dc2 11%define snap 20070703.00
b44549bf 12Summary: RPM packages management helper tool
9faf625a 13Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
b44549bf 14Name: poldek
bbc50e33 15Version: 0.21
53e37858 16Release: 0.%{snap}.6
9f931ada 17License: GPL v2
8efee472 18Group: Applications/System
56213e3b 19Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
3dd29dc2 20# Source0-md5: dae23dec560fad954abf157fd250e4c3
911a8560 21Source1: %{name}.conf
b25cb9a7
JB
22Source2: %{name}-multilib.conf
23Source3: %{name}-aliases.conf
13aa6434
AM
24Patch1: %{name}-vserver-packages.patch
25Patch2: %{name}-config.patch
26Patch3: %{name}-multilib.patch
3fb676f2 27Patch4: %{name}-ndie_fix.patch
aee8a249 28Patch5: %{name}-uri-escape-fix.patch
f4531e03 29Patch6: %{name}-install-dist.patch
53e37858 30Patch7: %{name}-nohold-fix.patch
39ca2371 31URL: http://poldek.pld-linux.org/
a4268952 32BuildRequires: autoconf
b25cb9a7 33BuildRequires: automake
373c6f03 34BuildRequires: bzip2-devel
b25cb9a7 35BuildRequires: check
b1928c7a 36BuildRequires: db-devel >= %{ver_db}
c0d8905a 37BuildRequires: gettext-autopoint
b25cb9a7
JB
38BuildRequires: libtool
39BuildRequires: libxml2-devel
cbc6f56b 40BuildRequires: openssl-devel >= 0.9.7d
13fd950e 41BuildRequires: pcre-devel
f373d903 42BuildRequires: perl-tools-pod
b3ea4b51 43BuildRequires: pkgconfig
13fd950e 44BuildRequires: popt-devel
58c31de0 45%{?with_python:BuildRequires: python-devel}
b25cb9a7 46BuildRequires: readline-devel >= 5.0
373c6f03 47BuildRequires: rpm-devel >= %{ver_rpm}
300927eb 48%{?with_python:BuildRequires: rpm-pythonprov}
282cfaec 49BuildRequires: xmlto
96475e5e 50BuildRequires: zlib-devel
373c6f03
JB
51%if %{with static}
52BuildRequires: bzip2-static
b1928c7a 53BuildRequires: db-static >= %{ver_db}
2fac0b02 54BuildRequires: glibc-static
acb26797 55BuildRequires: libselinux-static
b25cb9a7 56BuildRequires: libxml2-static
373c6f03
JB
57BuildRequires: ncurses-static
58BuildRequires: openssl-static
59BuildRequires: pcre-static
60BuildRequires: popt-static
61BuildRequires: readline-static
62BuildRequires: rpm-static
63BuildRequires: zlib-static
373c6f03 64%endif
b25cb9a7 65Requires(triggerpostun): awk
168acc54 66Requires(triggerpostun): sed >= 4.0
09d4c571 67Requires: %{name}-libs = %{version}-%{release}
b1928c7a 68Requires: db >= %{ver_db}
373c6f03 69Requires: rpm >= %{ver_rpm}
e202a52a
ER
70# vf* scripts use sed
71Requires: sed
b44549bf 72BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
73
74%description
0fa0dc36 75poldek is an RPM package management tool which allows you to easily
76perform package verification, installation (including system
13fd950e 77installation from scratch), upgrading, and removal.
0fa0dc36 78
13fd950e
JB
79Program can be used in batch (like apt-get from Debian's APT) or
80interactive mode. The interactive mode puts you into a readline
81interface with command line autocompletion and history, similar to the
82shell mode of Perl's CPAN.
8efee472 83
9fe14a3f 84%{?with_static:This version is statically linked.}
d94b28a6 85
9fe14a3f 86%{!?with_imode:This version hasn't got interactive mode.}
7f07e487 87#'vim
1f84648f 88
caed9b36
JR
89%description -l pl.UTF-8
90poldek jest narzędziem linii poleceń służącym do weryfikacji,
91instalacji (włączając instalację systemu od zera), aktualizacji i
92usuwania pakietów.
56e1ab51 93
caed9b36 94Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
d82a9cb2 95interaktywnym. Tryb interaktywny posiada interfejs readline z
caed9b36
JR
96dopełnianiem komend i historią, podobny do trybu shell perlowego
97modułu CPAN.
8efee472 98
9fe14a3f 99%{?with_static:Ta wersja jest konsolidowana statycznie.}
a611e0bc 100
9fe14a3f 101%{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
b44549bf 102
b25cb9a7 103%package libs
168acc54 104Summary: poldek libraries
9faf625a 105Summary(pl.UTF-8): Biblioteki poldka
168acc54 106Group: Libraries
b25cb9a7
JB
107
108%description libs
109poldek libraries.
110
caed9b36 111%description libs -l pl.UTF-8
b25cb9a7
JB
112Biblioteki poldka.
113
114%package devel
168acc54 115Summary: Header files for poldek libraries
9faf625a 116Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
168acc54 117Group: Development/Libraries
09d4c571 118Requires: %{name}-libs = %{version}-%{release}
b25cb9a7
JB
119
120%description devel
121Header files for poldek libraries.
122
caed9b36
JR
123%description devel -l pl.UTF-8
124Pliki nagłówkowe bibliotek poldka.
b25cb9a7
JB
125
126%package static
168acc54 127Summary: poldek static libraries
9faf625a 128Summary(pl.UTF-8): Biblioteki statyczne poldka
168acc54 129Group: Development/Libraries
09d4c571 130Requires: %{name}-devel = %{version}-%{release}
b25cb9a7
JB
131
132%description static
133poldek static libraries.
134
caed9b36 135%description static -l pl.UTF-8
b25cb9a7
JB
136Biblioteki statyczne poldka.
137
58c31de0
JB
138%package -n python-poldek
139Summary: Python modules for poldek
9faf625a 140Summary(pl.UTF-8): Moduły języka Python dla poldka
58c31de0
JB
141Group: Libraries/Python
142Requires: %{name}-libs = %{version}-%{release}
143%pyrequires_eq python-libs
144
145%description -n python-poldek
146Python modules for poldek.
147
caed9b36
JR
148%description -n python-poldek -l pl.UTF-8
149Moduły języka Python dla poldka.
58c31de0 150
03159b71 151%prep
6bf978ec 152%setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
13aa6434
AM
153%patch1 -p1
154%patch2 -p1
3375120c 155%ifarch %{x8664}
13aa6434 156%patch3 -p1
3375120c 157%endif
3fb676f2 158%patch4 -p0
aee8a249 159%patch5 -p0
f4531e03 160%patch6 -p1
53e37858 161%patch7 -p1
b44549bf 162
0579f9b7
ER
163# cleanup backups after patching
164find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
165
b44549bf 166%build
df3bea74 167%{__autopoint}
21a83253
MM
168%{__aclocal} -I m4
169%{__autoconf}
170%{__automake}
63bd61a7 171cp -f config.sub trurlib
b25cb9a7 172
1f84648f 173%configure \
b25cb9a7 174 %{?with_static:--enable-static --disable-shared} \
9fe14a3f 175 %{!?with_imode:--disable-imode} \
58c31de0
JB
176 --enable-nls \
177 %{?with_python:--with-python}
03159b71 178%{__make}
8efee472 179
b44549bf 180%install
181rm -rf $RPM_BUILD_ROOT
23749bce 182install -d $RPM_BUILD_ROOT%{_sysconfdir}
8efee472 183
c8f7d829 184%{__make} install \
185 DESTDIR=$RPM_BUILD_ROOT
de1099c4 186
58c31de0
JB
187%if %{with python}
188%{__make} -C python install \
189 DESTDIR=$RPM_BUILD_ROOT \
190 libdir=%{py_sitedir}
191%endif
192
9fe14a3f 193%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
a49836bb 194
9639596f 195%ifarch i486 i686 ppc sparc alpha athlon
a49836bb 196%define _ftp_arch %{_target_cpu}
197%else
9639596f 198%ifarch %{x8664}
590302c4 199%define _ftp_arch x86_64
b25cb9a7
JB
200%define _ftp_alt_arch i686
201%else
9639596f
PS
202%ifarch i586
203%define _ftp_arch i486
a49836bb 204%else
205%ifarch pentium2 pentium3 pentium4
206%define _ftp_arch i686
207%else
208%ifarch sparcv9 sparc64
209%define _ftp_arch sparc
210%endif
211%endif
212%endif
213%endif
b25cb9a7 214%endif
a49836bb 215
b25cb9a7 216%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
32697bd0 217
7adf66ff
ER
218sed -e '
219 s|%%ARCH%%|%{_ftp_arch}|g
220' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
b44549bf 221
590302c4 222%ifarch %{x8664}
7adf66ff
ER
223sed '
224 s|%%ARCH%%|%{_ftp_alt_arch}|g
225' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
b25cb9a7
JB
226%endif
227
228install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
229
230# get rid of non-pld sources
231rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
232# include them in %doc
233rm -rf configs
234cp -a conf configs
235rm -f configs/Makefile*
236
62e80071 237%if %{with python}
58c31de0
JB
238%py_postclean
239rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
62e80071 240%endif
58c31de0 241
b25cb9a7 242%find_lang %{name}
f373d903 243
b44549bf 244%clean
245rm -rf $RPM_BUILD_ROOT
246
b25cb9a7
JB
247%post
248[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
249
250%postun
251[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
252
253%post libs -p /sbin/ldconfig
254%postun libs -p /sbin/ldconfig
255
f581a7d5 256%triggerpostun -- poldek <= 0.18.3-5
b25cb9a7
JB
257if [ -f /etc/poldek.conf ]; then
258 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
259fi
aa3b63c5 260
a49836bb 261# otherwise don't touch
262%ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
1b2ec187 263%triggerpostun -- poldek <= 0.18.7-1
b25cb9a7
JB
264if [ -f /etc/poldek.conf ]; then
265 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
266fi
a49836bb 267%endif
1b2ec187 268
b25cb9a7
JB
269%triggerpostun -- poldek < 0.19.0-1.20050613.22.0
270if [ -f /etc/poldek.conf.rpmsave ]; then
271 awk '/^source/ {
272 name = $3;
273 path = $4;
274 auto = "yes";
275 autoup = "yes";
276 type = "pdir";
f154dd55 277 pri = "";
b25cb9a7
JB
278
279 if (sub(",noauto", "", name)) {
280 auto = "no";
281 }
282
f154dd55
ER
283 # process pri=\d+
284 if (match(name, /,pri=[0-9]+/)) {
285 pri = substr(name, RSTART + 5, RLENGTH - 5);
286 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
287 }
288
b25cb9a7
JB
289 # skip ac sources. already in new config.
290 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
291 print "";
292 print "[source]";
293 print "name = " name;
294 print "type = " type;
295 print "path = " path;
296 print "auto = " auto;
297 print "autoup = " autoup;
f154dd55
ER
298 if (pri) {
299 print "pri = " pri;
300 }
b25cb9a7
JB
301 }
302
303 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
19cae196 304 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
b25cb9a7
JB
305
306 # copy hold=
307 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
308 if [ "$hold" ]; then
309 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
310 fi
311fi
312
767366b0 313%files -f %{name}.lang
b44549bf 314%defattr(644,root,root,755)
b25cb9a7
JB
315%doc README* NEWS TODO configs/
316%dir %{_sysconfdir}/%{name}
168acc54 317%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
8efee472 318%attr(755,root,root) %{_bindir}/*
b25cb9a7
JB
319%dir %{_libdir}/%{name}
320%attr(755,root,root) %{_libdir}/%{name}/*
b44549bf 321%{_mandir}/man1/%{name}*
d8826405 322%lang(pl) %{_mandir}/pl/man1/%{name}*
b25cb9a7
JB
323%{_infodir}/poldek.info*
324
f8c7c6b5 325%if !%{with static}
b25cb9a7
JB
326%files libs
327%defattr(644,root,root,755)
328%attr(755,root,root) %{_libdir}/lib*.so.*.*.*
329%endif
330
331%files devel
332%defattr(644,root,root,755)
333%{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
334%{_libdir}/lib*.la
335%{_includedir}/*
336
337%files static
338%defattr(644,root,root,755)
339%{_libdir}/lib*.a
58c31de0
JB
340
341%if %{with python}
342%files -n python-poldek
343%defattr(644,root,root,755)
344%attr(755,root,root) %{py_sitedir}/_poldekmod.so
345%{py_sitescriptdir}/poldek.py[co]
346%{py_sitescriptdir}/poldekmod.py[co]
347%endif
This page took 0.109931 seconds and 4 git commands to generate.