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