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