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