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.13 by eulisse, Tue Jun 19 14:34:01 2007 UTC vs.
Revision 1.62 by eulisse, Mon Jul 23 19:52:15 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
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 > Source2: cms-apt-migration
7   Requires: libxml2 beecrypt rpm zlib bz2lib openssl
8 + Patch0: apt-rpm449
9 + Patch1: apt-rpm446
10 + Patch2: apt
11 + Patch3: apt-multiarch
12   %if "%(echo %{cmsos} | cut -d_ -f 2 | sed -e 's|.*64.*|64|')" == "64"
13   %define libdir lib64
14   %else
15   %define libdir lib
16   %endif
17  
18 +
19   %prep
20   %setup -n %n-%{realversion}
21 + case $RPM_VERSION in
22 +    4.4.9*)
23   %patch0 -p0
24 +        ;;
25 +    4.4.6*)
26 + %patch1 -p0
27 +        ;;
28 + esac
29 +
30 + # scandir has a different prototype between macosx and linux.
31 + %if "%(uname)" == "Darwin"
32 + %patch2 -p1
33 + %endif
34 +
35 + %patch3 -p1
36 +
37   %build
38 < export CPPFLAGS="-I$BEECRYPT_ROOT/include -I$RPM_ROOT/include -I$RPM_ROOT/include/rpm"
39 < export LDFLAGS="-L$BEECRYPT_ROOT/%{libdir} -L$RPM_ROOT/%{libdir}"
38 > export CFLAGS="-O0 -g"
39 > export CXXFLAGS="-O0 -g"
40 > export CPPFLAGS="-I$BZ2LIB_ROOT/include -I$BEECRYPT_ROOT/include -I$RPM_ROOT/include -I$RPM_ROOT/include/rpm"
41 > export LDFLAGS="-L$BZ2LIB_ROOT/lib -L$BEECRYPT_ROOT/%{libdir} -L$RPM_ROOT/%{libdir}"
42   export LIBDIR="$LIBS"
43   export LIBXML2_CFLAGS="-I$LIBXML2_ROOT/include/libxml2 -I$BEECRYPT_ROOT/include -I$RPM_ROOT/include"
44   export LIBXML2_LIBS="-lxml2 -L$LIBXML2_ROOT/lib -L$BEECRYPT_ROOT/%{libdir} -L$RPM_ROOT/%{libdir}"
# Line 25 | Line 47 | export LIBXML2_LIBS="-lxml2 -L$LIBXML2_R
47                              --disable-nls \
48                              --disable-dependency-tracking \
49                              --without-libintl-prefix \
50 +                            --disable-docs \
51                              --disable-rpath
52   make %makeprocesses
53  
# Line 39 | Line 62 | mkdir -p %{i}/etc/profile.d
62   echo "source $RPM_ROOT/etc/profile.d/init.csh"; \
63   echo "source $LIBXML2_ROOT/etc/profile.d/init.csh" ) > %{i}/etc/profile.d/dependencies-setup.csh
64  
65 +
66   mkdir -p %{i}/etc/apt
67 < cat << \EOF_APT_CONF > %{i}/etc/apt/apt.conf
67 > cat << \EOF_APT_CONF > %{i}/etc/apt.conf
68   Dir "%{instroot}"
69   {
70    // Location of the state dir
# Line 62 | Line 86 | Dir "%{instroot}"
86  
87    // Locations of binaries
88        Bin {
89 <             methods "%{i}%{libdir}/apt/methods/";
89 >             methods "%{i}/lib/apt/methods/";
90               gzip "/bin/gzip";
91               dpkg "/usr/bin/dpkg";
92               dpkg-source "/usr/bin/dpkg-source";
93               dpkg-buildpackage "/usr/bin/dpkg-buildpackage";
94 <             apt-get "%{instroot}/bin/apt-get-wrapper";
95 <             apt-cache "%{instroot}/bin/apt-cache-wrapper";
96 <             rpm "%{instroot}/bin/rpm-wrapper";
94 >             apt-get "%{i}/bin/apt-get-wrapper";
95 >             apt-cache "%{i}/bin/apt-cache-wrapper";
96 >             rpm "%{i}/bin/rpm-wrapper";
97          };
98                                                                                                            
99  
100    // Config files
101 <    Etc "%{cmsplatf}/etc/apt/" {
101 >    Etc "%{cmsplatf}/external/apt/%{v}/etc/" {
102                         sourcelist "sources.list";
103                         main "apt.conf";
104                         preferences "preferences";
# Line 86 | Line 110 | Debug::pkgProblemResolver="1";
110   RPM
111   {
112      PM "external";
113 <    Options { "--define";"_rpmlock_path %{instroot}/%{cmsplatf}/var/lib/rpm/lock";"--dbpath";"%{instroot}/var/lib/rpm";"--nodeps";};
114 <    Install-Options { "--define";"_rpmlock_path %{instroot}/%{cmsplatf}/var/lib/rpm/lock";"--nodeps";"--force";"--dbpath";"%{instroot}/%{cmsplatf}/var/lib/rpm";"--prefix";"%{instroot}";};
113 >    Options { };
114 >    Install-Options { "--force";"--prefix";"%{instroot}";"--ignoreos";"--ignorearch";};
115      RootDir "%{instroot}";
116      Architecture "%{cmsplatf}";
117   };
118   EOF_APT_CONF
119  
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
120  
121 < %post
122 < mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/apt/lists/partial
123 < mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/rpm
124 < mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/cache/%{cmsplatf}/partial
125 < mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/apt
126 < mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/rpm
127 < mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/lib/apt/methods
128 < 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}
121 > cat << \EOF_SOURCES_LIST > %{i}/etc/sources.list
122 > rpm http://cmsrep.cern.ch cms/cpt/Software/download/cms/apt/%{cmsplatf} cms lcg external
123 > rpm-src http://cmsrep.cern.ch cms/cpt/Software/download/cms/apt/%{cmsplatf} cms lcg external
124 > # This are defined to support experimental repositories. The bootstrap file rewrites and uncomments
125 > # them when passed the appropriate commandline option.
126 > ##rpm http://@SERVER@ @SERVER_PATH@@REPOSITORY@/apt/%{cmsplatf} @GROUPS@  
127 > ##rpm-src http://@SERVER@ @SERVER_PATH@@REPOSITORY@/apt/%{cmsplatf} @GROUPS@
128 > EOF_SOURCES_LIST
129  
130 < cat << \EOF_BIN_APT_CACHE_WRAPPER > $RPM_INSTALL_PREFIX/bin/apt-cache-wrapper
130 > cat << \EOF_RPMPRIORITIES > %{i}/etc/rpmpriorities
131 > Essantial:
132 >
133 > EOF_RPMPRIORITIES
134 >
135 > cat << \EOF_BIN_APT_CACHE_WRAPPER > %{i}/bin/apt-cache-wrapper
136   #!/bin/sh
137   touch %{instroot}/log.txt
138   echo $@ >> %{instroot}/log.txt
139 < apt-cache $@  
139 > apt-cache $@
140   EOF_BIN_APT_CACHE_WRAPPER
141 < chmod +x $RPM_INSTALL_PREFIX/bin/apt-cache-wrapper
141 > chmod +x %{i}/bin/apt-cache-wrapper
142  
143 < cat << \EOF_BIN_APT_GET_WRAPPER > $RPM_INSTALL_PREFIX/bin/apt-get-wrapper
143 > cat << \EOF_BIN_APT_GET_WRAPPER > %{i}/bin/apt-get-wrapper
144   #!/bin/sh
145   touch %{instroot}/log.txt
146   echo $@ >> %{instroot}/log.txt
147 < apt-get $@  
147 > apt-get $@
148   EOF_BIN_APT_GET_WRAPPER
149 < chmod +x $RPM_INSTALL_PREFIX/bin/apt-get-wrapper
149 <
150 < mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/apt
151 < cat << \EOF_RPMPRIORITIES > $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/apt/rpmpriorities
152 < Essantial:
149 > chmod +x %{i}/bin/apt-get-wrapper
150  
151 < EOF_RPMPRIORITIES
152 <
153 < cat << \EOF_SOURCES_LIST > $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/apt/sources.list
154 < rpm http://cmsrep.cern.ch cms/cpt/Software/download/cms.eulisse/apt/%{cmsplatf} cms lcg external  
155 < rpm-src http://cmsrep.cern.ch cms/cpt/Software/download/cms.eulisse/apt/%{cmsplatf} cms lcg external
156 < # This are defined to support experimental repositories. The bootstrap file rewrites and uncomments
157 < # 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
151 > cat << \EOF_BIN_RPM > %{i}/bin/rpm-wrapper
152 > #!/bin/sh
153 > if [ X"$(id -u)" = X0 ]; then
154 >  echo "*** CMS SOFTWARE INSTALLATION ABORTED ***" 1>&2
155 >  echo "CMS software cannot be installed as the super-user." 1>&2
156 >  echo "(We recommend reading any standard unix security guide.)" 1>&2
157 >  exit 1
158   fi
159 + touch %{instroot}/log.txt
160 + echo rpm ${1+"$@"} >> %{instroot}/log.txt
161 + exec rpm ${1+"$@"}
162 + EOF_BIN_RPM
163 + chmod +x %{i}/bin/rpm-wrapper
164 +
165 + cat %_sourcedir/bootstrap | perl -p -e "s!\@CMSPLATF\@!%{cmsplatf}!g;
166 +                                        s!\@GCC_VERSION\@!$GCC_VERSION!g;
167 +                                        s!\@RPM_VERSION\@!$RPM_VERSION!g;
168 +                                        s!\@DB4_VERSION\@!$DB4_VERSION!g;
169 +                                        s!\@LIBXML2_VERSION\@!$LIBXML2_VERSION!g;
170 +                                        s!\@OPENSSL_VERSION\@!$OPENSSL_VERSION!g;
171 +                                        s!\@BEECRYPT_VERSION\@!$BEECRYPT_VERSION!g;
172 +                                        s!\@BZ2LIB_VERSION\@!$BZ2LIB_VERSION!g;
173 +                                        s!\@ZLIB_VERSION\@!$ZLIB_VERSION!g;
174 +                                        s!\@EXPAT_VERSION\@!$EXPAT_VERSION!g;
175 +                                        s!\@ELFUTILS_VERSION\@!$ELFUTILS_VERSION!g;
176 +                                        s!\@NEON_VERSION\@!$NEON_VERSION!g;
177 +                                        s!\@GCC_REVISION\@!$GCC_REVISION!g;
178 +                                        s!\@BEECRYPT_REVISION\@!$BEECRYPT_REVISION!g;
179 +                                        s!\@RPM_REVISION\@!$RPM_REVISION!g;
180 +                                        s!\@OPENSSL_REVISION\@!$OPENSSL_REVISION!g;
181 +                                        s!\@DB4_REVISION\@!$DB4_REVISION!g;
182 +                                        s!\@LIBXML2_REVISION\@!$LIBXML2_REVISION!g;
183 +                                        s!\@BZ2LIB_REVISION\@!$BZ2LIB_REVISION!g;
184 +                                        s!\@ZLIB_REVISION\@!$ZLIB_REVISION!g;
185 +                                        s!\@EXPAT_REVISION\@!$EXPAT_REVISION!g;
186 +                                        s!\@NEON_REVISION\@!$NEON_REVISION!g;
187 +                                        s!\@ELFUTILS_REVISION\@!$ELFUTILS_REVISION!g;
188 +                                        s!\@APT_VERSION\@!%{v}!g;
189 +                                        s!\@APT_REVISION\@!%{pkgrevision}!g;
190 +                                        s!\@INSTROOT\@!%{instroot}!g;
191 +                                        " > %{i}/bin/bootstrap-%{cmsplatf}.sh
192 +
193 + cat %_sourcedir/cms-apt-migration | perl -p -e "s!\@CMSPLATF\@!%{cmsplatf}!g;
194 +                                        s!\@GCC_VERSION\@!$GCC_VERSION!g;
195 +                                        s!\@RPM_VERSION\@!$RPM_VERSION!g;
196 +                                        s!\@DB4_VERSION\@!$DB4_VERSION!g;
197 +                                        s!\@LIBXML2_VERSION\@!$LIBXML2_VERSION!g;
198 +                                        s!\@OPENSSL_VERSION\@!$OPENSSL_VERSION!g;
199 +                                        s!\@BEECRYPT_VERSION\@!$BEECRYPT_VERSION!g;
200 +                                        s!\@BZ2LIB_VERSION\@!$BZ2LIB_VERSION!g;
201 +                                        s!\@ZLIB_VERSION\@!$ZLIB_VERSION!g;
202 +                                        s!\@EXPAT_VERSION\@!$EXPAT_VERSION!g;
203 +                                        s!\@ELFUTILS_VERSION\@!$ELFUTILS_VERSION!g;
204 +                                        s!\@NEON_VERSION\@!$NEON_VERSION!g;
205 +                                        s!\@GCC_REVISION\@!$GCC_REVISION!g;
206 +                                        s!\@BEECRYPT_REVISION\@!$BEECRYPT_REVISION!g;
207 +                                        s!\@RPM_REVISION\@!$RPM_REVISION!g;
208 +                                        s!\@OPENSSL_REVISION\@!$OPENSSL_REVISION!g;
209 +                                        s!\@DB4_REVISION\@!$DB4_REVISION!g;
210 +                                        s!\@LIBXML2_REVISION\@!$LIBXML2_REVISION!g;
211 +                                        s!\@BZ2LIB_REVISION\@!$BZ2LIB_REVISION!g;
212 +                                        s!\@ZLIB_REVISION\@!$ZLIB_REVISION!g;
213 +                                        s!\@EXPAT_REVISION\@!$EXPAT_REVISION!g;
214 +                                        s!\@NEON_REVISION\@!$NEON_REVISION!g;
215 +                                        s!\@ELFUTILS_REVISION\@!$ELFUTILS_REVISION!g;
216 +                                        s!\@APT_VERSION\@!%{v}!g;
217 +                                        s!\@APT_REVISION\@!%{pkgrevision}!g;
218 +                                        s!\@INSTROOT\@!%{instroot}!g;" > %{i}/bin/cms-apt-migration-%{cmsplatf}.sh
219  
220 + %post
221 + mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/apt/lists/partial
222 + mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/rpm
223 + mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/cache/%{cmsplatf}/partial
224 + mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc
225 + mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/rpm
226 + mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/lib/apt/methods
227 + mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/dpkg/status
228 + mkdir -p $RPM_INSTALL_PREFIX/bin
229 + mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/cache/%{cmsplatf}
230   %{relocateConfig}etc/profile.d/dependencies-setup.sh
231   %{relocateConfig}etc/profile.d/dependencies-setup.csh
232 < perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|" $RPM_INSTALL_PREFIX/bin/apt-cache-wrapper $RPM_INSTALL_PREFIX/bin/apt-get-wrapper
233 < %files
234 < %{i}
235 < %{instroot}/bootstrap-%{cmsplatf}.sh
193 < %{instroot}/%{cmsplatf}/var/lib/rpm
194 < #
195 < #
232 > %{relocateConfig}bin/apt-cache-wrapper
233 > %{relocateConfig}bin/apt-get-wrapper
234 > %{relocateConfig}bin/rpm-wrapper
235 > %{relocateConfig}etc/apt.conf

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines