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