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.14 by eulisse, Tue Jun 19 15:05:31 2007 UTC vs.
Revision 1.29 by eulisse, Fri Jun 22 06:32:48 2007 UTC

# Line 1 | Line 1
1   ### RPM external apt 0.5.15lorg3.2-wt1
2 < ## INITENV SET APT_CONFIG %{i}/etc/apt/apt.conf
2 > ## INITENV SET APT_CONFIG %{i}/etc/apt.conf
3  
4   Source:  http://apt-rpm.org/releases/%n-%realversion.tar.bz2
5   Source1: bootstrap
# Line 40 | Line 40 | mkdir -p %{i}/etc/profile.d
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
43 > cat << \EOF_APT_CONF > %{i}/etc/apt.conf
44   Dir "%{instroot}"
45   {
46    // Location of the state dir
# Line 62 | Line 62 | Dir "%{instroot}"
62  
63    // Locations of binaries
64        Bin {
65 <             methods "%{i}%{libdir}/apt/methods/";
65 >             methods "%{i}/lib/apt/methods/";
66               gzip "/bin/gzip";
67               dpkg "/usr/bin/dpkg";
68               dpkg-source "/usr/bin/dpkg-source";
69               dpkg-buildpackage "/usr/bin/dpkg-buildpackage";
70 <             apt-get "%{instroot}/bin/apt-get-wrapper";
71 <             apt-cache "%{instroot}/bin/apt-cache-wrapper";
72 <             rpm "%{instroot}/bin/rpm-wrapper";
70 >             apt-get "%{i}/bin/apt-get-wrapper";
71 >             apt-cache "%{i}/bin/apt-cache-wrapper";
72 >             rpm "%{i}/bin/rpm-wrapper";
73          };
74                                                                                                            
75  
76    // Config files
77 <    Etc "%{cmsplatf}/etc/apt/" {
77 >    Etc "%{cmsplatf}/external/apt/%{v}/etc/" {
78                         sourcelist "sources.list";
79                         main "apt.conf";
80                         preferences "preferences";
# Line 93 | 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
96 > cat << \EOF_SOURCES_LIST > %{i}/etc/sources.list
97 > rpm http://cmsrep.cern.ch cms/cpt/Software/download/cms.eulisse/apt/%{cmsplatf} cms lcg external
98 > rpm-src http://cmsrep.cern.ch cms/cpt/Software/download/cms.eulisse/apt/%{cmsplatf} cms lcg external
99 > # This are defined to support experimental repositories. The bootstrap file rewrites and uncomments
100 > # them when passed the appropriate commandline option.
101 > ## rpm @SERVER@ @SERVER_PATH@/@REPOSITORY@/apt/%{cmsplatf} @GROUPS@  
102 > ## rpm-src @SERVER@ @SERVER_PATH@/@REPOSITORY@/apt/%{cmsplatf} @GROUPS@
103 > EOF_SOURCES_LIST
104  
105 < %post
106 < 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/apt
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}
105 > cat << \EOF_RPMPRIORITIES > %{i}/etc/rpmpriorities
106 > Essantial:
107  
108 < cat << \EOF_BIN_APT_CACHE_WRAPPER > $RPM_INSTALL_PREFIX/bin/apt-cache-wrapper
108 > EOF_RPMPRIORITIES
109 >
110 > cat << \EOF_BIN_APT_CACHE_WRAPPER > %{i}/bin/apt-cache-wrapper
111   #!/bin/sh
112   touch %{instroot}/log.txt
113   echo $@ >> %{instroot}/log.txt
114 < apt-cache $@  
114 > apt-cache $@
115   EOF_BIN_APT_CACHE_WRAPPER
116 < chmod +x $RPM_INSTALL_PREFIX/bin/apt-cache-wrapper
116 > chmod +x %{i}/bin/apt-cache-wrapper
117  
118 < cat << \EOF_BIN_APT_GET_WRAPPER > $RPM_INSTALL_PREFIX/bin/apt-get-wrapper
118 > cat << \EOF_BIN_APT_GET_WRAPPER > %{i}/bin/apt-get-wrapper
119   #!/bin/sh
120   touch %{instroot}/log.txt
121   echo $@ >> %{instroot}/log.txt
122 < apt-get $@  
122 > apt-get $@
123   EOF_BIN_APT_GET_WRAPPER
124 < chmod +x $RPM_INSTALL_PREFIX/bin/apt-get-wrapper
124 > chmod +x %{i}/bin/apt-get-wrapper
125  
126 < mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/apt
127 < cat << \EOF_RPMPRIORITIES > $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/apt/rpmpriorities
128 < Essantial:
129 <
130 < EOF_RPMPRIORITIES
131 <
132 < cat << \EOF_SOURCES_LIST > $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/apt/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
126 > cat << \EOF_BIN_RPM > %{i}/bin/rpm-wrapper
127 > #!/bin/sh
128 > if [ X"$(id -u)" = X0 ]; then
129 >  echo "*** CMS SOFTWARE INSTALLATION ABORTED ***" 1>&2
130 >  echo "CMS software cannot be installed as the super-user." 1>&2
131 >  echo "(We recommend reading any standard unix security guide.)" 1>&2
132 >  exit 1
133   fi
134 + touch %{instroot}/log.txt
135 + echo rpm ${1+"$@"} >> %{instroot}/log.txt
136 + exec rpm ${1+"$@"}
137 + EOF_BIN_RPM
138 + chmod +x %{i}/bin/rpm-wrapper
139 +
140 + cat %_sourcedir/bootstrap | perl -p -e "s!\@CMSPLATF\@!%{cmsplatf}!g;
141 +                                        s!\@GCC_VERSION\@!$GCC_VERSION!g;
142 +                                        s!\@RPM_VERSION\@!$RPM_VERSION!g;
143 +                                        s!\@DB4_VERSION\@!$DB4_VERSION!g;
144 +                                        s!\@LIBXML2_VERSION\@!$LIBXML2_VERSION!g;
145 +                                        s!\@OPENSSL_VERSION\@!$OPENSSL_VERSION!g;
146 +                                        s!\@BEECRYPT_VERSION\@!$BEECRYPT_VERSION!g;
147 +                                        s!\@BZ2LIB_VERSION\@!$BZ2LIB_VERSION!g;
148 +                                        s!\@ZLIB_VERSION\@!$ZLIB_VERSION!g;
149 +                                        s!\@EXPAT_VERSION\@!$EXPAT_VERSION!g;
150 +                                        s!\@ELFUTILS_VERSION\@!$ELFUTILS_VERSION!g;
151 +                                        s!\@NEON_VERSION\@!$NEON_VERSION!g;
152 +                                        s!\@GCC_REVISION\@!$GCC_REVISION!g;
153 +                                        s!\@BEECRYPT_REVISION\@!$BEECRYPT_REVISION!g;
154 +                                        s!\@RPM_REVISION\@!$RPM_REVISION!g;
155 +                                        s!\@OPENSSL_REVISION\@!$OPENSSL_REVISION!g;
156 +                                        s!\@DB4_REVISION\@!$DB4_REVISION!g;
157 +                                        s!\@LIBXML2_REVISION\@!$LIBXML2_REVISION!g;
158 +                                        s!\@BZ2LIB_REVISION\@!$BZ2LIB_REVISION!g;
159 +                                        s!\@ZLIB_REVISION\@!$ZLIB_REVISION!g;
160 +                                        s!\@EXPAT_REVISION\@!$EXPAT_REVISION!g;
161 +                                        s!\@NEON_REVISION\@!$NEON_REVISION!g;
162 +                                        s!\@ELFUTILS_REVISION\@!$ELFUTILS_REVISION!g;
163 +                                        s!\@APT_VERSION\@!%{v}!g;
164 +                                        s!\@APT_REVISION\@!%{pkgrevision}!g;
165 +                                        s!\@INSTROOT\@!%{instroot}!g;
166 +                                        " > %{i}/bin/bootstrap-%{cmsplatf}.sh
167  
168 + %post
169 + mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/apt/lists/partial
170 + mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/rpm
171 + mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/cache/%{cmsplatf}/partial
172 + mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc
173 + mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/rpm
174 + mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/lib/apt/methods
175 + mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/dpkg/status
176 + mkdir -p $RPM_INSTALL_PREFIX/bin
177 + mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/cache/%{cmsplatf}
178   %{relocateConfig}etc/profile.d/dependencies-setup.sh
179   %{relocateConfig}etc/profile.d/dependencies-setup.csh
180 < perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|" $RPM_INSTALL_PREFIX/bin/apt-cache-wrapper $RPM_INSTALL_PREFIX/bin/apt-get-wrapper
181 < %files
182 < %{i}
183 < %{instroot}/bootstrap-%{cmsplatf}.sh
194 < %{instroot}/%{cmsplatf}/var/lib/rpm
180 > %{relocateConfig}bin/apt-cache-wrapper
181 > %{relocateConfig}bin/apt-get-wrapper
182 > %{relocateConfig}bin/rpm-wrapper
183 > %{relocateConfig}etc/apt.conf

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines