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