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