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