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