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