]> git.pld-linux.org Git - packages/poldek.git/blame - poldek.spec
- updated for new snap 0.30
[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#
78b0cd64 11%define snap 20070703.00
d4ed202a 12%define rel 15
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
78b0cd64 17Release: 0.%{snap}.%{rel}
9f931ada 18License: GPL v2
8efee472 19Group: Applications/System
78b0cd64 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
9e6ff4ef 25Source4: %{name}.desktop
26Source5: %{name}.png
13aa6434
AM
27Patch1: %{name}-vserver-packages.patch
28Patch2: %{name}-config.patch
29Patch3: %{name}-multilib.patch
3fb676f2 30Patch4: %{name}-ndie_fix.patch
aee8a249 31Patch5: %{name}-uri-escape-fix.patch
f4531e03 32Patch6: %{name}-install-dist.patch
53e37858 33Patch7: %{name}-nohold-fix.patch
749b3447 34Patch8: %{name}-dir-dot.patch
683fa045 35Patch9: %{name}-suggests-one-package.patch
8f76a487 36Patch10: %{name}-reversed-prompt.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
8f76a487 171%patch10 -p1
b44549bf 172
0579f9b7
ER
173# cleanup backups after patching
174find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
175
b44549bf 176%build
df3bea74 177%{__autopoint}
21a83253
MM
178%{__aclocal} -I m4
179%{__autoconf}
180%{__automake}
63bd61a7 181cp -f config.sub trurlib
b25cb9a7 182
1f84648f 183%configure \
b25cb9a7 184 %{?with_static:--enable-static --disable-shared} \
9fe14a3f 185 %{!?with_imode:--disable-imode} \
58c31de0
JB
186 --enable-nls \
187 %{?with_python:--with-python}
03159b71 188%{__make}
8efee472 189
b44549bf 190%install
191rm -rf $RPM_BUILD_ROOT
23749bce 192install -d $RPM_BUILD_ROOT%{_sysconfdir}
8efee472 193
c8f7d829 194%{__make} install \
195 DESTDIR=$RPM_BUILD_ROOT
de1099c4 196
58c31de0
JB
197%if %{with python}
198%{__make} -C python install \
199 DESTDIR=$RPM_BUILD_ROOT \
200 libdir=%{py_sitedir}
201%endif
202
9fe14a3f 203%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
a49836bb 204
9639596f 205%ifarch i486 i686 ppc sparc alpha athlon
a49836bb 206%define _ftp_arch %{_target_cpu}
207%else
9639596f 208%ifarch %{x8664}
590302c4 209%define _ftp_arch x86_64
b25cb9a7
JB
210%define _ftp_alt_arch i686
211%else
9639596f
PS
212%ifarch i586
213%define _ftp_arch i486
a49836bb 214%else
215%ifarch pentium2 pentium3 pentium4
216%define _ftp_arch i686
217%else
218%ifarch sparcv9 sparc64
219%define _ftp_arch sparc
220%endif
221%endif
222%endif
223%endif
b25cb9a7 224%endif
a49836bb 225
b25cb9a7 226%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
32697bd0 227
7adf66ff
ER
228sed -e '
229 s|%%ARCH%%|%{_ftp_arch}|g
230' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
b44549bf 231
590302c4 232%ifarch %{x8664}
7adf66ff
ER
233sed '
234 s|%%ARCH%%|%{_ftp_alt_arch}|g
235' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
b25cb9a7
JB
236%endif
237
238install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
239
9e6ff4ef 240%if %{with imode}
241# add desktop file and icon
242install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
243install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
244install %{SOURCE5} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
245%endif
246
b25cb9a7
JB
247# get rid of non-pld sources
248rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
249# include them in %doc
250rm -rf configs
251cp -a conf configs
252rm -f configs/Makefile*
253
62e80071 254%if %{with python}
58c31de0
JB
255%py_postclean
256rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
62e80071 257%endif
58c31de0 258
b25cb9a7 259%find_lang %{name}
f373d903 260
b44549bf 261%clean
262rm -rf $RPM_BUILD_ROOT
263
3896c8b1
ER
264%post -p /sbin/postshell
265-/usr/sbin/fix-info-dir -c %{_infodir}
b25cb9a7 266
3896c8b1
ER
267%postun -p /sbin/postshell
268-/usr/sbin/fix-info-dir -c %{_infodir}
b25cb9a7
JB
269
270%post libs -p /sbin/ldconfig
271%postun libs -p /sbin/ldconfig
272
b25cb9a7
JB
273%triggerpostun -- poldek < 0.19.0-1.20050613.22.0
274if [ -f /etc/poldek.conf.rpmsave ]; then
275 awk '/^source/ {
276 name = $3;
277 path = $4;
278 auto = "yes";
279 autoup = "yes";
280 type = "pdir";
f154dd55 281 pri = "";
b25cb9a7
JB
282
283 if (sub(",noauto", "", name)) {
284 auto = "no";
285 }
286
f154dd55
ER
287 # process pri=\d+
288 if (match(name, /,pri=[0-9]+/)) {
289 pri = substr(name, RSTART + 5, RLENGTH - 5);
290 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
291 }
292
b25cb9a7
JB
293 # skip ac sources. already in new config.
294 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
295 print "";
296 print "[source]";
297 print "name = " name;
298 print "type = " type;
299 print "path = " path;
300 print "auto = " auto;
301 print "autoup = " autoup;
f154dd55
ER
302 if (pri) {
303 print "pri = " pri;
304 }
b25cb9a7
JB
305 }
306
307 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
19cae196 308 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
b25cb9a7
JB
309
310 # copy hold=
311 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
312 if [ "$hold" ]; then
313 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
314 fi
315fi
316
767366b0 317%files -f %{name}.lang
b44549bf 318%defattr(644,root,root,755)
b25cb9a7
JB
319%doc README* NEWS TODO configs/
320%dir %{_sysconfdir}/%{name}
168acc54 321%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
8efee472 322%attr(755,root,root) %{_bindir}/*
b25cb9a7
JB
323%dir %{_libdir}/%{name}
324%attr(755,root,root) %{_libdir}/%{name}/*
b44549bf 325%{_mandir}/man1/%{name}*
d8826405 326%lang(pl) %{_mandir}/pl/man1/%{name}*
b25cb9a7 327%{_infodir}/poldek.info*
9e6ff4ef 328%if %{with imode}
329%{_desktopdir}/%{name}.desktop
330%{_pixmapsdir}/%{name}.png
331%endif
b25cb9a7 332
f8c7c6b5 333%if !%{with static}
b25cb9a7
JB
334%files libs
335%defattr(644,root,root,755)
336%attr(755,root,root) %{_libdir}/lib*.so.*.*.*
337%endif
338
339%files devel
340%defattr(644,root,root,755)
341%{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
342%{_libdir}/lib*.la
343%{_includedir}/*
344
345%files static
346%defattr(644,root,root,755)
347%{_libdir}/lib*.a
58c31de0
JB
348
349%if %{with python}
350%files -n python-poldek
351%defattr(644,root,root,755)
352%attr(755,root,root) %{py_sitedir}/_poldekmod.so
353%{py_sitescriptdir}/poldek.py[co]
354%{py_sitescriptdir}/poldekmod.py[co]
355%endif
This page took 0.173397 seconds and 4 git commands to generate.