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