]> git.pld-linux.org Git - packages/poldek.git/blob - poldek.spec
This commit was manufactured by cvs2git to create tag 'auto-ac-poldek-
[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             13
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.19.0-1.20050613.22.0
265 if [ -f /etc/poldek.conf.rpmsave ]; then
266         awk '/^source/ {
267         name = $3;
268         path = $4;
269         auto = "yes";
270         autoup = "yes";
271         type = "pdir";
272         pri = "";
273
274         if (sub(",noauto", "", name)) {
275                 auto = "no";
276         }
277
278         # process pri=\d+
279         if (match(name, /,pri=[0-9]+/)) {
280                 pri = substr(name, RSTART + 5, RLENGTH - 5);
281                 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
282         }
283
284         # skip ac sources. already in new config.
285         if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
286                 print "";
287                 print "[source]";
288                 print "name = " name;
289                 print "type = " type;
290                 print "path = " path;
291                 print "auto = " auto;
292                 print "autoup = " autoup;
293                 if (pri) {
294                         print "pri = " pri;
295                 }
296         }
297
298         }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
299         echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
300
301         # copy hold=
302         hold=$(grep ^hold /etc/poldek.conf.rpmsave)
303         if [ "$hold" ]; then
304                 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
305         fi
306 fi
307
308 %files -f %{name}.lang
309 %defattr(644,root,root,755)
310 %doc README* NEWS TODO configs/
311 %dir %{_sysconfdir}/%{name}
312 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
313 %attr(755,root,root) %{_bindir}/*
314 %dir %{_libdir}/%{name}
315 %attr(755,root,root) %{_libdir}/%{name}/*
316 %{_mandir}/man1/%{name}*
317 %lang(pl) %{_mandir}/pl/man1/%{name}*
318 %{_infodir}/poldek.info*
319
320 %if !%{with static}
321 %files libs
322 %defattr(644,root,root,755)
323 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
324 %endif
325
326 %files devel
327 %defattr(644,root,root,755)
328 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
329 %{_libdir}/lib*.la
330 %{_includedir}/*
331
332 %files static
333 %defattr(644,root,root,755)
334 %{_libdir}/lib*.a
335
336 %if %{with python}
337 %files -n python-poldek
338 %defattr(644,root,root,755)
339 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
340 %{py_sitescriptdir}/poldek.py[co]
341 %{py_sitescriptdir}/poldekmod.py[co]
342 %endif
This page took 0.069631 seconds and 3 git commands to generate.