]> git.pld-linux.org Git - packages/poldek.git/blame - poldek.spec
- simplify ftp arch macro setup
[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}
36004ea3 200%endif
9639596f 201%ifarch %{x8664}
590302c4 202%define _ftp_arch x86_64
b25cb9a7 203%define _ftp_alt_arch i686
36004ea3 204%endif
9639596f
PS
205%ifarch i586
206%define _ftp_arch i486
36004ea3 207%endif
a49836bb 208%ifarch pentium2 pentium3 pentium4
209%define _ftp_arch i686
36004ea3 210%endif
a49836bb 211%ifarch sparcv9 sparc64
212%define _ftp_arch sparc
213%endif
a49836bb 214
b25cb9a7 215%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
32697bd0 216
7adf66ff
ER
217sed -e '
218 s|%%ARCH%%|%{_ftp_arch}|g
219' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
b44549bf 220
590302c4 221%ifarch %{x8664}
7adf66ff
ER
222sed '
223 s|%%ARCH%%|%{_ftp_alt_arch}|g
224' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
b25cb9a7
JB
225%endif
226
227install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
228
9e6ff4ef 229%if %{with imode}
230# add desktop file and icon
231install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
232install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
233install %{SOURCE5} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
234%endif
235
b25cb9a7 236# get rid of non-pld sources
08335479 237rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
b25cb9a7
JB
238# include them in %doc
239rm -rf configs
240cp -a conf configs
241rm -f configs/Makefile*
242
62e80071 243%if %{with python}
58c31de0
JB
244%py_postclean
245rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
62e80071 246%endif
58c31de0 247
b25cb9a7 248%find_lang %{name}
f373d903 249
b44549bf 250%clean
251rm -rf $RPM_BUILD_ROOT
252
3896c8b1
ER
253%post -p /sbin/postshell
254-/usr/sbin/fix-info-dir -c %{_infodir}
b25cb9a7 255
3896c8b1
ER
256%postun -p /sbin/postshell
257-/usr/sbin/fix-info-dir -c %{_infodir}
b25cb9a7
JB
258
259%post libs -p /sbin/ldconfig
260%postun libs -p /sbin/ldconfig
261
b25cb9a7
JB
262%triggerpostun -- poldek < 0.19.0-1.20050613.22.0
263if [ -f /etc/poldek.conf.rpmsave ]; then
264 awk '/^source/ {
265 name = $3;
266 path = $4;
267 auto = "yes";
268 autoup = "yes";
269 type = "pdir";
f154dd55 270 pri = "";
b25cb9a7
JB
271
272 if (sub(",noauto", "", name)) {
273 auto = "no";
274 }
275
f154dd55
ER
276 # process pri=\d+
277 if (match(name, /,pri=[0-9]+/)) {
278 pri = substr(name, RSTART + 5, RLENGTH - 5);
279 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
280 }
281
b25cb9a7
JB
282 # skip ac sources. already in new config.
283 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
284 print "";
285 print "[source]";
286 print "name = " name;
287 print "type = " type;
288 print "path = " path;
289 print "auto = " auto;
290 print "autoup = " autoup;
f154dd55
ER
291 if (pri) {
292 print "pri = " pri;
293 }
b25cb9a7
JB
294 }
295
296 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
19cae196 297 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
b25cb9a7
JB
298
299 # copy hold=
300 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
301 if [ "$hold" ]; then
302 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
303 fi
304fi
305
767366b0 306%files -f %{name}.lang
b44549bf 307%defattr(644,root,root,755)
b25cb9a7
JB
308%doc README* NEWS TODO configs/
309%dir %{_sysconfdir}/%{name}
08335479 310%dir %{_sysconfdir}/%{name}/repos.d
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 317%{_infodir}/poldek.info*
9e6ff4ef 318%if %{with imode}
319%{_desktopdir}/%{name}.desktop
320%{_pixmapsdir}/%{name}.png
321%endif
b25cb9a7 322
f8c7c6b5 323%if !%{with static}
b25cb9a7
JB
324%files libs
325%defattr(644,root,root,755)
d8aeff9a
MB
326%attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
327%attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
328%attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
329%attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
330%attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
331%attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
332%attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
333%attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
334%attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
335%attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
b25cb9a7
JB
336%endif
337
338%files devel
339%defattr(644,root,root,755)
340%{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
341%{_libdir}/lib*.la
342%{_includedir}/*
343
344%files static
345%defattr(644,root,root,755)
346%{_libdir}/lib*.a
58c31de0
JB
347
348%if %{with python}
349%files -n python-poldek
350%defattr(644,root,root,755)
351%attr(755,root,root) %{py_sitedir}/_poldekmod.so
352%{py_sitescriptdir}/poldek.py[co]
353%{py_sitescriptdir}/poldekmod.py[co]
354%endif
This page took 0.221492 seconds and 4 git commands to generate.