1 |
eulisse |
1.2 |
### RPM external apt 0.5.15lorg3.2
|
2 |
eulisse |
1.7 |
## INITENV SET APT_CONFIG %{i}/etc/apt/apt.conf
|
3 |
|
|
|
4 |
eulisse |
1.2 |
Source: http://apt-rpm.org/releases/%n-%v.tar.bz2
|
5 |
eulisse |
1.5 |
Patch0: apt-rpm449
|
6 |
eulisse |
1.2 |
Requires: libxml2 beecrypt rpm zlib bz2lib
|
7 |
eulisse |
1.5 |
%if "%(echo %{cmsos} | cut -d_ -f 2 | sed -e 's|.*64.*|64|')" == "64"
|
8 |
|
|
%define libdir lib64
|
9 |
|
|
%else
|
10 |
|
|
%define libdir lib
|
11 |
|
|
%endif
|
12 |
ratnik |
1.1 |
|
13 |
eulisse |
1.5 |
%prep
|
14 |
|
|
%setup -n %n-%{realversion}
|
15 |
|
|
%patch0 -p0
|
16 |
ratnik |
1.1 |
%build
|
17 |
eulisse |
1.5 |
export CPPFLAGS="-I$BEECRYPT_ROOT/include -I$RPM_ROOT/include -I$RPM_ROOT/include/rpm"
|
18 |
|
|
export LDFLAGS="-L$BEECRYPT_ROOT/%{libdir} -L$RPM_ROOT/%{libdir}"
|
19 |
eulisse |
1.2 |
export LIBDIR="$LIBS"
|
20 |
|
|
export LIBXML2_CFLAGS="-I$LIBXML2_ROOT/include/libxml2 -I$BEECRYPT_ROOT/include -I$RPM_ROOT/include"
|
21 |
eulisse |
1.5 |
export LIBXML2_LIBS="-lxml2 -L$LIBXML2_ROOT/lib -L$BEECRYPT_ROOT/%{libdir} -L$RPM_ROOT/%{libdir}"
|
22 |
ratnik |
1.1 |
|
23 |
eulisse |
1.2 |
./configure --prefix=%{i} --exec-prefix=%{i} \
|
24 |
|
|
--disable-nls \
|
25 |
|
|
--disable-dependency-tracking \
|
26 |
|
|
--without-libintl-prefix \
|
27 |
|
|
--disable-rpath
|
28 |
eulisse |
1.6 |
make %makeprocesses
|
29 |
eulisse |
1.7 |
|
30 |
|
|
|
31 |
eulisse |
1.6 |
%install
|
32 |
|
|
make install
|
33 |
|
|
mkdir -p %{i}/etc/profile.d
|
34 |
|
|
(echo "#!/bin/sh"; \
|
35 |
|
|
echo "source $RPM_ROOT/etc/profile.d/init.sh"; \
|
36 |
|
|
echo "source $LIBXML2_ROOT/etc/profile.d/init.sh" ) > %{i}/etc/profile.d/dependencies-setup.sh
|
37 |
|
|
(echo "#!/bin/tcsh"; \
|
38 |
|
|
echo "source $RPM_ROOT/etc/profile.d/init.csh"; \
|
39 |
|
|
echo "source $LIBXML2_ROOT/etc/profile.d/init.csh" ) > %{i}/etc/profile.d/dependencies-setup.csh
|
40 |
eulisse |
1.7 |
|
41 |
|
|
mkdir -p %{i}/etc/apt
|
42 |
|
|
cat << \EOF_APT_CONF > %{i}/etc/apt/apt.conf
|
43 |
|
|
Dir "%{instroot}"
|
44 |
|
|
{
|
45 |
|
|
// Location of the state dir
|
46 |
|
|
State "%{cmsplatf}/var/lib/apt/"
|
47 |
|
|
{
|
48 |
|
|
lists "lists/";
|
49 |
|
|
xstatus "xstatus";
|
50 |
|
|
userstatus "status.user";
|
51 |
|
|
status "var/lib/dpkg/status";
|
52 |
|
|
cdroms "cdroms.list";
|
53 |
|
|
};
|
54 |
|
|
|
55 |
|
|
// Location of the cache dir
|
56 |
|
|
Cache "%{cmsplatf}/var/lib/cache" {
|
57 |
|
|
archives "%{cmsplatf}";
|
58 |
|
|
srcpkgcache "srcpkgcache.bin";
|
59 |
|
|
pkgcache "pkgcache.bin";
|
60 |
|
|
};
|
61 |
|
|
|
62 |
|
|
// Locations of binaries
|
63 |
|
|
Bin {
|
64 |
|
|
methods "%{i}%{libdir}/apt/methods/";
|
65 |
|
|
gzip "/bin/gzip";
|
66 |
|
|
dpkg "/usr/bin/dpkg";
|
67 |
|
|
dpkg-source "/usr/bin/dpkg-source";
|
68 |
|
|
dpkg-buildpackage "/usr/bin/dpkg-buildpackage";
|
69 |
|
|
apt-get "%{instroot}/bin/apt-get-wrapper";
|
70 |
|
|
apt-cache "%{instroot}/bin/apt-cache-wrapper";
|
71 |
|
|
rpm "%{instroot}/bin/rpm-wrapper";
|
72 |
|
|
};
|
73 |
|
|
|
74 |
|
|
|
75 |
|
|
// Config files
|
76 |
|
|
Etc "%{cmsplatf}/etc/apt/" {
|
77 |
|
|
sourcelist "sources.list";
|
78 |
|
|
main "apt.conf";
|
79 |
|
|
preferences "preferences";
|
80 |
|
|
};
|
81 |
|
|
};
|
82 |
|
|
|
83 |
|
|
Debug::pkgProblemResolver="1";
|
84 |
|
|
|
85 |
|
|
RPM
|
86 |
|
|
{
|
87 |
|
|
PM "external";
|
88 |
|
|
Options { "--define";"_rpmlock_path %{instroot}/%{cmsplatf}/var/lib/rpm/lock";"--dbpath";"%{instroot}/var/lib/rpm";"--nodeps";};
|
89 |
|
|
Install-Options { "--define";"_rpmlock_path %{instroot}/%{cmsplatf}/var/lib/rpm/lock";"--nodeps";"--force";"--dbpath";"%{instroot}/%{cmsplatf}/var/lib/rpm";"--prefix";"%{instroot}";};
|
90 |
|
|
RootDir "%{instroot}";
|
91 |
|
|
Architecture "%{cmsplatf}";
|
92 |
|
|
};
|
93 |
|
|
EOF_APT_CONF
|
94 |
|
|
|
95 |
eulisse |
1.6 |
%post
|
96 |
eulisse |
1.7 |
mkdir -p %{cmsplatf}/var/lib/apt/lists/partial
|
97 |
|
|
mkdir -p %{cmsplatf}/var/lib/rpm
|
98 |
|
|
mkdir -p %{cmsplatf}/var/lib/cache/%{cmsplatf}/partial
|
99 |
|
|
mkdir -p %{cmsplatf}/etc/apt
|
100 |
|
|
mkdir -p %{cmsplatf}/etc/rpm
|
101 |
|
|
mkdir -p %{cmsplatf}/lib/apt/methods
|
102 |
|
|
mkdir -p %{cmsplatf}/var/lib/dpkg/status
|
103 |
|
|
mkdir -p bin
|
104 |
|
|
mkdir -p %{cmsplatf}/var/lib/cache/%{cmsplatf}
|
105 |
|
|
|
106 |
|
|
cat << \EOF_BIN_APT_CACHE_WRAPPER > bin/apt-cache-wrapper
|
107 |
|
|
#!/bin/sh
|
108 |
|
|
touch %{instroot}/log.txt
|
109 |
|
|
echo $@ >> %{instroot}/log.txt
|
110 |
|
|
apt-cache $@
|
111 |
|
|
EOF_BIN_APT_CACHE_WRAPPER
|
112 |
|
|
chmod +x bin/apt-cache-wrapper
|
113 |
|
|
|
114 |
|
|
cat << \EOF_BIN_APT_GET_WRAPPER > bin/apt-get-wrapper
|
115 |
|
|
#!/bin/sh
|
116 |
|
|
touch %{instroot}/log.txt
|
117 |
|
|
echo $@ >> %{instroot}/log.txt
|
118 |
|
|
apt-get $@
|
119 |
|
|
EOF_BIN_APT_GET_WRAPPER
|
120 |
|
|
chmod +x bin/apt-get-wrapper
|
121 |
|
|
|
122 |
|
|
mkdir -p %{cmsplatf}/etc/apt
|
123 |
|
|
cat << \EOF_RPMPRIORITIES > %{cmsplatf}/etc/apt/rpmpriorities
|
124 |
|
|
Essantial:
|
125 |
|
|
|
126 |
|
|
EOF_RPMPRIORITIES
|
127 |
|
|
|
128 |
|
|
mkdir -p %{cmsplatf}/var/lib/rpm
|
129 |
|
|
|
130 |
eulisse |
1.6 |
%{relocateConfig}etc/profile.d/dependencies-setup.sh
|
131 |
|
|
%{relocateConfig}etc/profile.d/dependencies-setup.csh
|
132 |
eulisse |
1.7 |
perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|" bin/apt-cache-wrapper bin/apt-get-wrapper
|