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