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