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