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