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