]> git.pld-linux.org Git - packages/poldek.git/blame - poldek.spec
- new snap (20080820.23)
[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)
4d7ffb0a 8%if "%{pld_release}" == "ti"
530c8c41 9%define ver_db 4.5.20
473ce98d 10%define ver_db_rel 8
4d7ffb0a 11%else
530c8c41 12%define ver_db 4.7.25
473ce98d 13%define ver_db_rel 1
4d7ffb0a 14%endif
ce5515ca 15%define ver_rpm 4.4.9-56
5486bf2e 16#
04a91ad3
MB
17%define snap 20080820.23
18%define rel 1
b44549bf 19Summary: RPM packages management helper tool
9faf625a 20Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
b44549bf 21Name: poldek
24ad8b8d 22Version: 0.30
78b0cd64 23Release: 0.%{snap}.%{rel}
9f931ada 24License: GPL v2
8efee472 25Group: Applications/System
85398bac 26#Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
c0898992 27Source0: http://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}-cvs%{snap}.tar.bz2
04a91ad3 28# Source0-md5: 2738eb3996f1cdf1e5d74b913d6e7414
911a8560 29Source1: %{name}.conf
b25cb9a7 30Source2: %{name}-multilib.conf
2ccd5d66 31Source3: %{name}-ti.conf
32Source4: %{name}-multilib-ti.conf
33Source5: %{name}-aliases.conf
34Source6: %{name}.desktop
35Source7: %{name}.png
85398bac
MB
36Patch0: %{name}-vserver-packages.patch
37Patch1: %{name}-config.patch
38Patch2: %{name}-abort-on-upgrade.patch
04a91ad3
MB
39Patch3: %{name}-inline.patch
40Patch4: %{name}-ls-llu.patch
41Patch5: %{name}-op-ldalldesc.patch
39ca2371 42URL: http://poldek.pld-linux.org/
a4268952 43BuildRequires: autoconf
b25cb9a7 44BuildRequires: automake
373c6f03 45BuildRequires: bzip2-devel
b25cb9a7 46BuildRequires: check
530c8c41 47BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
c0d8905a 48BuildRequires: gettext-autopoint
b25cb9a7
JB
49BuildRequires: libtool
50BuildRequires: libxml2-devel
cbc6f56b 51BuildRequires: openssl-devel >= 0.9.7d
13fd950e 52BuildRequires: pcre-devel
f373d903 53BuildRequires: perl-tools-pod
b3ea4b51 54BuildRequires: pkgconfig
13fd950e 55BuildRequires: popt-devel
58c31de0 56%{?with_python:BuildRequires: python-devel}
b25cb9a7 57BuildRequires: readline-devel >= 5.0
373c6f03 58BuildRequires: rpm-devel >= %{ver_rpm}
300927eb 59%{?with_python:BuildRequires: rpm-pythonprov}
282cfaec 60BuildRequires: xmlto
96475e5e 61BuildRequires: zlib-devel
373c6f03
JB
62%if %{with static}
63BuildRequires: bzip2-static
530c8c41 64BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
2fac0b02 65BuildRequires: glibc-static
acb26797 66BuildRequires: libselinux-static
b25cb9a7 67BuildRequires: libxml2-static
373c6f03
JB
68BuildRequires: ncurses-static
69BuildRequires: openssl-static
70BuildRequires: pcre-static
71BuildRequires: popt-static
72BuildRequires: readline-static
73BuildRequires: rpm-static
74BuildRequires: zlib-static
373c6f03 75%endif
b25cb9a7 76Requires(triggerpostun): awk
168acc54 77Requires(triggerpostun): sed >= 4.0
09d4c571 78Requires: %{name}-libs = %{version}-%{release}
530c8c41 79Requires: db >= %{ver_db}-%{ver_db_rel}
373c6f03 80Requires: rpm >= %{ver_rpm}
530c8c41 81Requires: rpm-db-ver = %{ver_db}
78b0cd64 82Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
e202a52a
ER
83# vf* scripts use sed
84Requires: sed
b44549bf 85BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
86
87%description
0fa0dc36 88poldek is an RPM package management tool which allows you to easily
89perform package verification, installation (including system
13fd950e 90installation from scratch), upgrading, and removal.
0fa0dc36 91
13fd950e
JB
92Program can be used in batch (like apt-get from Debian's APT) or
93interactive mode. The interactive mode puts you into a readline
94interface with command line autocompletion and history, similar to the
95shell mode of Perl's CPAN.
8efee472 96
9fe14a3f 97%{?with_static:This version is statically linked.}
d94b28a6 98
9fe14a3f 99%{!?with_imode:This version hasn't got interactive mode.}
7f07e487 100#'vim
1f84648f 101
caed9b36
JR
102%description -l pl.UTF-8
103poldek jest narzędziem linii poleceń służącym do weryfikacji,
104instalacji (włączając instalację systemu od zera), aktualizacji i
105usuwania pakietów.
56e1ab51 106
caed9b36 107Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
d82a9cb2 108interaktywnym. Tryb interaktywny posiada interfejs readline z
caed9b36
JR
109dopełnianiem komend i historią, podobny do trybu shell perlowego
110modułu CPAN.
8efee472 111
9fe14a3f 112%{?with_static:Ta wersja jest konsolidowana statycznie.}
a611e0bc 113
9fe14a3f 114%{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
b44549bf 115
b25cb9a7 116%package libs
168acc54 117Summary: poldek libraries
9faf625a 118Summary(pl.UTF-8): Biblioteki poldka
168acc54 119Group: Libraries
b25cb9a7
JB
120
121%description libs
122poldek libraries.
123
caed9b36 124%description libs -l pl.UTF-8
b25cb9a7
JB
125Biblioteki poldka.
126
127%package devel
168acc54 128Summary: Header files for poldek libraries
9faf625a 129Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
168acc54 130Group: Development/Libraries
09d4c571 131Requires: %{name}-libs = %{version}-%{release}
b25cb9a7
JB
132
133%description devel
134Header files for poldek libraries.
135
caed9b36
JR
136%description devel -l pl.UTF-8
137Pliki nagłówkowe bibliotek poldka.
b25cb9a7
JB
138
139%package static
168acc54 140Summary: poldek static libraries
9faf625a 141Summary(pl.UTF-8): Biblioteki statyczne poldka
168acc54 142Group: Development/Libraries
09d4c571 143Requires: %{name}-devel = %{version}-%{release}
b25cb9a7
JB
144
145%description static
146poldek static libraries.
147
caed9b36 148%description static -l pl.UTF-8
b25cb9a7
JB
149Biblioteki statyczne poldka.
150
58c31de0
JB
151%package -n python-poldek
152Summary: Python modules for poldek
9faf625a 153Summary(pl.UTF-8): Moduły języka Python dla poldka
58c31de0
JB
154Group: Libraries/Python
155Requires: %{name}-libs = %{version}-%{release}
156%pyrequires_eq python-libs
157
158%description -n python-poldek
159Python modules for poldek.
160
caed9b36
JR
161%description -n python-poldek -l pl.UTF-8
162Moduły języka Python dla poldka.
58c31de0 163
03159b71 164%prep
78b0cd64 165%setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
85398bac 166%patch0 -p1
13aa6434
AM
167%patch1 -p1
168%patch2 -p1
04a91ad3 169%patch3 -p1
2a61c5d4 170%patch4 -p1
c826891f 171%patch5 -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
bef9d2a3 177%{__libtoolize}
21a83253
MM
178%{__aclocal} -I m4
179%{__autoconf}
180%{__automake}
63bd61a7 181cp -f config.sub trurlib
b25cb9a7 182
97ecf213 183CPPFLAGS="-std=gnu99"
1f84648f 184%configure \
b25cb9a7 185 %{?with_static:--enable-static --disable-shared} \
9fe14a3f 186 %{!?with_imode:--disable-imode} \
58c31de0
JB
187 --enable-nls \
188 %{?with_python:--with-python}
03159b71 189%{__make}
8efee472 190
b44549bf 191%install
192rm -rf $RPM_BUILD_ROOT
08335479 193install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
8efee472 194
c8f7d829 195%{__make} install \
196 DESTDIR=$RPM_BUILD_ROOT
de1099c4 197
58c31de0
JB
198%if %{with python}
199%{__make} -C python install \
200 DESTDIR=$RPM_BUILD_ROOT \
201 libdir=%{py_sitedir}
202%endif
203
9fe14a3f 204%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
a49836bb 205
9639596f 206%ifarch i486 i686 ppc sparc alpha athlon
a49836bb 207%define _ftp_arch %{_target_cpu}
36004ea3 208%endif
9639596f 209%ifarch %{x8664}
590302c4 210%define _ftp_arch x86_64
b25cb9a7 211%define _ftp_alt_arch i686
36004ea3 212%endif
9639596f 213%ifarch i586
58820d9b 214%if "%{pld_release}" == "ti"
215%define _ftp_arch i586
216%else
9639596f 217%define _ftp_arch i486
36004ea3 218%endif
58820d9b 219%endif
a49836bb 220%ifarch pentium2 pentium3 pentium4
221%define _ftp_arch i686
36004ea3 222%endif
a49836bb 223%ifarch sparcv9 sparc64
224%define _ftp_arch sparc
225%endif
a49836bb 226
b25cb9a7 227%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
32697bd0 228
2ccd5d66 229%if "%{pld_release}" == "ti"
230sed -e '
231 s|%%ARCH%%|%{_ftp_arch}|g
232' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
233
234%ifarch %{x8664}
235sed '
236 s|%%ARCH%%|%{_ftp_alt_arch}|g
237' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
238%endif
239%else
7adf66ff
ER
240sed -e '
241 s|%%ARCH%%|%{_ftp_arch}|g
b43abde7 242' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
b44549bf 243
590302c4 244%ifarch %{x8664}
7adf66ff
ER
245sed '
246 s|%%ARCH%%|%{_ftp_alt_arch}|g
b43abde7 247' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
b25cb9a7 248%endif
2ccd5d66 249%endif
b25cb9a7 250
2ccd5d66 251install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
b25cb9a7 252
9e6ff4ef 253%if %{with imode}
254# add desktop file and icon
255install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
2ccd5d66 256install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
257install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
9e6ff4ef 258%endif
259
b43abde7
ER
260# sources we don't package
261rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
b25cb9a7
JB
262# include them in %doc
263rm -rf configs
264cp -a conf configs
265rm -f configs/Makefile*
266
62e80071 267%if %{with python}
58c31de0
JB
268%py_postclean
269rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
62e80071 270%endif
58c31de0 271
b25cb9a7 272%find_lang %{name}
f373d903 273
b44549bf 274%clean
275rm -rf $RPM_BUILD_ROOT
276
3896c8b1
ER
277%post -p /sbin/postshell
278-/usr/sbin/fix-info-dir -c %{_infodir}
b25cb9a7 279
3896c8b1
ER
280%postun -p /sbin/postshell
281-/usr/sbin/fix-info-dir -c %{_infodir}
b25cb9a7
JB
282
283%post libs -p /sbin/ldconfig
284%postun libs -p /sbin/ldconfig
285
b25cb9a7
JB
286%triggerpostun -- poldek < 0.19.0-1.20050613.22.0
287if [ -f /etc/poldek.conf.rpmsave ]; then
288 awk '/^source/ {
289 name = $3;
290 path = $4;
291 auto = "yes";
292 autoup = "yes";
293 type = "pdir";
f154dd55 294 pri = "";
b25cb9a7
JB
295
296 if (sub(",noauto", "", name)) {
297 auto = "no";
298 }
299
f154dd55
ER
300 # process pri=\d+
301 if (match(name, /,pri=[0-9]+/)) {
302 pri = substr(name, RSTART + 5, RLENGTH - 5);
303 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
304 }
305
b25cb9a7
JB
306 # skip ac sources. already in new config.
307 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
308 print "";
309 print "[source]";
310 print "name = " name;
311 print "type = " type;
312 print "path = " path;
313 print "auto = " auto;
314 print "autoup = " autoup;
f154dd55
ER
315 if (pri) {
316 print "pri = " pri;
317 }
b25cb9a7
JB
318 }
319
320 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
19cae196 321 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
b25cb9a7
JB
322
323 # copy hold=
324 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
325 if [ "$hold" ]; then
326 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
327 fi
328fi
329
b43abde7
ER
330%triggerpostun -- poldek < 0.30-0.20080225.00.1
331if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
332 %{__sed} -i -e '/^%%include source.conf/{
333 a
334 a# /etc/poldek/repos.d/*.conf
335 a%%includedir repos.d
336 }' %{_sysconfdir}/%{name}/poldek.conf
337fi
338
339%{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
340%{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
341
342if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
343 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
478b6a69 344 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
b43abde7
ER
345fi
346
347%ifarch %{x8664}
348if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
349 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
478b6a69 350 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
b43abde7
ER
351fi
352%endif
353
767366b0 354%files -f %{name}.lang
b44549bf 355%defattr(644,root,root,755)
b43abde7 356%doc README* NEWS TODO configs
b25cb9a7 357%dir %{_sysconfdir}/%{name}
08335479 358%dir %{_sysconfdir}/%{name}/repos.d
168acc54 359%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
b43abde7 360%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
8efee472 361%attr(755,root,root) %{_bindir}/*
b25cb9a7
JB
362%dir %{_libdir}/%{name}
363%attr(755,root,root) %{_libdir}/%{name}/*
b44549bf 364%{_mandir}/man1/%{name}*
d8826405 365%lang(pl) %{_mandir}/pl/man1/%{name}*
b25cb9a7 366%{_infodir}/poldek.info*
9e6ff4ef 367%if %{with imode}
368%{_desktopdir}/%{name}.desktop
369%{_pixmapsdir}/%{name}.png
370%endif
b25cb9a7 371
b43abde7 372%if %{without static}
b25cb9a7
JB
373%files libs
374%defattr(644,root,root,755)
d8aeff9a
MB
375%attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
376%attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
377%attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
378%attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
379%attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
380%attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
381%attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
382%attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
383%attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
384%attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
b25cb9a7
JB
385%endif
386
387%files devel
388%defattr(644,root,root,755)
389%{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
390%{_libdir}/lib*.la
391%{_includedir}/*
392
393%files static
394%defattr(644,root,root,755)
395%{_libdir}/lib*.a
58c31de0
JB
396
397%if %{with python}
398%files -n python-poldek
399%defattr(644,root,root,755)
400%attr(755,root,root) %{py_sitedir}/_poldekmod.so
401%{py_sitescriptdir}/poldek.py[co]
402%{py_sitescriptdir}/poldekmod.py[co]
403%endif
This page took 0.159176 seconds and 4 git commands to generate.