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