]> git.pld-linux.org Git - packages/poldek.git/blob - poldek.spec
95bbe00f7b5ee3487d07f09a53422f6fb39f296a
[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    20051007.18
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:  53f5d5748f4653bb533952389486b3db
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:  ncurses-static
45 BuildRequires:  openssl-static
46 BuildRequires:  pcre-static
47 BuildRequires:  popt-static
48 BuildRequires:  readline-static
49 BuildRequires:  rpm-static
50 BuildRequires:  zlib-static
51 %endif
52 Requires(triggerpostun):        sed >= 4.0
53 Requires(triggerpostun):        awk
54 Requires:       %{name}-libs = %{version}-%{release}
55 Requires:       db >= %{ver_db}
56 Requires:       openssl >= 0.9.7d
57 Requires:       rpm >= %{ver_rpm}
58 Requires:       sed
59 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60
61 %description
62 poldek is an RPM package management tool which allows you to easily
63 perform package verification, installation (including system
64 installation from scratch), upgrading, and removal.
65
66 Program can be used in batch (like apt-get from Debian's APT) or
67 interactive mode. The interactive mode puts you into a readline
68 interface with command line autocompletion and history, similar to the
69 shell mode of Perl's CPAN.
70
71 %{?with_static:This version is statically linked.}
72
73 %{!?with_imode:This version hasn't got interactive mode.}
74
75 #'
76
77 %description -l pl
78 poldek jest narzêdziem linii poleceñ s³u¿±cym do weryfikacji,
79 instalacji (w³±czaj±c instalacjê systemu od zera), aktualizacji i
80 usuwania pakietów.
81
82 Program mo¿e byæ u¿ywany w trybie wsadowym (jak debianowy apt-get) lub
83 interaktywnym. Tryb interaktywny posiada interfejs readline z
84 dope³nianiem komend i histori±, podobny do trybu shell perlowego
85 modu³u CPAN.
86
87 %{?with_static:Ta wersja jest konsolidowana statycznie.}
88
89 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
90
91 %package libs
92 Summary:        poldek libraries
93 Summary(pl):    Biblioteki poldka
94 Group:          Libraries
95
96 %description libs
97 poldek library.
98
99 %description libs -l pl
100 Biblioteki poldka.
101
102 %package devel
103 Summary:        Header files for poldek libraries
104 Summary(pl):    Pliki nag³ówkowe bibliotek poldka
105 Group:          Development/Libraries
106 Requires:       %{name}-libs = %{version}-%{release}
107
108 %description devel
109 Header files for poldek libraries.
110
111 %description devel -l pl
112 Pliki nag³ówkowe bibliotek poldka.
113
114 %package static
115 Summary:        poldek static libraries
116 Summary(pl):    Biblioteki statyczne poldka
117 Group:          Development/Libraries
118 Requires:       %{name}-devel = %{version}-%{release}
119
120 %description static
121 poldek static libraries.
122
123 %description static -l pl
124 Biblioteki statyczne poldka.
125
126 %prep
127 %setup -q -n %{name}-%{version}-cvs%{snap}
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 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
192
193 # get rid of non-pld sources
194 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
195 # include them in %doc
196 rm -rf configs
197 cp -a conf configs
198 rm -f configs/Makefile*
199
200 %find_lang %{name}
201
202 %clean
203 rm -rf $RPM_BUILD_ROOT
204
205 %post
206 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
207
208 %postun
209 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
210
211 %post   libs -p /sbin/ldconfig
212 %postun libs -p /sbin/ldconfig
213
214 %triggerpostun -- poldek <= 0.18.3-5
215 if [ -f /etc/poldek.conf ]; then
216         sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
217 fi
218
219 # otherwise don't touch
220 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
221 %triggerpostun -- poldek <= 0.18.7-1
222 if [ -f /etc/poldek.conf ]; then
223         sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
224 fi
225 %endif
226
227 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
228 if [ -f /etc/poldek.conf.rpmsave ]; then
229         awk '/^source/ {
230         name = $3;
231         path = $4;
232         auto = "yes";
233         autoup = "yes";
234         type = "pdir";
235
236         if (sub(",noauto", "", name)) {
237                 auto = "no";
238         }
239
240         # skip ac sources. already in new config.
241         if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
242                 print "";
243                 print "[source]";
244                 print "name = " name;
245                 print "type = " type;
246                 print "path = " path;
247                 print "auto = " auto;
248                 print "autoup = " autoup;
249         }
250
251         }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
252         echo "Converted old custom sources (non-ac dist ones) from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
253
254         # propagate use_sudo to new config. only works for untouched poldek.conf and that's intentional.
255         if grep -q '^use_sudo.*=.*yes' /etc/poldek.conf.rpmsave; then
256                 sed -i -e '/^#use sudo = no/s/^.*/use sudo = yes/' /etc/poldek/poldek.conf
257         fi
258
259         # copy hold=
260         hold=$(grep ^hold /etc/poldek.conf.rpmsave)
261         if [ "$hold" ]; then
262                 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
263         fi
264 fi
265
266 %files -f %{name}.lang
267 %defattr(644,root,root,755)
268 %doc README* NEWS TODO configs/
269 %dir %{_sysconfdir}/%{name}
270 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/%{name}/*.conf
271 %attr(755,root,root) %{_bindir}/*
272 %dir %{_libdir}/%{name}
273 %attr(755,root,root) %{_libdir}/%{name}/*
274 %{_mandir}/man1/%{name}*
275 %lang(pl) %{_mandir}/pl/man1/%{name}*
276 %{_infodir}/poldek.info*
277
278 %files libs
279 %defattr(644,root,root,755)
280 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
281
282 %files devel
283 %defattr(644,root,root,755)
284 %attr(755,root,root) %{_libdir}/lib*.so
285 %{_libdir}/lib*.la
286 %{_includedir}/*
287
288 %files static
289 %defattr(644,root,root,755)
290 %{_libdir}/lib*.a
This page took 0.037096 seconds and 2 git commands to generate.