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.24 by eulisse, Thu Jun 21 13:27:07 2007 UTC

# Line 1 | Line 1
1 < ### RPM external apt 0.5.15lorg3.2
2 < ## INITENV SET APT_CONFIG %{i}/etc/apt/apt.conf
1 > ### RPM external apt 0.5.15lorg3.2-wt1
2 > ## INITENV SET APT_CONFIG %{i}/etc/apt.conf
3  
4 < Source:  http://apt-rpm.org/releases/%n-%v.tar.bz2
4 > Source:  http://apt-rpm.org/releases/%n-%realversion.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 38 | Line 39 | mkdir -p %{i}/etc/profile.d
39   echo "source $RPM_ROOT/etc/profile.d/init.csh"; \
40   echo "source $LIBXML2_ROOT/etc/profile.d/init.csh" ) > %{i}/etc/profile.d/dependencies-setup.csh
41  
42 < mkdir -p %{i}/etc/apt
43 < cat << \EOF_APT_CONF > %{i}/etc/apt/apt.conf
42 > mkdir -p %{i}/etc
43 > cat << \EOF_APT_CONF > %{i}/etc/apt.conf
44   Dir "%{instroot}"
45   {
46    // Location of the state dir
# Line 73 | Line 74 | Dir "%{instroot}"
74                                                                                                            
75  
76    // Config files
77 <    Etc "%{cmsplatf}/etc/apt/" {
77 >    Etc "%{cmsplatf}/etc/" {
78                         sourcelist "sources.list";
79                         main "apt.conf";
80                         preferences "preferences";
# Line 92 | Line 93 | RPM
93   };
94   EOF_APT_CONF
95  
96 + cat %_sourcedir/bootstrap | perl -p -e "s!\@CMSPLATF\@!%{cmsplatf}!g;
97 +                                        s!\@GCC_VERSION\@!$GCC_VERSION!g;
98 +                                        s!\@RPM_VERSION\@!$RPM_VERSION!g;
99 +                                        s!\@DB4_VERSION\@!$DB4_VERSION!g;
100 +                                        s!\@LIBXML2_VERSION\@!$LIBXML2_VERSION!g;
101 +                                        s!\@OPENSSL_VERSION\@!$OPENSSL_VERSION!g;
102 +                                        s!\@BEECRYPT_VERSION\@!$BEECRYPT_VERSION!g;
103 +                                        s!\@BZ2LIB_VERSION\@!$BZ2LIB_VERSION!g;
104 +                                        s!\@ZLIB_VERSION\@!$ZLIB_VERSION!g;
105 +                                        s!\@EXPAT_VERSION\@!$EXPAT_VERSION!g;
106 +                                        s!\@ELFUTILS_VERSION\@!$ELFUTILS_VERSION!g;
107 +                                        s!\@NEON_VERSION\@!$NEON_VERSION!g;
108 +                                        s!\@GCC_REVISION\@!$GCC_REVISION!g;
109 +                                        s!\@BEECRYPT_REVISION\@!$BEECRYPT_REVISION!g;
110 +                                        s!\@RPM_REVISION\@!$RPM_REVISION!g;
111 +                                        s!\@OPENSSL_REVISION\@!$OPENSSL_REVISION!g;
112 +                                        s!\@DB4_REVISION\@!$DB4_REVISION!g;
113 +                                        s!\@LIBXML2_REVISION\@!$LIBXML2_REVISION!g;
114 +                                        s!\@BZ2LIB_REVISION\@!$BZ2LIB_REVISION!g;
115 +                                        s!\@ZLIB_REVISION\@!$ZLIB_REVISION!g;
116 +                                        s!\@EXPAT_REVISION\@!$EXPAT_REVISION!g;
117 +                                        s!\@NEON_REVISION\@!$NEON_REVISION!g;
118 +                                        s!\@ELFUTILS_REVISION\@!$ELFUTILS_REVISION!g;
119 +                                        s!\@APT_VERSION\@!%{v}!g;
120 +                                        s!\@APT_REVISION\@!%{pkgrevision}!g;
121 +                                        s!\@INSTROOT\@!%{instroot}!g;
122 +                                        " > %{instroot}/bootstrap-%{cmsplatf}.sh
123 +
124   %post
125 < mkdir -p %{cmsplatf}/var/lib/apt/lists/partial
126 < mkdir -p %{cmsplatf}/var/lib/rpm
127 < mkdir -p %{cmsplatf}/var/lib/cache/%{cmsplatf}/partial
128 < mkdir -p %{cmsplatf}/etc/apt
129 < mkdir -p %{cmsplatf}/etc/rpm
130 < mkdir -p %{cmsplatf}/lib/apt/methods
131 < mkdir -p %{cmsplatf}/var/lib/dpkg/status
132 < mkdir -p bin
133 < mkdir -p %{cmsplatf}/var/lib/cache/%{cmsplatf}
125 > mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/apt/lists/partial
126 > mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/rpm
127 > mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/cache/%{cmsplatf}/partial
128 > mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc
129 > mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/rpm
130 > mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/lib/apt/methods
131 > mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/dpkg/status
132 > mkdir -p $RPM_INSTALL_PREFIX/bin
133 > mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/cache/%{cmsplatf}
134  
135 < cat << \EOF_BIN_APT_CACHE_WRAPPER > bin/apt-cache-wrapper
135 > cat << \EOF_BIN_APT_CACHE_WRAPPER > $RPM_INSTALL_PREFIX/bin/apt-cache-wrapper
136   #!/bin/sh
137   touch %{instroot}/log.txt
138   echo $@ >> %{instroot}/log.txt
139   apt-cache $@  
140   EOF_BIN_APT_CACHE_WRAPPER
141 < chmod +x bin/apt-cache-wrapper
141 > chmod +x $RPM_INSTALL_PREFIX/bin/apt-cache-wrapper
142  
143 < cat << \EOF_BIN_APT_GET_WRAPPER > bin/apt-get-wrapper
143 > cat << \EOF_BIN_APT_GET_WRAPPER > $RPM_INSTALL_PREFIX/bin/apt-get-wrapper
144   #!/bin/sh
145   touch %{instroot}/log.txt
146   echo $@ >> %{instroot}/log.txt
147   apt-get $@  
148   EOF_BIN_APT_GET_WRAPPER
149 < chmod +x bin/apt-get-wrapper
149 > chmod +x $RPM_INSTALL_PREFIX/bin/apt-get-wrapper
150  
151 < mkdir -p %{cmsplatf}/etc/apt
152 < cat << \EOF_RPMPRIORITIES > %{cmsplatf}/etc/apt/rpmpriorities
151 > mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc
152 > cat << \EOF_RPMPRIORITIES > $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/rpmpriorities
153   Essantial:
154  
155   EOF_RPMPRIORITIES
156  
157 < mkdir -p %{cmsplatf}/var/lib/rpm
157 > cat << \EOF_SOURCES_LIST > $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/sources.list
158 > rpm http://cmsrep.cern.ch cms/cpt/Software/download/cms.eulisse/apt/%{cmsplatf} cms lcg external  
159 > rpm-src http://cmsrep.cern.ch cms/cpt/Software/download/cms.eulisse/apt/%{cmsplatf} cms lcg external
160 > # This are defined to support experimental repositories. The bootstrap file rewrites and uncomments
161 > # them when passed the appropriate commandline option.
162 > ## rpm @SERVER@ @SERVER_PATH@/@REPOSITORY@/apt/%{cmsplatf} @GROUPS@  
163 > ## rpm-src @SERVER@ @SERVER_PATH@/@REPOSITORY@/apt/%{cmsplatf} @GROUPS@
164 > EOF_SOURCES_LIST
165 >
166 > mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/rpm
167 >
168 > # FIXME: this is the ugliest trick ever found in a shell script.
169 > # This is my understanding of the situation.
170 > # apt runs internally as if --root != / while uses rpm with
171 > # --root $rootdir but --dbpath is always passed as $rootdir/$rpmdb.
172 > # This way the rpm db is sometimes in $rootdir/$rpmdb, sometimes in
173 > # $rootdir/$rootdir/$rpmdb and files are scattered around, causing
174 > # big confusion. The solution is.... to create a link so that $rootdir/$rootdir
175 > # is actually $rootdir. Clear, isn't it? If not, I don't blame you, but
176 > # this is the only way I could make it working. I need to look at the apt code to
177 > # (and probably fix it) to understand it better. For the time being....
178 > # TODO: check if this still applies with this version of apt-get
179 > # TODO: check if we can fix the problem by patching apt sources.
180 >
181 > firstdir=$(echo $RPM_INSTALL_PREFIX | cut -d/ -f1,2)
182 > if [ -f $RPM_INSTALL_PREFIX$firstdir ]
183 > then
184 >    echo "Hack to enable apt working as user"
185 >    ln -sf $firstdir $RPM_INSTALL_PREFIX$firstdir
186 > fi
187  
188   %{relocateConfig}etc/profile.d/dependencies-setup.sh
189   %{relocateConfig}etc/profile.d/dependencies-setup.csh
190 < perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|" bin/apt-cache-wrapper bin/apt-get-wrapper
190 > %{relocateConfig}etc/apt.conf
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
196 >
197 >

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines