]> git.pld-linux.org Git - packages/poldek.git/blob - poldek.spec
- rel .4; fix packages comparsions
[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 #
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.1
9 %define snap    20050921.00
10 Summary:        RPM packages management helper tool
11 Summary(pl):    Pomocnicze narzêdzie do zarz±dzania pakietami RPM
12 Name:           poldek
13 Version:        0.19.0
14 Release:        1.%{snap}.4
15 License:        GPL v2
16 Group:          Applications/System
17 Source0:        http://team.pld.org.pl/~mis/poldek/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
18 # Source0-md5:  50c7135af609a874103a9dacdaf76b2b
19 Source1:        %{name}.conf
20 Source2:        %{name}-multilib.conf
21 Source3:        %{name}-aliases.conf
22 Patch0:         %{name}-prereq.patch
23 Patch1:         %{name}-configure.patch
24 Patch2:         %{name}-nodebug.patch
25 Patch3:         %{name}-compare.patch
26 URL:            http://team.pld.org.pl/~mis/poldek/
27 BuildRequires:  automake
28 BuildRequires:  autoconf
29 BuildRequires:  bzip2-devel
30 BuildRequires:  db-devel >= %{ver_db}
31 BuildRequires:  check
32 BuildRequires:  gettext-autopoint
33 BuildRequires:  home-etc-devel
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 BuildRequires:  readline-devel >= 5.0
41 BuildRequires:  rpm-devel >= %{ver_rpm}
42 BuildRequires:  zlib-devel
43 %if %{with static}
44 BuildRequires:  bzip2-static
45 BuildRequires:  db-static >= %{ver_db}
46 BuildRequires:  glibc-static
47 BuildRequires:  libselinux-static
48 BuildRequires:  ncurses-static
49 BuildRequires:  openssl-static
50 BuildRequires:  pcre-static
51 BuildRequires:  popt-static
52 BuildRequires:  readline-static
53 BuildRequires:  rpm-static
54 BuildRequires:  zlib-static
55 %endif
56 Requires(triggerpostun):        sed >= 4.0
57 Requires(triggerpostun):        awk
58 Requires:       %{name}-libs = %{version}-%{release}
59 Requires:       db >= %{ver_db}
60 Requires:       openssl >= 0.9.7d
61 Requires:       rpm >= %{ver_rpm}
62 Requires:       sed
63 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64
65 %description
66 poldek is an RPM package management tool which allows you to easily
67 perform package verification, installation (including system
68 installation from scratch), upgrading, and removal.
69
70 Program can be used in batch (like apt-get from Debian's APT) or
71 interactive mode. The interactive mode puts you into a readline
72 interface with command line autocompletion and history, similar to the
73 shell mode of Perl's CPAN.
74
75 %{?with_static:This version is statically linked.}
76
77 %{!?with_imode:This version hasn't got interactive mode.}
78
79 #'
80
81 %description -l pl
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):    Biblioteki poldka
98 Group:          Libraries
99
100 %description libs
101 poldek library.
102
103 %description libs -l pl
104 Biblioteki poldka.
105
106 %package devel
107 Summary:        Header files for poldek libraries
108 Summary(pl):    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
116 Pliki nag³ówkowe bibliotek poldka.
117
118 %package static
119 Summary:        poldek static libraries
120 Summary(pl):    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
128 Biblioteki statyczne poldka.
129
130 %prep
131 %setup -q -n %{name}-%{version}-cvs%{snap}
132 %patch0 -p1
133 %patch1 -p1
134 %patch2 -p1
135 %patch3 -p1
136
137 %build
138 %{__autopoint}
139 %{__aclocal} -I m4
140 %{__autoconf}
141 %{__automake}
142 cp -f config.sub trurlib
143 # glibc 2.3.5 workaround (to be removed when new snap come)
144 perl -pi -e 's|HAVE_FOPENCOOKIE|HAVE_FOPENCOOKIE_XXX|g' trurlib/nstream.c
145
146 %configure \
147         %{?with_static:--enable-static} \
148         %{!?with_imode:--disable-imode} \
149         --enable-nls
150 %{__make}
151
152 %install
153 rm -rf $RPM_BUILD_ROOT
154 install -d $RPM_BUILD_ROOT%{_sysconfdir}
155
156 %{__make} install \
157         DESTDIR=$RPM_BUILD_ROOT
158
159 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
160
161 #
162 # CHANGE IT WHEN SWITCHING poldek.conf FROM AC TO TH !!!
163 #
164 %ifarch i386 i586 i686 ppc sparc alpha athlon
165 %define         _ftp_arch       %{_target_cpu}
166 %else
167 %ifarch amd64
168 %define         _ftp_arch       %{_target_cpu}
169 %define         _ftp_alt_arch   i686
170 %else
171 %ifarch i486
172 %define         _ftp_arch       i386
173 %else
174 %ifarch pentium2 pentium3 pentium4
175 %define         _ftp_arch       i686
176 %else
177 %ifarch sparcv9 sparc64
178 %define         _ftp_arch       sparc
179 %endif
180 %endif
181 %endif
182 %endif
183 %endif
184
185 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
186
187 sed -e "s|%%ARCH%%|%{_ftp_arch}|g" \
188 %ifarch amd64
189         -e "s|%%ALT_ARCH%%|%{_ftp_alt_arch}|g" \
190 %else
191         -e '/%%ALT_ARCH%%/d' \
192 %endif
193         < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
194
195 %ifarch amd64
196 sed "s|%%ARCH%%|%{_ftp_alt_arch}|g" < %{SOURCE2} >> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
197 %endif
198
199 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
200
201 # get rid of non-pld sources
202 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
203 # include them in %doc
204 rm -rf configs
205 cp -a conf configs
206 rm -f configs/Makefile*
207
208 %find_lang %{name}
209
210 %clean
211 rm -rf $RPM_BUILD_ROOT
212
213 %post
214 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
215
216 %postun
217 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
218
219 %post   libs -p /sbin/ldconfig
220 %postun libs -p /sbin/ldconfig
221
222 %triggerpostun -- poldek <= 0.18.3-5
223 if [ -f /etc/poldek.conf ]; then
224         sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
225 fi
226
227 # otherwise don't touch
228 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
229 %triggerpostun -- poldek <= 0.18.7-1
230 if [ -f /etc/poldek.conf ]; then
231         sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
232 fi
233 %endif
234
235 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
236 if [ -f /etc/poldek.conf.rpmsave ]; then
237         awk '/^source/ {
238         name = $3;
239         path = $4;
240         auto = "yes";
241         autoup = "yes";
242         type = "pdir";
243
244         if (sub(",noauto", "", name)) {
245                 auto = "no";
246         }
247
248         # skip ac sources. already in new config.
249         if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
250                 print "";
251                 print "[source]";
252                 print "name = " name;
253                 print "type = " type;
254                 print "path = " path;
255                 print "auto = " auto;
256                 print "autoup = " autoup;
257         }
258
259         }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
260         echo "Converted old custom sources (non-ac dist ones) from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
261
262         # propagate use_sudo to new config. only works for untouched poldek.conf and that's intentional.
263         if grep -q '^use_sudo.*=.*yes' /etc/poldek.conf.rpmsave; then
264                 sed -i -e '/^#use sudo = no/s/^.*/use sudo = yes/' /etc/poldek/poldek.conf
265         fi
266
267         # copy hold=
268         hold=$(grep ^hold /etc/poldek.conf.rpmsave)
269         if [ "$hold" ]; then
270                 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
271         fi
272 fi
273
274 %files -f %{name}.lang
275 %defattr(644,root,root,755)
276 %doc README* NEWS TODO configs/
277 %dir %{_sysconfdir}/%{name}
278 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/%{name}/*.conf
279 %attr(755,root,root) %{_bindir}/*
280 %dir %{_libdir}/%{name}
281 %attr(755,root,root) %{_libdir}/%{name}/*
282 %{_mandir}/man1/%{name}*
283 %lang(pl) %{_mandir}/pl/man1/%{name}*
284 %{_infodir}/poldek.info*
285
286 %files libs
287 %defattr(644,root,root,755)
288 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
289
290 %files devel
291 %defattr(644,root,root,755)
292 %attr(755,root,root) %{_libdir}/lib*.so
293 %{_libdir}/lib*.la
294 %{_includedir}/*
295
296 %files static
297 %defattr(644,root,root,755)
298 %{_libdir}/lib*.a
This page took 0.057398 seconds and 4 git commands to generate.