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