]> git.pld-linux.org Git - packages/poldek.git/blob - poldek.spec
- updated to 0.30rc1
[packages/poldek.git] / poldek.spec
1 # TODO:
2 # - fails to build without poldek-devel - fix it !
3 #
4 # Conditional build:
5 %bcond_with     static  # don't use shared libraries
6 %bcond_without  imode   # don't build interactive mode
7 %bcond_without  python  # don't build python bindings
8 #
9 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
10 %if "%{pld_release}" == "ti"
11 %define ver_db  4.5.20
12 %define ver_db_rel      8
13 %else
14 %define ver_db  4.7.25
15 %define ver_db_rel      1
16 %endif
17 %define ver_rpm 4.5-5
18 #
19 %define         snap            rc1
20 %define         rel             1
21 Summary:        RPM packages management helper tool
22 Summary(pl.UTF-8):      Pomocnicze narzędzie do zarządzania pakietami RPM
23 Name:           poldek
24 Version:        0.30
25 Release:        0.%{snap}.%{rel}
26 License:        GPL v2
27 Group:          Applications/System
28 #Source0:       http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
29 Source0:        http://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}%{snap}.tar.bz2
30 # Source0-md5:  ff3bde5f9451d2691d67112182b7a2df
31 Source1:        %{name}.conf
32 Source2:        %{name}-multilib.conf
33 Source3:        %{name}-ti.conf
34 Source4:        %{name}-multilib-ti.conf
35 Source5:        %{name}-aliases.conf
36 Source6:        %{name}.desktop
37 Source7:        %{name}.png
38 Source8:        %{name}-debuginfo.conf
39 Source9:        %{name}-aidath.conf
40 Source10:       %{name}-multilib-aidath.conf
41 Patch0:         %{name}-vserver-packages.patch
42 Patch1:         %{name}-config.patch
43 Patch2:         %{name}-size-type.patch
44 URL:            http://poldek.pld-linux.org/
45 BuildRequires:  autoconf
46 BuildRequires:  automake
47 BuildRequires:  bzip2-devel
48 BuildRequires:  check-devel
49 BuildRequires:  db-devel >= %{ver_db}-%{ver_db_rel}
50 BuildRequires:  gettext-devel
51 BuildRequires:  libtool
52 BuildRequires:  libxml2-devel
53 BuildRequires:  openssl-devel >= 0.9.7d
54 BuildRequires:  pcre-devel
55 BuildRequires:  pkgconfig
56 BuildRequires:  popt-devel
57 %{?with_python:BuildRequires:   python-devel}
58 BuildRequires:  readline-devel >= 5.0
59 BuildRequires:  rpm-devel >= %{ver_rpm}
60 %{?with_python:BuildRequires:   rpm-pythonprov}
61 BuildRequires:  zlib-devel
62 %if %{with static}
63 BuildRequires:  bzip2-static
64 BuildRequires:  db-static >= %{ver_db}-%{ver_db_rel}
65 BuildRequires:  glibc-static
66 BuildRequires:  libselinux-static
67 BuildRequires:  libxml2-static
68 BuildRequires:  ncurses-static
69 BuildRequires:  openssl-static
70 BuildRequires:  pcre-static
71 BuildRequires:  popt-static
72 BuildRequires:  readline-static
73 BuildRequires:  rpm-static
74 BuildRequires:  zlib-static
75 %endif
76 Requires(triggerpostun):        awk
77 Requires(triggerpostun):        sed >= 4.0
78 Requires:       %{name}-libs = %{version}-%{release}
79 Requires:       db >= %{ver_db}-%{ver_db_rel}
80 Requires:       rpm >= %{ver_rpm}
81 Requires:       rpm-db-ver = %{ver_db}
82 Requires:       rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
83 # vf* scripts use sed
84 Requires:       sed
85 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
86
87 %description
88 poldek is an RPM package management tool which allows you to easily
89 perform package verification, installation (including system
90 installation from scratch), upgrading, and removal.
91
92 Program can be used in batch (like apt-get from Debian's APT) or
93 interactive mode. The interactive mode puts you into a readline
94 interface with command line autocompletion and history, similar to the
95 shell mode of Perl's CPAN.
96
97 %{?with_static:This version is statically linked.}
98
99 %{!?with_imode:This version hasn't got interactive mode.}
100 #'vim
101
102 %description -l pl.UTF-8
103 poldek jest narzędziem linii poleceń służącym do weryfikacji,
104 instalacji (włączając instalację systemu od zera), aktualizacji i
105 usuwania pakietów.
106
107 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
108 interaktywnym. Tryb interaktywny posiada interfejs readline z
109 dopełnianiem komend i historią, podobny do trybu shell perlowego
110 modułu CPAN.
111
112 %{?with_static:Ta wersja jest konsolidowana statycznie.}
113
114 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
115
116 %package libs
117 Summary:        poldek libraries
118 Summary(pl.UTF-8):      Biblioteki poldka
119 Group:          Libraries
120
121 %description libs
122 poldek libraries.
123
124 %description libs -l pl.UTF-8
125 Biblioteki poldka.
126
127 %package devel
128 Summary:        Header files for poldek libraries
129 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek poldka
130 Group:          Development/Libraries
131 Requires:       %{name}-libs = %{version}-%{release}
132 Requires:       rpm-devel >= %{ver_rpm}
133
134 %description devel
135 Header files for poldek libraries.
136
137 %description devel -l pl.UTF-8
138 Pliki nagłówkowe bibliotek poldka.
139
140 %package static
141 Summary:        poldek static libraries
142 Summary(pl.UTF-8):      Biblioteki statyczne poldka
143 Group:          Development/Libraries
144 Requires:       %{name}-devel = %{version}-%{release}
145
146 %description static
147 poldek static libraries.
148
149 %description static -l pl.UTF-8
150 Biblioteki statyczne poldka.
151
152 %package -n python-poldek
153 Summary:        Python modules for poldek
154 Summary(pl.UTF-8):      Moduły języka Python dla poldka
155 Group:          Libraries/Python
156 Requires:       %{name}-libs = %{version}-%{release}
157 %pyrequires_eq  python-libs
158
159 %description -n python-poldek
160 Python modules for poldek.
161
162 %description -n python-poldek -l pl.UTF-8
163 Moduły języka Python dla poldka.
164
165 %prep
166 %setup -q
167 %patch0 -p1
168 %patch1 -p1
169 %patch2 -p1
170
171 # cleanup backups after patching
172 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
173
174 %build
175 %{__libtoolize}
176 %{__autoheader}
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 #       --enable-trace
190
191 %install
192 rm -rf $RPM_BUILD_ROOT
193 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
194
195 %{__make} install \
196         DESTDIR=$RPM_BUILD_ROOT
197
198 %if %{with python}
199 %{__make} -C python install \
200         DESTDIR=$RPM_BUILD_ROOT \
201         libdir=%{py_sitedir}
202 %endif
203
204 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
205
206 %ifarch i486 i686 ppc sparc alpha athlon
207 %define         _ftp_arch       %{_target_cpu}
208 %endif
209 %ifarch %{x8664}
210 %define         _ftp_arch       x86_64
211 %define         _ftp_alt_arch   i686
212 %endif
213 %ifarch i586
214 %if "%{pld_release}" == "ti"
215 %define         _ftp_arch       i586
216 %else
217 %define         _ftp_arch       i486
218 %endif
219 %endif
220 %ifarch pentium2 pentium3 pentium4
221 %define         _ftp_arch       i686
222 %endif
223 %ifarch sparcv9 sparc64
224 %define         _ftp_arch       sparc
225 %if "%{pld_release}" == "th"
226 %define         _ftp_arch       %{_target_cpu}
227 %ifarch sparc64
228 %define         _ftp_alt_arch   sparcv9
229 %endif
230 %endif
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 # pld_release = th
247 %ifarch sparcv9 sparc64
248 sed -e '
249         s|%%ARCH%%|%{_ftp_arch}|g
250 ' < %{SOURCE9} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
251
252 %ifarch sparc64
253 sed '
254         s|%%ARCH%%|%{_ftp_alt_arch}|g
255 ' < %{SOURCE10} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
256 %endif
257
258 %else
259 sed -e '
260         s|%%ARCH%%|%{_ftp_arch}|g
261 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
262 sed -e '
263         s|%%ARCH%%|%{_ftp_arch}|g
264 ' < %{SOURCE8} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf
265
266 %ifarch %{x8664}
267 sed '
268         s|%%ARCH%%|%{_ftp_alt_arch}|g
269 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
270 %endif
271 %endif
272 %endif
273
274 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
275
276 %if %{with imode}
277 # add desktop file and icon
278 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
279 install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
280 install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
281 %endif
282
283 # sources we don't package
284 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
285 # include them in %doc
286 rm -rf configs
287 cp -a conf configs
288 rm -f configs/Makefile*
289
290 %if %{with python}
291 %py_postclean
292 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
293 %endif
294
295 %find_lang %{name}
296
297 %clean
298 rm -rf $RPM_BUILD_ROOT
299
300 %post
301 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
302 if [ "$1" = "1" ]; then
303         # remove ignore = vserver-packages inside vserver on first install
304         {
305                 while read f ctx; do
306                         [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
307                 done </proc/self/status
308         } 2>/dev/null
309         if [ -z "$ctx" -o "$ctx" = "0" ]; then
310                 VSERVER=no
311         else
312                 VSERVER=yes
313         fi
314         if [ "$VSERVER" = "yes" ]; then
315                 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
316         fi
317 fi
318
319 %postun -p      /sbin/postshell
320 -/usr/sbin/fix-info-dir -c %{_infodir}
321
322 %post   libs -p /sbin/ldconfig
323 %postun libs -p /sbin/ldconfig
324
325 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
326 if [ -f /etc/poldek.conf.rpmsave ]; then
327         awk '/^source/ {
328         name = $3;
329         path = $4;
330         auto = "yes";
331         autoup = "yes";
332         type = "pdir";
333         pri = "";
334
335         if (sub(",noauto", "", name)) {
336                 auto = "no";
337         }
338
339         # process pri=\d+
340         if (match(name, /,pri=[0-9]+/)) {
341                 pri = substr(name, RSTART + 5, RLENGTH - 5);
342                 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
343         }
344
345         # skip ac sources. already in new config.
346         if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
347                 print "";
348                 print "[source]";
349                 print "name = " name;
350                 print "type = " type;
351                 print "path = " path;
352                 print "auto = " auto;
353                 print "autoup = " autoup;
354                 if (pri) {
355                         print "pri = " pri;
356                 }
357         }
358
359         }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
360         echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
361
362         # copy hold=
363         hold=$(grep ^hold /etc/poldek.conf.rpmsave)
364         if [ "$hold" ]; then
365                 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
366         fi
367 fi
368
369 %triggerpostun -- poldek < 0.30-0.20080225.00.1
370 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
371         %{__sed} -i -e '/^%%include source.conf/{
372                 a
373                 a# /etc/poldek/repos.d/*.conf
374                 a%%includedir repos.d
375         }' %{_sysconfdir}/%{name}/poldek.conf
376 fi
377
378 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
379 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
380
381 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
382         cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
383         cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
384 fi
385
386 %ifarch %{x8664}
387 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
388         cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
389         cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
390 fi
391 %endif
392
393 %files -f %{name}.lang
394 %defattr(644,root,root,755)
395 %doc ChangeLog README* NEWS TODO configs
396 %dir %{_sysconfdir}/%{name}
397 %dir %{_sysconfdir}/%{name}/repos.d
398 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
399 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
400 %attr(755,root,root) %{_bindir}/*
401 %dir %{_libdir}/%{name}
402 %attr(755,root,root) %{_libdir}/%{name}/*
403 %{_mandir}/man1/%{name}*
404 %lang(pl) %{_mandir}/pl/man1/%{name}*
405 %{_infodir}/poldek.info*
406 %if %{with imode}
407 %{_desktopdir}/%{name}.desktop
408 %{_pixmapsdir}/%{name}.png
409 %endif
410
411 %if %{without static}
412 %files libs
413 %defattr(644,root,root,755)
414 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
415 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
416 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
417 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
418 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
419 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
420 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
421 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
422 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
423 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
424 %endif
425
426 %files devel
427 %defattr(644,root,root,755)
428 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
429 %{_libdir}/lib*.la
430 %{_includedir}/*
431
432 %files static
433 %defattr(644,root,root,755)
434 %{_libdir}/lib*.a
435
436 %if %{with python}
437 %files -n python-poldek
438 %defattr(644,root,root,755)
439 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
440 %{py_sitescriptdir}/poldek.py[co]
441 %{py_sitescriptdir}/poldekmod.py[co]
442 %endif
This page took 0.168403 seconds and 4 git commands to generate.