1 |
< |
### RPM external apt 0.5.15lorg3.2-wt1 |
2 |
< |
## INITENV SET APT_CONFIG %{i}/etc/apt/apt.conf |
1 |
> |
### RPM external apt 0.5.15lorg3.2-CMS3 |
2 |
> |
## INITENV SET APT_CONFIG %{i}/etc/apt.conf |
3 |
|
|
4 |
|
Source: http://apt-rpm.org/releases/%n-%realversion.tar.bz2 |
5 |
|
Source1: bootstrap |
6 |
– |
Patch0: apt-rpm449 |
6 |
|
Requires: libxml2 beecrypt rpm zlib bz2lib openssl |
7 |
+ |
Patch0: apt-rpm449 |
8 |
+ |
Patch1: apt-rpm446 |
9 |
|
%if "%(echo %{cmsos} | cut -d_ -f 2 | sed -e 's|.*64.*|64|')" == "64" |
10 |
|
%define libdir lib64 |
11 |
|
%else |
14 |
|
|
15 |
|
%prep |
16 |
|
%setup -n %n-%{realversion} |
17 |
+ |
case $RPM_VERSION in |
18 |
+ |
4.4.9*) |
19 |
|
%patch0 -p0 |
20 |
+ |
;; |
21 |
+ |
4.4.6*) |
22 |
+ |
%patch1 -p0 |
23 |
+ |
;; |
24 |
+ |
esac |
25 |
|
%build |
26 |
< |
export CPPFLAGS="-I$BEECRYPT_ROOT/include -I$RPM_ROOT/include -I$RPM_ROOT/include/rpm" |
27 |
< |
export LDFLAGS="-L$BEECRYPT_ROOT/%{libdir} -L$RPM_ROOT/%{libdir}" |
26 |
> |
export CFLAGS="-O0 -g" |
27 |
> |
export CXXFLAGS="-O0 -g" |
28 |
> |
export CPPFLAGS="-I$BZ2LIB_ROOT/include -I$BEECRYPT_ROOT/include -I$RPM_ROOT/include -I$RPM_ROOT/include/rpm" |
29 |
> |
export LDFLAGS="-L$BZ2LIB_ROOT/lib -L$BEECRYPT_ROOT/%{libdir} -L$RPM_ROOT/%{libdir}" |
30 |
|
export LIBDIR="$LIBS" |
31 |
|
export LIBXML2_CFLAGS="-I$LIBXML2_ROOT/include/libxml2 -I$BEECRYPT_ROOT/include -I$RPM_ROOT/include" |
32 |
|
export LIBXML2_LIBS="-lxml2 -L$LIBXML2_ROOT/lib -L$BEECRYPT_ROOT/%{libdir} -L$RPM_ROOT/%{libdir}" |
35 |
|
--disable-nls \ |
36 |
|
--disable-dependency-tracking \ |
37 |
|
--without-libintl-prefix \ |
38 |
+ |
--disable-docs \ |
39 |
|
--disable-rpath |
40 |
|
make %makeprocesses |
41 |
|
|
51 |
|
echo "source $LIBXML2_ROOT/etc/profile.d/init.csh" ) > %{i}/etc/profile.d/dependencies-setup.csh |
52 |
|
|
53 |
|
mkdir -p %{i}/etc/apt |
54 |
< |
cat << \EOF_APT_CONF > %{i}/etc/apt/apt.conf |
54 |
> |
cat << \EOF_APT_CONF > %{i}/etc/apt.conf |
55 |
|
Dir "%{instroot}" |
56 |
|
{ |
57 |
|
// Location of the state dir |
73 |
|
|
74 |
|
// Locations of binaries |
75 |
|
Bin { |
76 |
< |
methods "%{i}%{libdir}/apt/methods/"; |
76 |
> |
methods "%{i}/lib/apt/methods/"; |
77 |
|
gzip "/bin/gzip"; |
78 |
|
dpkg "/usr/bin/dpkg"; |
79 |
|
dpkg-source "/usr/bin/dpkg-source"; |
80 |
|
dpkg-buildpackage "/usr/bin/dpkg-buildpackage"; |
81 |
< |
apt-get "%{instroot}/bin/apt-get-wrapper"; |
82 |
< |
apt-cache "%{instroot}/bin/apt-cache-wrapper"; |
83 |
< |
rpm "%{instroot}/bin/rpm-wrapper"; |
81 |
> |
apt-get "%{i}/bin/apt-get-wrapper"; |
82 |
> |
apt-cache "%{i}/bin/apt-cache-wrapper"; |
83 |
> |
rpm "%{i}/bin/rpm-wrapper"; |
84 |
|
}; |
85 |
|
|
86 |
|
|
87 |
|
// Config files |
88 |
< |
Etc "%{cmsplatf}/etc/apt/" { |
88 |
> |
Etc "%{cmsplatf}/external/apt/%{v}/etc/" { |
89 |
|
sourcelist "sources.list"; |
90 |
|
main "apt.conf"; |
91 |
|
preferences "preferences"; |
97 |
|
RPM |
98 |
|
{ |
99 |
|
PM "external"; |
100 |
< |
Options { "--define";"_rpmlock_path %{instroot}/%{cmsplatf}/var/lib/rpm/lock";"--dbpath";"%{instroot}/var/lib/rpm";"--nodeps";}; |
101 |
< |
Install-Options { "--define";"_rpmlock_path %{instroot}/%{cmsplatf}/var/lib/rpm/lock";"--nodeps";"--force";"--dbpath";"%{instroot}/%{cmsplatf}/var/lib/rpm";"--prefix";"%{instroot}";}; |
100 |
> |
Options { "--nodeps";}; |
101 |
> |
Install-Options { "--nodeps";"--force";"--prefix";"%{instroot}";}; |
102 |
|
RootDir "%{instroot}"; |
103 |
|
Architecture "%{cmsplatf}"; |
104 |
|
}; |
105 |
|
EOF_APT_CONF |
106 |
|
|
107 |
< |
cat %_sourcedir/bootstrap | perl -p -e "s/\@CMSPLATF\@/%{cmsplatf}/; |
108 |
< |
s/\@GCC_VERSION\@/$GCC_VERSION/; |
109 |
< |
s/\@RPM_VERSION\@/$RPM_VERSION/; |
110 |
< |
s/\@DB4_VERSION\@/$DB4_VERSION/; |
111 |
< |
s/\@LIBXML2_VERSION\@/$LIBXML2_VERSION/; |
112 |
< |
s/\@OPENSSL_VERSION\@/$OPENSSL_VERSION/; |
113 |
< |
s/\@BEECRYPT_VERSION\@/$BEECRYPT_VERSION/; |
114 |
< |
s/\@BZ2LIB_VERSION\@/$BZ2LIB_VERSION/; |
104 |
< |
s/\@ZLIB_VERSION\@/$ZLIB_VERSION/; |
105 |
< |
s/\@EXPAT_VERSION\@/$EXPAT_VERSION/; |
106 |
< |
s/\@ELFUTILS_VERSION\@/$ELFUTILS_VERSION/; |
107 |
< |
s/\@NEON_VERSION\@/$NEON_VERSION/; |
108 |
< |
s/\@GCC_REVISION\@/$GCC_REVISION/; |
109 |
< |
s/\@BEECRYPT_REVISION\@/$BEECRYPT_REVISION/; |
110 |
< |
s/\@RPM_REVISION\@/$RPM_REVISION/; |
111 |
< |
s/\@OPENSSL_REVISION\@/$OPENSSL_REVISION/; |
112 |
< |
s/\@DB4_REVISION\@/$DB4_REVISION/; |
113 |
< |
s/\@LIBXML2_REVISION\@/$LIBXML2_REVISION/; |
114 |
< |
s/\@BZ2LIB_REVISION\@/$BZ2LIB_REVISION/; |
115 |
< |
s/\@ZLIB_REVISION\@/$ZLIB_REVISION/; |
116 |
< |
s/\@EXPAT_REVISION\@/$EXPAT_REVISION/; |
117 |
< |
s/\@NEON_REVISION\@/$NEON_REVISION/; |
118 |
< |
s/\@ELFUTILS_REVISION\@/$ELFUTILS_REVISION/; |
119 |
< |
s/\@APT_VERSION\@/%{v}/; |
120 |
< |
s/\@APT_REVISION\@/%{pkgrevision}/; |
121 |
< |
" > %{instroot}/bootstrap-%{cmsplatf}.sh |
107 |
> |
cat << \EOF_SOURCES_LIST > %{i}/etc/sources.list |
108 |
> |
rpm http://cmsrep.cern.ch cms/cpt/Software/download/cms/apt/%{cmsplatf} cms lcg external |
109 |
> |
rpm-src http://cmsrep.cern.ch cms/cpt/Software/download/cms/apt/%{cmsplatf} cms lcg external |
110 |
> |
# This are defined to support experimental repositories. The bootstrap file rewrites and uncomments |
111 |
> |
# them when passed the appropriate commandline option. |
112 |
> |
## rpm @SERVER@ @SERVER_PATH@/@REPOSITORY@/apt/%{cmsplatf} @GROUPS@ |
113 |
> |
## rpm-src @SERVER@ @SERVER_PATH@/@REPOSITORY@/apt/%{cmsplatf} @GROUPS@ |
114 |
> |
EOF_SOURCES_LIST |
115 |
|
|
116 |
< |
%post |
117 |
< |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/apt/lists/partial |
125 |
< |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/rpm |
126 |
< |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/cache/%{cmsplatf}/partial |
127 |
< |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/apt |
128 |
< |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/rpm |
129 |
< |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/lib/apt/methods |
130 |
< |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/dpkg/status |
131 |
< |
mkdir -p $RPM_INSTALL_PREFIX/bin |
132 |
< |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/cache/%{cmsplatf} |
116 |
> |
cat << \EOF_RPMPRIORITIES > %{i}/etc/rpmpriorities |
117 |
> |
Essantial: |
118 |
|
|
119 |
< |
cat << \EOF_BIN_APT_CACHE_WRAPPER > $RPM_INSTALL_PREFIX/bin/apt-cache-wrapper |
119 |
> |
EOF_RPMPRIORITIES |
120 |
> |
|
121 |
> |
cat << \EOF_BIN_APT_CACHE_WRAPPER > %{i}/bin/apt-cache-wrapper |
122 |
|
#!/bin/sh |
123 |
|
touch %{instroot}/log.txt |
124 |
|
echo $@ >> %{instroot}/log.txt |
125 |
< |
apt-cache $@ |
125 |
> |
apt-cache $@ |
126 |
|
EOF_BIN_APT_CACHE_WRAPPER |
127 |
< |
chmod +x $RPM_INSTALL_PREFIX/bin/apt-cache-wrapper |
127 |
> |
chmod +x %{i}/bin/apt-cache-wrapper |
128 |
|
|
129 |
< |
cat << \EOF_BIN_APT_GET_WRAPPER > $RPM_INSTALL_PREFIX/bin/apt-get-wrapper |
129 |
> |
cat << \EOF_BIN_APT_GET_WRAPPER > %{i}/bin/apt-get-wrapper |
130 |
|
#!/bin/sh |
131 |
|
touch %{instroot}/log.txt |
132 |
|
echo $@ >> %{instroot}/log.txt |
133 |
< |
apt-get $@ |
133 |
> |
apt-get $@ |
134 |
|
EOF_BIN_APT_GET_WRAPPER |
135 |
< |
chmod +x $RPM_INSTALL_PREFIX/bin/apt-get-wrapper |
135 |
> |
chmod +x %{i}/bin/apt-get-wrapper |
136 |
|
|
137 |
< |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/apt |
138 |
< |
cat << \EOF_RPMPRIORITIES > $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/apt/rpmpriorities |
139 |
< |
Essantial: |
140 |
< |
|
141 |
< |
EOF_RPMPRIORITIES |
142 |
< |
|
143 |
< |
cat << \EOF_SOURCES_LIST > $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/apt/sources.list |
157 |
< |
rpm http://cmsrep.cern.ch cms/cpt/Software/download/cms.eulisse/apt/%{cmsplatf} cms lcg external |
158 |
< |
rpm-src http://cmsrep.cern.ch cms/cpt/Software/download/cms.eulisse/apt/%{cmsplatf} cms lcg external |
159 |
< |
# This are defined to support experimental repositories. The bootstrap file rewrites and uncomments |
160 |
< |
# them when passed the appropriate commandline option. |
161 |
< |
## rpm @SERVER@ @SERVER_PATH@/@REPOSITORY@/apt/%{cmsplatf} @GROUPS@ |
162 |
< |
## rpm-src @SERVER@ @SERVER_PATH@/@REPOSITORY@/apt/%{cmsplatf} @GROUPS@ |
163 |
< |
EOF_SOURCES_LIST |
164 |
< |
|
165 |
< |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/rpm |
166 |
< |
|
167 |
< |
# FIXME: this is the ugliest trick ever found in a shell script. |
168 |
< |
# This is my understanding of the situation. |
169 |
< |
# apt runs internally as if --root != / while uses rpm with |
170 |
< |
# --root $rootdir but --dbpath is always passed as $rootdir/$rpmdb. |
171 |
< |
# This way the rpm db is sometimes in $rootdir/$rpmdb, sometimes in |
172 |
< |
# $rootdir/$rootdir/$rpmdb and files are scattered around, causing |
173 |
< |
# big confusion. The solution is.... to create a link so that $rootdir/$rootdir |
174 |
< |
# is actually $rootdir. Clear, isn't it? If not, I don't blame you, but |
175 |
< |
# this is the only way I could make it working. I need to look at the apt code to |
176 |
< |
# (and probably fix it) to understand it better. For the time being.... |
177 |
< |
# TODO: check if this still applies with this version of apt-get |
178 |
< |
# TODO: check if we can fix the problem by patching apt sources. |
179 |
< |
|
180 |
< |
firstdir=$(echo $RPM_INSTALL_PREFIX | cut -d/ -f1,2) |
181 |
< |
if [ -f $RPM_INSTALL_PREFIX$firstdir ] |
182 |
< |
then |
183 |
< |
echo "Hack to enable apt working as user" |
184 |
< |
ln -sf $firstdir $RPM_INSTALL_PREFIX$firstdir |
137 |
> |
cat << \EOF_BIN_RPM > %{i}/bin/rpm-wrapper |
138 |
> |
#!/bin/sh |
139 |
> |
if [ X"$(id -u)" = X0 ]; then |
140 |
> |
echo "*** CMS SOFTWARE INSTALLATION ABORTED ***" 1>&2 |
141 |
> |
echo "CMS software cannot be installed as the super-user." 1>&2 |
142 |
> |
echo "(We recommend reading any standard unix security guide.)" 1>&2 |
143 |
> |
exit 1 |
144 |
|
fi |
145 |
+ |
touch %{instroot}/log.txt |
146 |
+ |
echo rpm ${1+"$@"} >> %{instroot}/log.txt |
147 |
+ |
exec rpm ${1+"$@"} |
148 |
+ |
EOF_BIN_RPM |
149 |
+ |
chmod +x %{i}/bin/rpm-wrapper |
150 |
+ |
|
151 |
+ |
cat %_sourcedir/bootstrap | perl -p -e "s!\@CMSPLATF\@!%{cmsplatf}!g; |
152 |
+ |
s!\@GCC_VERSION\@!$GCC_VERSION!g; |
153 |
+ |
s!\@RPM_VERSION\@!$RPM_VERSION!g; |
154 |
+ |
s!\@DB4_VERSION\@!$DB4_VERSION!g; |
155 |
+ |
s!\@LIBXML2_VERSION\@!$LIBXML2_VERSION!g; |
156 |
+ |
s!\@OPENSSL_VERSION\@!$OPENSSL_VERSION!g; |
157 |
+ |
s!\@BEECRYPT_VERSION\@!$BEECRYPT_VERSION!g; |
158 |
+ |
s!\@BZ2LIB_VERSION\@!$BZ2LIB_VERSION!g; |
159 |
+ |
s!\@ZLIB_VERSION\@!$ZLIB_VERSION!g; |
160 |
+ |
s!\@EXPAT_VERSION\@!$EXPAT_VERSION!g; |
161 |
+ |
s!\@ELFUTILS_VERSION\@!$ELFUTILS_VERSION!g; |
162 |
+ |
s!\@NEON_VERSION\@!$NEON_VERSION!g; |
163 |
+ |
s!\@GCC_REVISION\@!$GCC_REVISION!g; |
164 |
+ |
s!\@BEECRYPT_REVISION\@!$BEECRYPT_REVISION!g; |
165 |
+ |
s!\@RPM_REVISION\@!$RPM_REVISION!g; |
166 |
+ |
s!\@OPENSSL_REVISION\@!$OPENSSL_REVISION!g; |
167 |
+ |
s!\@DB4_REVISION\@!$DB4_REVISION!g; |
168 |
+ |
s!\@LIBXML2_REVISION\@!$LIBXML2_REVISION!g; |
169 |
+ |
s!\@BZ2LIB_REVISION\@!$BZ2LIB_REVISION!g; |
170 |
+ |
s!\@ZLIB_REVISION\@!$ZLIB_REVISION!g; |
171 |
+ |
s!\@EXPAT_REVISION\@!$EXPAT_REVISION!g; |
172 |
+ |
s!\@NEON_REVISION\@!$NEON_REVISION!g; |
173 |
+ |
s!\@ELFUTILS_REVISION\@!$ELFUTILS_REVISION!g; |
174 |
+ |
s!\@APT_VERSION\@!%{v}!g; |
175 |
+ |
s!\@APT_REVISION\@!%{pkgrevision}!g; |
176 |
+ |
s!\@INSTROOT\@!%{instroot}!g; |
177 |
+ |
" > %{i}/bin/bootstrap-%{cmsplatf}.sh |
178 |
|
|
179 |
+ |
%post |
180 |
+ |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/apt/lists/partial |
181 |
+ |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/rpm |
182 |
+ |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/cache/%{cmsplatf}/partial |
183 |
+ |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc |
184 |
+ |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/rpm |
185 |
+ |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/lib/apt/methods |
186 |
+ |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/dpkg/status |
187 |
+ |
mkdir -p $RPM_INSTALL_PREFIX/bin |
188 |
+ |
mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/cache/%{cmsplatf} |
189 |
|
%{relocateConfig}etc/profile.d/dependencies-setup.sh |
190 |
|
%{relocateConfig}etc/profile.d/dependencies-setup.csh |
191 |
< |
perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|" $RPM_INSTALL_PREFIX/bin/apt-cache-wrapper $RPM_INSTALL_PREFIX/bin/apt-get-wrapper |
192 |
< |
%files |
193 |
< |
%{i} |
194 |
< |
%{instroot}/bootstrap-%{cmsplatf}.sh |
195 |
< |
%{instroot}/%{cmsplatf}/var/lib/rpm |
191 |
> |
%{relocateConfig}bin/apt-cache-wrapper |
192 |
> |
%{relocateConfig}bin/apt-get-wrapper |
193 |
> |
%{relocateConfig}bin/rpm-wrapper |
194 |
> |
%{relocateConfig}etc/apt.conf |
195 |
> |
|
196 |
> |
|