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