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