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