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