ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/apt.spec
(Generate patch)

Comparing COMP/CMSDIST/apt.spec (file contents):
Revision 1.7 by eulisse, Mon Jun 18 17:00:21 2007 UTC vs.
Revision 1.9 by eulisse, Mon Jun 18 17:05:41 2007 UTC

# Line 2 | Line 2
2   ## INITENV SET APT_CONFIG %{i}/etc/apt/apt.conf
3  
4   Source:  http://apt-rpm.org/releases/%n-%v.tar.bz2
5 + Source1: bootstrap
6   Patch0: apt-rpm449
7 < Requires: libxml2 beecrypt rpm zlib bz2lib
7 > Requires: libxml2 beecrypt rpm zlib bz2lib openssl
8   %if "%(echo %{cmsos} | cut -d_ -f 2 | sed -e 's|.*64.*|64|')" == "64"
9   %define libdir lib64
10   %else
# Line 92 | Line 93 | RPM
93   };
94   EOF_APT_CONF
95  
96 + cat %_sourcedir/bootstrap | perl -p -e "s/\@CMSPLATF\@/%{cmsplatf}/;
97 +                                        s/\@GCC_VERSION\@/$GCC_VERSION/;
98 +                                        s/\@RPM_VERSION\@/$RPM_VERSION/;
99 +                                        s/\@DB4_VERSION\@/$DB4_VERSION/;
100 +                                        s/\@LIBXML2_VERSION\@/$LIBXML2_VERSION/;
101 +                                        s/\@OPENSSL_VERSION\@/$OPENSSL_VERSION/;
102 +                                        s/\@BEECRYPT_VERSION\@/$BEECRYPT_VERSION/;
103 +                                        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
122 +
123   %post
124 < mkdir -p %{cmsplatf}/var/lib/apt/lists/partial
125 < mkdir -p %{cmsplatf}/var/lib/rpm
126 < mkdir -p %{cmsplatf}/var/lib/cache/%{cmsplatf}/partial
127 < mkdir -p %{cmsplatf}/etc/apt
128 < mkdir -p %{cmsplatf}/etc/rpm
129 < mkdir -p %{cmsplatf}/lib/apt/methods
130 < mkdir -p %{cmsplatf}/var/lib/dpkg/status
131 < mkdir -p bin
132 < mkdir -p %{cmsplatf}/var/lib/cache/%{cmsplatf}
124 > 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}
133  
134 < cat << \EOF_BIN_APT_CACHE_WRAPPER > bin/apt-cache-wrapper
134 > cat << \EOF_BIN_APT_CACHE_WRAPPER > $RPM_INSTALL_PREFIX/bin/apt-cache-wrapper
135   #!/bin/sh
136   touch %{instroot}/log.txt
137   echo $@ >> %{instroot}/log.txt
138   apt-cache $@  
139   EOF_BIN_APT_CACHE_WRAPPER
140 < chmod +x bin/apt-cache-wrapper
140 > chmod +x $RPM_INSTALL_PREFIX/bin/apt-cache-wrapper
141  
142 < cat << \EOF_BIN_APT_GET_WRAPPER > bin/apt-get-wrapper
142 > cat << \EOF_BIN_APT_GET_WRAPPER > $RPM_INSTALL_PREFIX/bin/apt-get-wrapper
143   #!/bin/sh
144   touch %{instroot}/log.txt
145   echo $@ >> %{instroot}/log.txt
146   apt-get $@  
147   EOF_BIN_APT_GET_WRAPPER
148 < chmod +x bin/apt-get-wrapper
148 > chmod +x $RPM_INSTALL_PREFIX/bin/apt-get-wrapper
149  
150 < mkdir -p %{cmsplatf}/etc/apt
151 < cat << \EOF_RPMPRIORITIES > %{cmsplatf}/etc/apt/rpmpriorities
150 > mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/apt
151 > cat << \EOF_RPMPRIORITIES > $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/apt/rpmpriorities
152   Essantial:
153  
154   EOF_RPMPRIORITIES
155  
156 < mkdir -p %{cmsplatf}/var/lib/rpm
156 > cat << \EOF_SOURCES_LIST > $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/apt/sources.list
157 > rpm http://cmsrep.cern.ch cms/cpt/Software/download/cms/apt/%{cmsplatf} cms lcg external  
158 > rpm-src http://cmsrep.cern.ch cms/cpt/Software/download/cms/apt/%{cmsplatf} cms lcg external
159 > EOF_SOURCES_LIST
160 >
161 > mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/rpm
162 >
163 > # FIXME: this is the ugliest trick ever found in a shell script.
164 > # This is my understanding of the situation.
165 > # apt runs internally as if --root != / while uses rpm with
166 > # --root $rootdir but --dbpath is always passed as $rootdir/$rpmdb.
167 > # This way the rpm db is sometimes in $rootdir/$rpmdb, sometimes in
168 > # $rootdir/$rootdir/$rpmdb and files are scattered around, causing
169 > # big confusion. The solution is.... to create a link so that $rootdir/$rootdir
170 > # is actually $rootdir. Clear, isn't it? If not, I don't blame you, but
171 > # this is the only way I could make it working. I need to look at the apt code to
172 > # (and probably fix it) to understand it better. For the time being....
173 > # TODO: check if this still applies with this version of apt-get
174 > # TODO: check if we can fix the problem by patching apt sources.
175 >
176 > firstdir=$(echo $RPM_INSTALL_PREFIX | cut -d/ -f1,2)
177 > if [ -f $RPM_INSTALL_PREFIX$firstdir ]
178 > then
179 >    echo "Hack to enable apt working as user"
180 >    ln -sf $firstdir $RPM_INSTALL_PREFIX$firstdir
181 > fi
182  
183   %{relocateConfig}etc/profile.d/dependencies-setup.sh
184   %{relocateConfig}etc/profile.d/dependencies-setup.csh
185 < perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|" bin/apt-cache-wrapper bin/apt-get-wrapper
185 > perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|" $RPM_INSTALL_PREFIX/bin/apt-cache-wrapper $RPM_INSTALL_PREFIX/bin/apt-get-wrapper
186 > %files
187 > %{i}
188 > %{instroot}/bootstrap-%{cmsplatf}.sh
189 > %{instroot}/%{cmsplatf}/var/lib/rpm

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines