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