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