]> git.pld-linux.org Git - packages/poldek.git/blame - poldek.spec
- release 0.5
[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)
5486bf2e
ER
8%define ver_db 4.3.27-1
9%define ver_rpm 4.4.9-1
10#
24ad8b8d 11%define snap 20080225.00
d600c9ff 12%define rel 0.5
b44549bf 13Summary: RPM packages management helper tool
9faf625a 14Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
b44549bf 15Name: poldek
24ad8b8d 16Version: 0.30
78b0cd64 17Release: 0.%{snap}.%{rel}
9f931ada 18License: GPL v2
8efee472 19Group: Applications/System
7b350490 20Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
24ad8b8d 21# Source0-md5: 22b2cfb19cebd123e8d8148fb6ca27de
911a8560 22Source1: %{name}.conf
b25cb9a7
JB
23Source2: %{name}-multilib.conf
24Source3: %{name}-aliases.conf
9e6ff4ef 25Source4: %{name}.desktop
26Source5: %{name}.png
13aa6434
AM
27Patch1: %{name}-vserver-packages.patch
28Patch2: %{name}-config.patch
29Patch3: %{name}-multilib.patch
533cf0f6 30Patch4: %{name}-bug117hack.patch
d8aeff9a 31Patch5: %{name}-missing-symbol.patch
03777721 32Patch6: %{name}-abort-on-upgrade.patch
39ca2371 33URL: http://poldek.pld-linux.org/
a4268952 34BuildRequires: autoconf
b25cb9a7 35BuildRequires: automake
373c6f03 36BuildRequires: bzip2-devel
b25cb9a7 37BuildRequires: check
b1928c7a 38BuildRequires: db-devel >= %{ver_db}
c0d8905a 39BuildRequires: gettext-autopoint
b25cb9a7
JB
40BuildRequires: libtool
41BuildRequires: libxml2-devel
cbc6f56b 42BuildRequires: openssl-devel >= 0.9.7d
13fd950e 43BuildRequires: pcre-devel
f373d903 44BuildRequires: perl-tools-pod
b3ea4b51 45BuildRequires: pkgconfig
13fd950e 46BuildRequires: popt-devel
58c31de0 47%{?with_python:BuildRequires: python-devel}
b25cb9a7 48BuildRequires: readline-devel >= 5.0
373c6f03 49BuildRequires: rpm-devel >= %{ver_rpm}
300927eb 50%{?with_python:BuildRequires: rpm-pythonprov}
282cfaec 51BuildRequires: xmlto
96475e5e 52BuildRequires: zlib-devel
373c6f03
JB
53%if %{with static}
54BuildRequires: bzip2-static
b1928c7a 55BuildRequires: db-static >= %{ver_db}
2fac0b02 56BuildRequires: glibc-static
acb26797 57BuildRequires: libselinux-static
b25cb9a7 58BuildRequires: libxml2-static
373c6f03
JB
59BuildRequires: ncurses-static
60BuildRequires: openssl-static
61BuildRequires: pcre-static
62BuildRequires: popt-static
63BuildRequires: readline-static
64BuildRequires: rpm-static
65BuildRequires: zlib-static
373c6f03 66%endif
b25cb9a7 67Requires(triggerpostun): awk
168acc54 68Requires(triggerpostun): sed >= 4.0
09d4c571 69Requires: %{name}-libs = %{version}-%{release}
b1928c7a 70Requires: db >= %{ver_db}
373c6f03 71Requires: rpm >= %{ver_rpm}
78b0cd64 72Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
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
78b0cd64 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
533cf0f6 161%patch4 -p0
d8aeff9a 162%patch5 -p1
03777721 163%patch6 -p1
b44549bf 164
0579f9b7
ER
165# cleanup backups after patching
166find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
167
b44549bf 168%build
df3bea74 169%{__autopoint}
21a83253
MM
170%{__aclocal} -I m4
171%{__autoconf}
172%{__automake}
63bd61a7 173cp -f config.sub trurlib
b25cb9a7 174
97ecf213 175CPPFLAGS="-std=gnu99"
1f84648f 176%configure \
b25cb9a7 177 %{?with_static:--enable-static --disable-shared} \
9fe14a3f 178 %{!?with_imode:--disable-imode} \
58c31de0
JB
179 --enable-nls \
180 %{?with_python:--with-python}
03159b71 181%{__make}
8efee472 182
b44549bf 183%install
184rm -rf $RPM_BUILD_ROOT
08335479 185install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
8efee472 186
c8f7d829 187%{__make} install \
188 DESTDIR=$RPM_BUILD_ROOT
de1099c4 189
58c31de0
JB
190%if %{with python}
191%{__make} -C python install \
192 DESTDIR=$RPM_BUILD_ROOT \
193 libdir=%{py_sitedir}
194%endif
195
9fe14a3f 196%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
a49836bb 197
9639596f 198%ifarch i486 i686 ppc sparc alpha athlon
a49836bb 199%define _ftp_arch %{_target_cpu}
200%else
9639596f 201%ifarch %{x8664}
590302c4 202%define _ftp_arch x86_64
b25cb9a7
JB
203%define _ftp_alt_arch i686
204%else
9639596f
PS
205%ifarch i586
206%define _ftp_arch i486
a49836bb 207%else
208%ifarch pentium2 pentium3 pentium4
209%define _ftp_arch i686
210%else
211%ifarch sparcv9 sparc64
212%define _ftp_arch sparc
213%endif
214%endif
215%endif
216%endif
b25cb9a7 217%endif
a49836bb 218
b25cb9a7 219%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
32697bd0 220
7adf66ff
ER
221sed -e '
222 s|%%ARCH%%|%{_ftp_arch}|g
223' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
b44549bf 224
590302c4 225%ifarch %{x8664}
7adf66ff
ER
226sed '
227 s|%%ARCH%%|%{_ftp_alt_arch}|g
228' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
b25cb9a7
JB
229%endif
230
231install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
232
9e6ff4ef 233%if %{with imode}
234# add desktop file and icon
235install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
236install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
237install %{SOURCE5} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
238%endif
239
b25cb9a7 240# get rid of non-pld sources
08335479 241rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
b25cb9a7
JB
242# include them in %doc
243rm -rf configs
244cp -a conf configs
245rm -f configs/Makefile*
246
62e80071 247%if %{with python}
58c31de0
JB
248%py_postclean
249rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
62e80071 250%endif
58c31de0 251
b25cb9a7 252%find_lang %{name}
f373d903 253
b44549bf 254%clean
255rm -rf $RPM_BUILD_ROOT
256
3896c8b1
ER
257%post -p /sbin/postshell
258-/usr/sbin/fix-info-dir -c %{_infodir}
b25cb9a7 259
3896c8b1
ER
260%postun -p /sbin/postshell
261-/usr/sbin/fix-info-dir -c %{_infodir}
b25cb9a7
JB
262
263%post libs -p /sbin/ldconfig
264%postun libs -p /sbin/ldconfig
265
b25cb9a7
JB
266%triggerpostun -- poldek < 0.19.0-1.20050613.22.0
267if [ -f /etc/poldek.conf.rpmsave ]; then
268 awk '/^source/ {
269 name = $3;
270 path = $4;
271 auto = "yes";
272 autoup = "yes";
273 type = "pdir";
f154dd55 274 pri = "";
b25cb9a7
JB
275
276 if (sub(",noauto", "", name)) {
277 auto = "no";
278 }
279
f154dd55
ER
280 # process pri=\d+
281 if (match(name, /,pri=[0-9]+/)) {
282 pri = substr(name, RSTART + 5, RLENGTH - 5);
283 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
284 }
285
b25cb9a7
JB
286 # skip ac sources. already in new config.
287 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
288 print "";
289 print "[source]";
290 print "name = " name;
291 print "type = " type;
292 print "path = " path;
293 print "auto = " auto;
294 print "autoup = " autoup;
f154dd55
ER
295 if (pri) {
296 print "pri = " pri;
297 }
b25cb9a7
JB
298 }
299
300 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
19cae196 301 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
b25cb9a7
JB
302
303 # copy hold=
304 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
305 if [ "$hold" ]; then
306 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
307 fi
308fi
309
767366b0 310%files -f %{name}.lang
b44549bf 311%defattr(644,root,root,755)
b25cb9a7
JB
312%doc README* NEWS TODO configs/
313%dir %{_sysconfdir}/%{name}
08335479 314%dir %{_sysconfdir}/%{name}/repos.d
168acc54 315%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
8efee472 316%attr(755,root,root) %{_bindir}/*
b25cb9a7
JB
317%dir %{_libdir}/%{name}
318%attr(755,root,root) %{_libdir}/%{name}/*
b44549bf 319%{_mandir}/man1/%{name}*
d8826405 320%lang(pl) %{_mandir}/pl/man1/%{name}*
b25cb9a7 321%{_infodir}/poldek.info*
9e6ff4ef 322%if %{with imode}
323%{_desktopdir}/%{name}.desktop
324%{_pixmapsdir}/%{name}.png
325%endif
b25cb9a7 326
f8c7c6b5 327%if !%{with static}
b25cb9a7
JB
328%files libs
329%defattr(644,root,root,755)
d8aeff9a
MB
330%attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
331%attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
332%attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
333%attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
334%attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
335%attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
336%attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
337%attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
338%attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
339%attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
b25cb9a7
JB
340%endif
341
342%files devel
343%defattr(644,root,root,755)
344%{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
345%{_libdir}/lib*.la
346%{_includedir}/*
347
348%files static
349%defattr(644,root,root,755)
350%{_libdir}/lib*.a
58c31de0
JB
351
352%if %{with python}
353%files -n python-poldek
354%defattr(644,root,root,755)
355%attr(755,root,root) %{py_sitedir}/_poldekmod.so
356%{py_sitescriptdir}/poldek.py[co]
357%{py_sitescriptdir}/poldekmod.py[co]
358%endif
This page took 0.212973 seconds and 4 git commands to generate.