1 |
#Mageia version adapted from Caixa Magica's apt package |
2 |
|
3 |
%define name apt |
4 |
%define version 0.5.15lorg3.94 |
5 |
%define versionadd pt |
6 |
%define release %mkrel 9 |
7 |
%define subrel 3 |
8 |
%define _lib_name %{name}-pkg |
9 |
%define lib_name_orig lib%{_lib_name} |
10 |
%define major 4 |
11 |
%define libname %mklibname %_lib_name %major |
12 |
%define libnamedevel %mklibname %_lib_name %major -d |
13 |
|
14 |
|
15 |
Name: %{name} |
16 |
Version: %{version} |
17 |
Release: %{release} |
18 |
Summary: Debian's Advanced Packaging Tool with RPM support |
19 |
Group: System/Packaging |
20 |
Url: http://www.apt-rpm.org/ |
21 |
License: GPLv2+ |
22 |
Source0: http://apt-rpm.org/releases/%{name}-%{version}%{versionadd}.tar.bz2 |
23 |
Source1: %{name}-apt.conf |
24 |
Source2: %{name}-sources.list |
25 |
Source3: %{name}-vendors.list |
26 |
Source4: %{name}-rpmpriorities |
27 |
Source5: %{name}-mageia.conf |
28 |
# not used |
29 |
Source8: apt-pbo |
30 |
|
31 |
## from Caixa Magica's apt: |
32 |
# URPM Lists support |
33 |
# DUDF MANCOOSI project support |
34 |
# Rollback, URPM, DUDF and pbo features |
35 |
Patch1: %{name}-git-cm15-05.patch.bz2 |
36 |
|
37 |
# enhance the sorting by taking Obsoletes into account |
38 |
Patch3: apt-0.3.19cnc53-stelian-apt-pkg-algorithms-scores.patch |
39 |
# TODO document this patch |
40 |
Patch8: %{name}-0.5.4cnc9-alt-packagemanager-CheckRConflicts.patch |
41 |
# alternative scoring method ( PreDepends implies -1 instead of +50 ) |
42 |
Patch9: %{name}-0.5.4cnc9-alt-pkgorderlist_score.patch |
43 |
# add # to the list of the forbidden characters in the name of cdrom |
44 |
Patch11: apt-0.5.15lorg3.2-alt-specialchars.patch |
45 |
|
46 |
# s/de_DE/de/ and /it_IT/it/ in po files |
47 |
Patch14: %{name}-invalid-lc-messages-dir.patch |
48 |
|
49 |
# use the moo |
50 |
Patch15: apt-moo.patch |
51 |
|
52 |
# a quick bugfix to make build-dep work |
53 |
Patch18: %{name}-build-dep.patch |
54 |
|
55 |
# (cjw) fix segfault on large transactions by removing call to rpmReadConfigFiles()0 |
56 |
# that isn't needed |
57 |
Patch25: apt-0.5.15lorg3.94pt-drop-unneeded-rpmReadConfigFiles.patch |
58 |
|
59 |
# (cjw) from git: fix build with rpm 4.9 |
60 |
Patch26: apt.git-dfcec4ea45210b5d83ab65ecadb35001c7d39913.patch |
61 |
Patch27: apt.git-3b4e4dcf7a86f96da1124c6913ff7e66e4f1ccff.patch |
62 |
# (cjw) caixa magica rpm 4.9 fixes |
63 |
Patch28: apt-cm-rpm4.9.patch |
64 |
# (cjw) _dbapi macro disappeared, so drop the rpm backwards compatibility code using it |
65 |
Patch29: apt-0.5.15lorg3.94pt-rpm4.9-dbapi.patch |
66 |
# (cjw) fix build with glibc 2.16 |
67 |
Patch30: apt-0.5.15-glibc-2.16.patch |
68 |
# (cjw) fix for ABI breakage hacked into RPM for /usr move |
69 |
Patch31: apt-0.5.15lorg3.94pt-ignore-usrmove_hack_in_rpm.patch |
70 |
# (cjw) synthesis may have requires names that contain '[' |
71 |
Patch35: apt-0.5.15lorg3.94pt-brackets.patch |
72 |
# (cjw) one line in synthesis can be 78000 chars, overflowing 16-bit offsets |
73 |
Patch36: apt-0.5.15lorg3.94pt-synthesis-section-offset-overflow.patch |
74 |
# (cjw) fix potential buffer overflow caused by use of a fixed string buffer + strcat |
75 |
Patch37: apt-0.5.15lorg3.94pt-CVE-2014-6273.patch |
76 |
# (cjw) synthesis.hdlist.cz is now xz compressed |
77 |
Patch38: apt-0.5.15lorg3.94pt-synthesis-xz.patch |
78 |
|
79 |
Requires: gnupg |
80 |
Requires: gzip |
81 |
Requires: %{name}-common |
82 |
BuildRequires: gettext-devel |
83 |
BuildRequires: ncurses-devel |
84 |
BuildRequires: readline-devel |
85 |
BuildRequires: rpm-devel >= 4.6 |
86 |
# BuildRequires: python-devel |
87 |
BuildRequires: libpopt-devel |
88 |
BuildRequires: libxml2-devel |
89 |
BuildRequires: sqlite3-devel |
90 |
BuildRequires: lua5.1-devel |
91 |
BuildRequires: perl |
92 |
BuildRequires: jsoncpp-devel >= 0.5.0 |
93 |
Epoch: 1 |
94 |
|
95 |
%description |
96 |
A port of Debian's apt tools for RPM based distributions. |
97 |
Original RPM port done by and for Conectiva. It provides |
98 |
the apt-get utility that provides a simple way to install |
99 |
and upgrade packages. APT features complete installation |
100 |
ordering, multiple source capability and several other |
101 |
unique features. |
102 |
|
103 |
%package -n %{libname} |
104 |
Summary: Libraries for %{name} |
105 |
Group: System/Libraries |
106 |
Provides: %{lib_name_orig} = %{epoch}:%{version}-%{release} |
107 |
Requires: %name-common |
108 |
#For uuidgen |
109 |
Requires: e2fsprogs |
110 |
|
111 |
%description -n %{libname} |
112 |
This package contains APT's libapt-pkg package manipulation library |
113 |
modified for RPM. |
114 |
|
115 |
%package -n %{libnamedevel} |
116 |
Summary: Development files for %{name} |
117 |
Group: Development/C |
118 |
Requires: %{libname} = %{epoch}:%{version}-%{release} |
119 |
Provides: %{lib_name_orig}-devel |
120 |
# only header files in this package... |
121 |
Requires: jsoncpp-devel |
122 |
|
123 |
%description -n %{libnamedevel} |
124 |
This package contains the header files and static libraries for |
125 |
developing with APT's libapt-pkg package manipulation library, |
126 |
modified for RPM. |
127 |
|
128 |
%package pbo |
129 |
Summary: Alternate dependency solver for apt. |
130 |
Group: System/Packaging |
131 |
BuildArch: noarch |
132 |
Requires: %{name}-common |
133 |
Requires: perl |
134 |
Requires: minisat+ |
135 |
Requires: perl-libapt-pkg |
136 |
%description pbo |
137 |
Alternate dependency solver for the apt package manager. |
138 |
Currently in testing. |
139 |
|
140 |
%package common |
141 |
Summary: Common file for %{name} frontend |
142 |
Group: System/Packaging |
143 |
%description common |
144 |
This package contains the needed files for various apt-frontend, |
145 |
such as synaptic, aptitude. |
146 |
|
147 |
%prep |
148 |
%setup -q -n %{name}-%{version}%{versionadd} |
149 |
%patch1 -p1 |
150 |
%patch3 -p1 -b .scores |
151 |
%patch8 -p1 -b .checkrconflicts |
152 |
%patch9 -p1 -b .predepends-scores |
153 |
%patch11 -p1 -b .specialchars |
154 |
%patch14 -p1 |
155 |
%patch15 -p1 -b .moo |
156 |
%patch18 -p1 -b .build-dep-fix |
157 |
%patch26 -p1 -b .headerUnlink |
158 |
%patch27 -p1 -b .fdLink+fdFree |
159 |
%patch28 -p1 -b .cm-rpm4.9 |
160 |
%patch29 -p1 -b .dbapi |
161 |
%patch25 -p1 -b .segfault |
162 |
%patch30 -p1 -b .glibc2_16 |
163 |
%patch31 -p1 -b .usrmove_broken_rpm |
164 |
%patch35 -p1 -b .brackets |
165 |
%patch36 -p1 -b .overflow |
166 |
%patch37 -p1 -b .cve-2014-6273 |
167 |
%patch38 -p1 -b .xz |
168 |
|
169 |
cat %{SOURCE1} > apt.conf |
170 |
sed 's/%%ARCH%%/%{_target_cpu}/' %{SOURCE2} > sources.list |
171 |
cat %{SOURCE3} > vendors.list |
172 |
cat %{SOURCE4} > rpmpriorities |
173 |
cat %{SOURCE5} > mageia.conf |
174 |
|
175 |
%build |
176 |
rm -f configure |
177 |
libtoolize --copy --force --install |
178 |
aclocal -I m4 |
179 |
automake -a -c |
180 |
autoconf |
181 |
%configure2_5x |
182 |
|
183 |
# This next line is necessary because of the invalid-lc-messages-dir patch |
184 |
(cd po; cp -f de_DE.po de.po; cp -f it_IT.po it.po) |
185 |
|
186 |
|
187 |
# Parallel make is taken account in the configure script |
188 |
%make NOISY=1 |
189 |
|
190 |
#( cd python; %make ) |
191 |
|
192 |
%install |
193 |
cat <<EOF >README.Mageia |
194 |
This version uses the synthesis form of the hdlist which is specified as a urpm |
195 |
source. The "rpm" source represents a debian-style pkglist, so full hdlists |
196 |
cannot be used anymore. |
197 |
|
198 |
EOF |
199 |
|
200 |
rm -rf $RPM_BUILD_ROOT |
201 |
%makeinstall |
202 |
rm -rf $RPM_BUILD_ROOT%{_bindir}/apt-pbo |
203 |
|
204 |
install -d -m 755 $RPM_BUILD_ROOT/var/cache/%{name}/archives/partial |
205 |
install -d -m 755 $RPM_BUILD_ROOT/var/lib/%{name}/lists/partial |
206 |
|
207 |
install -d -m 755 $RPM_BUILD_ROOT%{_includedir}/apt-pkg |
208 |
mv $RPM_BUILD_ROOT%{_includedir}/*.h $RPM_BUILD_ROOT%{_includedir}/apt-pkg |
209 |
|
210 |
install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/apt |
211 |
echo "APT::Install-Suggests \"true\";" > $RPM_BUILD_ROOT%{_sysconfdir}/apt/apt.conf.d/01-suggests.conf |
212 |
install -m 644 apt.conf $RPM_BUILD_ROOT%{_sysconfdir}/apt |
213 |
install -m 644 *.list $RPM_BUILD_ROOT%{_sysconfdir}/apt |
214 |
install -m 644 rpmpriorities $RPM_BUILD_ROOT%{_sysconfdir}/apt |
215 |
|
216 |
install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/apt/apt.conf.d |
217 |
install -m 644 mageia.conf $RPM_BUILD_ROOT%{_sysconfdir}/apt/apt.conf.d |
218 |
|
219 |
install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/apt/translate.list.d |
220 |
|
221 |
install -d -m 755 $RPM_BUILD_ROOT%{_var}/lib/apt/dudf |
222 |
|
223 |
#install -d -m 755 $RPM_BUILD_ROOT%{_sbindir} |
224 |
#install -m 755 %SOURCE8 $RPM_BUILD_ROOT%{_sbindir} |
225 |
|
226 |
install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.d |
227 |
#AG: Script directory, this should really be created by "make install" itself |
228 |
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/apt/scripts |
229 |
|
230 |
%find_lang %{name} |
231 |
%find_lang %{lib_name_orig}-pkg3.3 |
232 |
cat %{lib_name_orig}-pkg3.3.lang >> %{name}.lang |
233 |
rm -f %{lib_name_orig}-pkg3.3.lang |
234 |
|
235 |
|
236 |
%triggerun -- apt < 0.5.4 |
237 |
# Convert options from 0.3.X to 0.5.X |
238 |
CONF=/etc/apt/apt.conf |
239 |
if [ -f $CONF ]; then |
240 |
mv -f $CONF $CONF.rpmold |
241 |
sed -e 's/HoldPkgs/Hold/' \ |
242 |
-e 's/AllowedDupPkgs/Allow-Duplicated/' \ |
243 |
-e 's/IgnorePkgs/Ignore/' \ |
244 |
-e 's/PostInstall/Post-Install/' \ |
245 |
-e 's/.*Methods .*//' \ |
246 |
$CONF.rpmold > $CONF |
247 |
if [ $? -ne 0 ]; then |
248 |
mv -f $CONF.rpmold $CONF |
249 |
echo "warning: couldn't convert old apt options" |
250 |
else |
251 |
echo "warning: original apt.conf saved as apt.conf.rpmold" 2>&1 |
252 |
fi |
253 |
fi |
254 |
|
255 |
%triggerun -- apt > 0.5.4, apt < 0.5.4cnc4-1cl |
256 |
# Fix bug in the trigger of first snapshot versions |
257 |
CONF=/etc/apt/apt.conf |
258 |
if [ -f $CONF ]; then |
259 |
mv $CONF $CONF.rpmtmp.$$ |
260 |
sed -e 's/Holds/Hold/' \ |
261 |
$CONF.rpmtmp.$$ > $CONF |
262 |
if [ $? -ne 0 ]; then |
263 |
mv -f $CONF.rpmtmp.$$ $CONF |
264 |
else |
265 |
rm -f $CONF.rpmtmp.$$ |
266 |
fi |
267 |
fi |
268 |
|
269 |
%clean |
270 |
rm -rf %{buildroot} |
271 |
|
272 |
%files -f %{name}.lang |
273 |
%defattr(-,root,root) |
274 |
%doc COPYING* doc/*.txt doc/examples AUTHORS* README.Mageia |
275 |
%{_bindir}/* |
276 |
%{_mandir}/man5/* |
277 |
%{_mandir}/man8/* |
278 |
|
279 |
#files pbo |
280 |
#{_sbindir}/apt-pbo |
281 |
|
282 |
%files common |
283 |
%{_libdir}/%{name} |
284 |
/var/cache/%{name} |
285 |
/var/lib/%{name} |
286 |
%{_datadir}/%{name} |
287 |
%dir %{_sysconfdir}/%{name} |
288 |
%config(noreplace) %{_sysconfdir}/apt/apt.conf |
289 |
%config(noreplace) %{_sysconfdir}/apt/sources.list |
290 |
%config(noreplace) %{_sysconfdir}/apt/vendors.list |
291 |
%config(noreplace) %{_sysconfdir}/apt/rpmpriorities |
292 |
%dir %{_sysconfdir}/apt/apt.conf.d |
293 |
%config(noreplace) %{_sysconfdir}/apt/apt.conf.d/mageia.conf |
294 |
%config(noreplace) %{_sysconfdir}/apt/apt.conf.d/multilib.conf |
295 |
%config(noreplace) %{_sysconfdir}/apt/apt.conf.d/01-suggests.conf |
296 |
%dir %{_sysconfdir}/apt/translate.list.d |
297 |
|
298 |
%files -n %{libname} |
299 |
%defattr(-,root,root) |
300 |
%{_libdir}/*.so.* |
301 |
|
302 |
%files -n %{libnamedevel} |
303 |
%defattr(-,root,root) |
304 |
%{_includedir}/apt-pkg |
305 |
%{_libdir}/*.so |
306 |
%{_libdir}/*.a |
307 |
%{_libdir}/*.la |
308 |
%{_libdir}/pkgconfig/*.pc |
309 |
|
310 |
|
311 |
|