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