]> git.pld-linux.org Git - packages/poldek.git/blob - poldek.spec
d8a1b9ae4bb1996276f2fff83bc0cc48212cd894
[packages/poldek.git] / poldek.spec
1 # Conditional build:
2 %bcond_with     static  # don't use shared libraries
3 %bcond_without  imode   # don't build interactive mode
4 %bcond_without  python  # don't build python bindings
5 #
6 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
7 %define ver_db  4.2.50-1
8 %define ver_rpm 4.4.1
9 %define _snap   20070628.00
10 Summary:        RPM packages management helper tool
11 Summary(pl.UTF-8):      Pomocnicze narzędzie do zarządzania pakietami RPM
12 Name:           poldek
13 Version:        0.21
14 Release:        0.%{_snap}.1
15 License:        GPL v2
16 Group:          Applications/System
17 Source0:        http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{_snap}.tar.bz2
18 # Source0-md5:  e8141acb5d1c2dac3282d73770333935
19 Source1:        %{name}.conf
20 Source2:        %{name}-multilib.conf
21 Source3:        %{name}-aliases.conf
22 Patch1:         %{name}-vserver-packages.patch
23 Patch2:         %{name}-config.patch
24 Patch3:         %{name}-multilib.patch
25 Patch4:         %{name}-su-sigsev.patch
26 Patch5:         %{name}-uninstall-depfix.patch
27 URL:            http://poldek.pld-linux.org/
28 BuildRequires:  autoconf
29 BuildRequires:  automake
30 BuildRequires:  bzip2-devel
31 BuildRequires:  check
32 BuildRequires:  db-devel >= %{ver_db}
33 BuildRequires:  gettext-autopoint
34 BuildRequires:  libtool
35 BuildRequires:  libxml2-devel
36 BuildRequires:  openssl-devel >= 0.9.7d
37 BuildRequires:  pcre-devel
38 BuildRequires:  perl-tools-pod
39 BuildRequires:  pkgconfig
40 BuildRequires:  popt-devel
41 %{?with_python:BuildRequires:   python-devel}
42 BuildRequires:  readline-devel >= 5.0
43 BuildRequires:  rpm-devel >= %{ver_rpm}
44 %{?with_python:BuildRequires:   rpm-pythonprov}
45 BuildRequires:  sed >= 4.0
46 BuildRequires:  xmlto
47 BuildRequires:  zlib-devel
48 %if %{with static}
49 BuildRequires:  bzip2-static
50 BuildRequires:  db-static >= %{ver_db}
51 BuildRequires:  glibc-static
52 BuildRequires:  libselinux-static
53 BuildRequires:  libxml2-static
54 BuildRequires:  ncurses-static
55 BuildRequires:  openssl-static
56 BuildRequires:  pcre-static
57 BuildRequires:  popt-static
58 BuildRequires:  readline-static
59 BuildRequires:  rpm-static
60 BuildRequires:  zlib-static
61 %endif
62 Requires(triggerpostun):        awk
63 Requires(triggerpostun):        sed >= 4.0
64 Requires:       %{name}-libs = %{version}-%{release}
65 Requires:       db >= %{ver_db}
66 Requires:       openssl >= 0.9.7d
67 Requires:       rpm >= %{ver_rpm}
68 # vf* scripts use sed
69 Requires:       sed
70 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71
72 %description
73 poldek is an RPM package management tool which allows you to easily
74 perform package verification, installation (including system
75 installation from scratch), upgrading, and removal.
76
77 Program can be used in batch (like apt-get from Debian's APT) or
78 interactive mode. The interactive mode puts you into a readline
79 interface with command line autocompletion and history, similar to the
80 shell mode of Perl's CPAN.
81
82 %{?with_static:This version is statically linked.}
83
84 %{!?with_imode:This version hasn't got interactive mode.}
85 #'vim
86
87 %description -l pl.UTF-8
88 poldek jest narzędziem linii poleceń służącym do weryfikacji,
89 instalacji (włączając instalację systemu od zera), aktualizacji i
90 usuwania pakietów.
91
92 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
93 interaktywnym. Tryb interaktywny posiada interfejs readline z
94 dopełnianiem komend i historią, podobny do trybu shell perlowego
95 modułu CPAN.
96
97 %{?with_static:Ta wersja jest konsolidowana statycznie.}
98
99 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
100
101 %package libs
102 Summary:        poldek libraries
103 Summary(pl.UTF-8):      Biblioteki poldka
104 Group:          Libraries
105
106 %description libs
107 poldek libraries.
108
109 %description libs -l pl.UTF-8
110 Biblioteki poldka.
111
112 %package devel
113 Summary:        Header files for poldek libraries
114 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek poldka
115 Group:          Development/Libraries
116 Requires:       %{name}-libs = %{version}-%{release}
117
118 %description devel
119 Header files for poldek libraries.
120
121 %description devel -l pl.UTF-8
122 Pliki nagłówkowe bibliotek poldka.
123
124 %package static
125 Summary:        poldek static libraries
126 Summary(pl.UTF-8):      Biblioteki statyczne poldka
127 Group:          Development/Libraries
128 Requires:       %{name}-devel = %{version}-%{release}
129
130 %description static
131 poldek static libraries.
132
133 %description static -l pl.UTF-8
134 Biblioteki statyczne poldka.
135
136 %package -n python-poldek
137 Summary:        Python modules for poldek
138 Summary(pl.UTF-8):      Moduły języka Python dla poldka
139 Group:          Libraries/Python
140 Requires:       %{name}-libs = %{version}-%{release}
141 %pyrequires_eq  python-libs
142
143 %description -n python-poldek
144 Python modules for poldek.
145
146 %description -n python-poldek -l pl.UTF-8
147 Moduły języka Python dla poldka.
148
149 %prep
150 %setup -q -n %{name}-%{version}%{?_snap:-cvs%{_snap}}
151 %patch1 -p1
152 %patch2 -p1
153 %ifarch %{x8664}
154 %patch3 -p1
155 %endif
156 %patch4 -p0
157 %patch5 -p0
158
159 # cleanup backups after patching
160 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
161
162 %build
163 %{__autopoint}
164 %{__aclocal} -I m4
165 %{__autoconf}
166 %{__automake}
167 cp -f config.sub trurlib
168
169 %configure \
170         %{?with_static:--enable-static --disable-shared} \
171         %{!?with_imode:--disable-imode} \
172         --enable-nls \
173         %{?with_python:--with-python}
174 %{__make}
175
176 %install
177 rm -rf $RPM_BUILD_ROOT
178 install -d $RPM_BUILD_ROOT%{_sysconfdir}
179
180 %{__make} install \
181         DESTDIR=$RPM_BUILD_ROOT
182
183 %if %{with python}
184 %{__make} -C python install \
185         DESTDIR=$RPM_BUILD_ROOT \
186         libdir=%{py_sitedir}
187 %endif
188
189 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
190
191 %ifarch i386 i586 i686 ppc sparc alpha athlon
192 %define         _ftp_arch       %{_target_cpu}
193 %else
194 %ifarch %{x8664}
195 %define         _ftp_arch       amd64
196 %define         _ftp_alt_arch   i686
197 %else
198 %ifarch i486
199 %define         _ftp_arch       i386
200 %else
201 %ifarch pentium2 pentium3 pentium4
202 %define         _ftp_arch       i686
203 %else
204 %ifarch sparcv9 sparc64
205 %define         _ftp_arch       sparc
206 %endif
207 %endif
208 %endif
209 %endif
210 %endif
211
212 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
213
214 sed -e '
215         s|%%ARCH%%|%{_ftp_arch}|g
216 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
217
218 %ifarch %{x8664}
219 sed '
220         s|%%ARCH%%|%{_ftp_alt_arch}|g
221 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
222 %endif
223
224 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
225
226 # get rid of non-pld sources
227 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
228 # include them in %doc
229 rm -rf configs
230 cp -a conf configs
231 rm -f configs/Makefile*
232
233 %if %{with python}
234 %py_postclean
235 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
236 %endif
237
238 %find_lang %{name}
239
240 %clean
241 rm -rf $RPM_BUILD_ROOT
242
243 %post
244 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
245
246 %postun
247 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
248
249 %post   libs -p /sbin/ldconfig
250 %postun libs -p /sbin/ldconfig
251
252 %triggerpostun -- poldek <= 0.18.3-5
253 if [ -f /etc/poldek.conf ]; then
254         sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
255 fi
256
257 # otherwise don't touch
258 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
259 %triggerpostun -- poldek <= 0.18.7-1
260 if [ -f /etc/poldek.conf ]; then
261         sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
262 fi
263 %endif
264
265 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
266 if [ -f /etc/poldek.conf.rpmsave ]; then
267         awk '/^source/ {
268         name = $3;
269         path = $4;
270         auto = "yes";
271         autoup = "yes";
272         type = "pdir";
273         pri = "";
274
275         if (sub(",noauto", "", name)) {
276                 auto = "no";
277         }
278
279         # process pri=\d+
280         if (match(name, /,pri=[0-9]+/)) {
281                 pri = substr(name, RSTART + 5, RLENGTH - 5);
282                 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
283         }
284
285         # skip ac sources. already in new config.
286         if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
287                 print "";
288                 print "[source]";
289                 print "name = " name;
290                 print "type = " type;
291                 print "path = " path;
292                 print "auto = " auto;
293                 print "autoup = " autoup;
294                 if (pri) {
295                         print "pri = " pri;
296                 }
297         }
298
299         }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
300         echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
301
302         # copy hold=
303         hold=$(grep ^hold /etc/poldek.conf.rpmsave)
304         if [ "$hold" ]; then
305                 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
306         fi
307 fi
308
309 %files -f %{name}.lang
310 %defattr(644,root,root,755)
311 %doc README* NEWS TODO configs/
312 %dir %{_sysconfdir}/%{name}
313 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
314 %attr(755,root,root) %{_bindir}/*
315 %dir %{_libdir}/%{name}
316 %attr(755,root,root) %{_libdir}/%{name}/*
317 %{_mandir}/man1/%{name}*
318 %lang(pl) %{_mandir}/pl/man1/%{name}*
319 %{_infodir}/poldek.info*
320
321 %if !%{with static}
322 %files libs
323 %defattr(644,root,root,755)
324 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
325 %endif
326
327 %files devel
328 %defattr(644,root,root,755)
329 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
330 %{_libdir}/lib*.la
331 %{_includedir}/*
332
333 %files static
334 %defattr(644,root,root,755)
335 %{_libdir}/lib*.a
336
337 %if %{with python}
338 %files -n python-poldek
339 %defattr(644,root,root,755)
340 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
341 %{py_sitescriptdir}/poldek.py[co]
342 %{py_sitescriptdir}/poldekmod.py[co]
343 %endif
This page took 0.060846 seconds and 2 git commands to generate.