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