]> git.pld-linux.org Git - packages/poldek.git/blob - poldek.spec
57d6266a3b06dca441727554fb34267001ec80e8
[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.9-31
9 %define snap    20070703.00
10 %define rel             17
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 Source4:        %{name}.desktop
24 Source5:        %{name}.png
25 Patch0:         %{name}-dirdeps.patch
26 Patch1:         %{name}-vserver-packages.patch
27 Patch2:         %{name}-config.patch
28 Patch3:         %{name}-multilib.patch
29 Patch4:         %{name}-ndie_fix.patch
30 Patch5:         %{name}-uri-escape-fix.patch
31 Patch6:         %{name}-install-dist.patch
32 Patch7:         %{name}-nohold-fix.patch
33 Patch8:         %{name}-dir-dot.patch
34 Patch9:         %{name}-suggests-one-package.patch
35 Patch10:        %{name}-reversed-prompt.patch
36 Patch11:        %{name}-abort-on-upgrade.patch
37 Patch12:        %{name}-nonoorder.patch
38 Patch13:        %{name}-bug-79.patch
39 URL:            http://poldek.pld-linux.org/
40 BuildRequires:  autoconf
41 BuildRequires:  automake
42 BuildRequires:  bzip2-devel
43 BuildRequires:  check
44 BuildRequires:  db-devel >= %{ver_db}
45 BuildRequires:  gettext-autopoint
46 BuildRequires:  libtool
47 BuildRequires:  libxml2-devel
48 BuildRequires:  openssl-devel >= 0.9.7d
49 BuildRequires:  pcre-devel
50 BuildRequires:  perl-tools-pod
51 BuildRequires:  pkgconfig
52 BuildRequires:  popt-devel
53 %{?with_python:BuildRequires:   python-devel}
54 BuildRequires:  readline-devel >= 5.0
55 BuildRequires:  rpm-devel >= %{ver_rpm}
56 %{?with_python:BuildRequires:   rpm-pythonprov}
57 BuildRequires:  sed >= 4.0
58 BuildRequires:  xmlto
59 BuildRequires:  zlib-devel
60 %if %{with static}
61 BuildRequires:  bzip2-static
62 BuildRequires:  db-static >= %{ver_db}
63 BuildRequires:  glibc-static
64 BuildRequires:  libselinux-static
65 BuildRequires:  libxml2-static
66 BuildRequires:  ncurses-static
67 BuildRequires:  openssl-static
68 BuildRequires:  pcre-static
69 BuildRequires:  popt-static
70 BuildRequires:  readline-static
71 BuildRequires:  rpm-static
72 BuildRequires:  zlib-static
73 %endif
74 Requires(triggerpostun):        awk
75 Requires(triggerpostun):        sed >= 4.0
76 Requires:       %{name}-libs = %{version}-%{release}
77 Requires:       db >= %{ver_db}
78 Requires:       openssl >= 0.9.7d
79 Requires:       rpm >= %{ver_rpm}
80 Requires:       rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
81 # vf* scripts use sed
82 Requires:       sed
83 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
84
85 %description
86 poldek is an RPM package management tool which allows you to easily
87 perform package verification, installation (including system
88 installation from scratch), upgrading, and removal.
89
90 Program can be used in batch (like apt-get from Debian's APT) or
91 interactive mode. The interactive mode puts you into a readline
92 interface with command line autocompletion and history, similar to the
93 shell mode of Perl's CPAN.
94
95 %{?with_static:This version is statically linked.}
96
97 %{!?with_imode:This version hasn't got interactive mode.}
98 #'vim
99
100 %description -l pl.UTF-8
101 poldek jest narzędziem linii poleceń służącym do weryfikacji,
102 instalacji (włączając instalację systemu od zera), aktualizacji i
103 usuwania pakietów.
104
105 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
106 interaktywnym. Tryb interaktywny posiada interfejs readline z
107 dopełnianiem komend i historią, podobny do trybu shell perlowego
108 modułu CPAN.
109
110 %{?with_static:Ta wersja jest konsolidowana statycznie.}
111
112 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
113
114 %package libs
115 Summary:        poldek libraries
116 Summary(pl.UTF-8):      Biblioteki poldka
117 Group:          Libraries
118
119 %description libs
120 poldek libraries.
121
122 %description libs -l pl.UTF-8
123 Biblioteki poldka.
124
125 %package devel
126 Summary:        Header files for poldek libraries
127 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek poldka
128 Group:          Development/Libraries
129 Requires:       %{name}-libs = %{version}-%{release}
130
131 %description devel
132 Header files for poldek libraries.
133
134 %description devel -l pl.UTF-8
135 Pliki nagłówkowe bibliotek poldka.
136
137 %package static
138 Summary:        poldek static libraries
139 Summary(pl.UTF-8):      Biblioteki statyczne poldka
140 Group:          Development/Libraries
141 Requires:       %{name}-devel = %{version}-%{release}
142
143 %description static
144 poldek static libraries.
145
146 %description static -l pl.UTF-8
147 Biblioteki statyczne poldka.
148
149 %package -n python-poldek
150 Summary:        Python modules for poldek
151 Summary(pl.UTF-8):      Moduły języka Python dla poldka
152 Group:          Libraries/Python
153 Requires:       %{name}-libs = %{version}-%{release}
154 %pyrequires_eq  python-libs
155
156 %description -n python-poldek
157 Python modules for poldek.
158
159 %description -n python-poldek -l pl.UTF-8
160 Moduły języka Python dla poldka.
161
162 %prep
163 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
164 %patch0 -p1
165 %patch1 -p1
166 %patch2 -p1
167 %ifarch %{x8664}
168 %patch3 -p1
169 %endif
170 %patch4 -p0
171 %patch5 -p0
172 %patch6 -p1
173 %patch7 -p1
174 %patch8 -p1
175 %patch9 -p1
176 %patch10 -p1
177 %patch11 -p1
178 %patch12 -p1
179 %patch13 -p0
180
181 # cleanup backups after patching
182 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
183
184 %build
185 %{__autopoint}
186 %{__aclocal} -I m4
187 %{__autoconf}
188 %{__automake}
189 cp -f config.sub trurlib
190
191 %configure \
192         %{?with_static:--enable-static --disable-shared} \
193         %{!?with_imode:--disable-imode} \
194         --enable-nls \
195         %{?with_python:--with-python}
196 %{__make}
197
198 %install
199 rm -rf $RPM_BUILD_ROOT
200 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
201
202 %{__make} install \
203         DESTDIR=$RPM_BUILD_ROOT
204
205 %if %{with python}
206 %{__make} -C python install \
207         DESTDIR=$RPM_BUILD_ROOT \
208         libdir=%{py_sitedir}
209 %endif
210
211 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
212
213 %ifarch i386 i586 i686 ppc sparc alpha athlon
214 %define         _ftp_arch       %{_target_cpu}
215 %endif
216 %ifarch %{x8664}
217 %define         _ftp_arch       amd64
218 %define         _ftp_alt_arch   i686
219 %endif
220 %ifarch i486
221 %define         _ftp_arch       i386
222 %endif
223 %ifarch pentium2 pentium3 pentium4
224 %define         _ftp_arch       i686
225 %endif
226 %ifarch sparcv9 sparc64
227 %define         _ftp_arch       sparc
228 %endif
229
230 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
231
232 sed -e '
233         s|%%ARCH%%|%{_ftp_arch}|g
234 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
235
236 %ifarch %{x8664}
237 sed '
238         s|%%ARCH%%|%{_ftp_alt_arch}|g
239 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
240 %endif
241
242 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
243
244 %if %{with imode}
245 # add desktop file and icon
246 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
247 install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
248 install %{SOURCE5} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
249 %endif
250
251 # get rid of non-pld sources
252 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
253 # include them in %doc
254 rm -rf configs
255 cp -a conf configs
256 rm -f configs/Makefile*
257
258 %if %{with python}
259 %py_postclean
260 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
261 %endif
262
263 %find_lang %{name}
264
265 %clean
266 rm -rf $RPM_BUILD_ROOT
267
268 %post   -p      /sbin/postshell
269 -/usr/sbin/fix-info-dir -c %{_infodir}
270
271 %postun -p      /sbin/postshell
272 -/usr/sbin/fix-info-dir -c %{_infodir}
273
274 %post   libs -p /sbin/ldconfig
275 %postun libs -p /sbin/ldconfig
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 %triggerpostun -- poldek < 0.21-0.20070703.00.15.7
322 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
323         %{__sed} -i -e '/^%%include %%{_distro}-source.conf/{
324                 a
325                 a# /etc/poldek/repos.d/*.conf
326                 a%%includedir repos.d
327         }' %{_sysconfdir}/%{name}/poldek.conf
328 fi
329
330 %files -f %{name}.lang
331 %defattr(644,root,root,755)
332 %doc README* NEWS TODO configs/
333 %dir %{_sysconfdir}/%{name}
334 %dir %{_sysconfdir}/%{name}/repos.d
335 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
336 %attr(755,root,root) %{_bindir}/*
337 %dir %{_libdir}/%{name}
338 %attr(755,root,root) %{_libdir}/%{name}/*
339 %{_mandir}/man1/%{name}*
340 %lang(pl) %{_mandir}/pl/man1/%{name}*
341 %{_infodir}/poldek.info*
342 %if %{with imode}
343 %{_desktopdir}/%{name}.desktop
344 %{_pixmapsdir}/%{name}.png
345 %endif
346
347 %if !%{with static}
348 %files libs
349 %defattr(644,root,root,755)
350 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
351 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
352 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
353 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
354 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
355 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
356 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
357 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
358 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
359 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
360 %endif
361
362 %files devel
363 %defattr(644,root,root,755)
364 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
365 %{_libdir}/lib*.la
366 %{_includedir}/*
367
368 %files static
369 %defattr(644,root,root,755)
370 %{_libdir}/lib*.a
371
372 %if %{with python}
373 %files -n python-poldek
374 %defattr(644,root,root,755)
375 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
376 %{py_sitescriptdir}/poldek.py[co]
377 %{py_sitescriptdir}/poldekmod.py[co]
378 %endif
This page took 0.051973 seconds and 2 git commands to generate.