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