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