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