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