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