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