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