ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/apt.spec
Revision: 1.70
Committed: Fri Nov 2 20:36:51 2007 UTC (17 years, 5 months ago) by elmer
Branch: MAIN
CVS Tags: pe20071121a-ports-422, pe20071121a-ports-412, pe20071121a-ports, pe20071112c-ports-422, pe20071112c-ports-412, pe20071112c-ports, pe20071112b-ports-412, pe20071112b-ports, pe20071112a-ports, pe20071105c-ports, pe20071105b-ports, pe20071105a-ports, pe20071103e-ports, pe20071103d-ports, pe20071103c-ports, pe20071103b-ports, pe20071103a-ports
Changes since 1.69: +1 -1 lines
Log Message:
Update to -CMS18

File Contents

# User Rev Content
1 elmer 1.70 ### RPM external apt 0.5.15lorg3.2-CMS18
2 eulisse 1.24 ## INITENV SET APT_CONFIG %{i}/etc/apt.conf
3 eulisse 1.10 Source: http://apt-rpm.org/releases/%n-%realversion.tar.bz2
4 eulisse 1.8 Source1: bootstrap
5 eulisse 1.48 Source2: cms-apt-migration
6 ratnik 1.69
7     %if "%{?online_release:set}" != "set"
8 eulisse 1.32 Requires: libxml2 beecrypt rpm zlib bz2lib openssl
9 ratnik 1.69 %else
10     Requires: libxml2 beecrypt rpm bz2lib
11     %endif
12    
13 eulisse 1.5 Patch0: apt-rpm449
14 eulisse 1.32 Patch1: apt-rpm446
15 eulisse 1.45 Patch2: apt
16 eulisse 1.61 Patch3: apt-multiarch
17 eulisse 1.5 %if "%(echo %{cmsos} | cut -d_ -f 2 | sed -e 's|.*64.*|64|')" == "64"
18     %define libdir lib64
19     %else
20     %define libdir lib
21     %endif
22 ratnik 1.1
23 eulisse 1.5 %prep
24     %setup -n %n-%{realversion}
25 eulisse 1.32 case $RPM_VERSION in
26     4.4.9*)
27 eulisse 1.5 %patch0 -p0
28 eulisse 1.32 ;;
29     4.4.6*)
30     %patch1 -p0
31     ;;
32     esac
33 eulisse 1.49
34     # scandir has a different prototype between macosx and linux.
35     %if "%(uname)" == "Darwin"
36 eulisse 1.45 %patch2 -p1
37 eulisse 1.49 %endif
38 eulisse 1.45
39 eulisse 1.61 %patch3 -p1
40    
41 ratnik 1.1 %build
42 eulisse 1.34 export CFLAGS="-O0 -g"
43     export CXXFLAGS="-O0 -g"
44 eulisse 1.39 export CPPFLAGS="-I$BZ2LIB_ROOT/include -I$BEECRYPT_ROOT/include -I$RPM_ROOT/include -I$RPM_ROOT/include/rpm"
45     export LDFLAGS="-L$BZ2LIB_ROOT/lib -L$BEECRYPT_ROOT/%{libdir} -L$RPM_ROOT/%{libdir}"
46 eulisse 1.2 export LIBDIR="$LIBS"
47     export LIBXML2_CFLAGS="-I$LIBXML2_ROOT/include/libxml2 -I$BEECRYPT_ROOT/include -I$RPM_ROOT/include"
48 eulisse 1.5 export LIBXML2_LIBS="-lxml2 -L$LIBXML2_ROOT/lib -L$BEECRYPT_ROOT/%{libdir} -L$RPM_ROOT/%{libdir}"
49 ratnik 1.1
50 eulisse 1.2 ./configure --prefix=%{i} --exec-prefix=%{i} \
51     --disable-nls \
52     --disable-dependency-tracking \
53     --without-libintl-prefix \
54 eulisse 1.31 --disable-docs \
55 eulisse 1.2 --disable-rpath
56 eulisse 1.6 make %makeprocesses
57 eulisse 1.7
58    
59 eulisse 1.6 %install
60     make install
61     mkdir -p %{i}/etc/profile.d
62     (echo "#!/bin/sh"; \
63     echo "source $RPM_ROOT/etc/profile.d/init.sh"; \
64     echo "source $LIBXML2_ROOT/etc/profile.d/init.sh" ) > %{i}/etc/profile.d/dependencies-setup.sh
65     (echo "#!/bin/tcsh"; \
66     echo "source $RPM_ROOT/etc/profile.d/init.csh"; \
67     echo "source $LIBXML2_ROOT/etc/profile.d/init.csh" ) > %{i}/etc/profile.d/dependencies-setup.csh
68 eulisse 1.7
69 eulisse 1.47
70 eulisse 1.25 mkdir -p %{i}/etc/apt
71 eulisse 1.24 cat << \EOF_APT_CONF > %{i}/etc/apt.conf
72 eulisse 1.7 Dir "%{instroot}"
73     {
74     // Location of the state dir
75     State "%{cmsplatf}/var/lib/apt/"
76     {
77     lists "lists/";
78     xstatus "xstatus";
79     userstatus "status.user";
80     status "var/lib/dpkg/status";
81     cdroms "cdroms.list";
82     };
83    
84     // Location of the cache dir
85     Cache "%{cmsplatf}/var/lib/cache" {
86     archives "%{cmsplatf}";
87     srcpkgcache "srcpkgcache.bin";
88     pkgcache "pkgcache.bin";
89     };
90    
91     // Locations of binaries
92     Bin {
93 eulisse 1.28 methods "%{i}/lib/apt/methods/";
94 eulisse 1.7 gzip "/bin/gzip";
95     dpkg "/usr/bin/dpkg";
96     dpkg-source "/usr/bin/dpkg-source";
97     dpkg-buildpackage "/usr/bin/dpkg-buildpackage";
98 eulisse 1.25 apt-get "%{i}/bin/apt-get-wrapper";
99     apt-cache "%{i}/bin/apt-cache-wrapper";
100     rpm "%{i}/bin/rpm-wrapper";
101 eulisse 1.7 };
102    
103    
104     // Config files
105 eulisse 1.28 Etc "%{cmsplatf}/external/apt/%{v}/etc/" {
106 eulisse 1.7 sourcelist "sources.list";
107     main "apt.conf";
108     preferences "preferences";
109     };
110     };
111    
112     Debug::pkgProblemResolver="1";
113    
114     RPM
115     {
116     PM "external";
117 eulisse 1.43 Options { };
118     Install-Options { "--force";"--prefix";"%{instroot}";"--ignoreos";"--ignorearch";};
119 eulisse 1.7 RootDir "%{instroot}";
120     Architecture "%{cmsplatf}";
121     };
122     EOF_APT_CONF
123    
124 eulisse 1.44
125 eulisse 1.25 cat << \EOF_SOURCES_LIST > %{i}/etc/sources.list
126 eulisse 1.41 rpm http://cmsrep.cern.ch cms/cpt/Software/download/cms/apt/%{cmsplatf} cms lcg external
127     rpm-src http://cmsrep.cern.ch cms/cpt/Software/download/cms/apt/%{cmsplatf} cms lcg external
128 eulisse 1.25 # This are defined to support experimental repositories. The bootstrap file rewrites and uncomments
129     # them when passed the appropriate commandline option.
130 eulisse 1.58 ##rpm http://@SERVER@ @SERVER_PATH@@REPOSITORY@/apt/%{cmsplatf} @GROUPS@
131     ##rpm-src http://@SERVER@ @SERVER_PATH@@REPOSITORY@/apt/%{cmsplatf} @GROUPS@
132 eulisse 1.25 EOF_SOURCES_LIST
133    
134     cat << \EOF_RPMPRIORITIES > %{i}/etc/rpmpriorities
135     Essantial:
136    
137     EOF_RPMPRIORITIES
138    
139     cat << \EOF_BIN_APT_CACHE_WRAPPER > %{i}/bin/apt-cache-wrapper
140     #!/bin/sh
141     touch %{instroot}/log.txt
142     echo $@ >> %{instroot}/log.txt
143     apt-cache $@
144     EOF_BIN_APT_CACHE_WRAPPER
145 eulisse 1.26 chmod +x %{i}/bin/apt-cache-wrapper
146 eulisse 1.25
147     cat << \EOF_BIN_APT_GET_WRAPPER > %{i}/bin/apt-get-wrapper
148     #!/bin/sh
149     touch %{instroot}/log.txt
150     echo $@ >> %{instroot}/log.txt
151     apt-get $@
152     EOF_BIN_APT_GET_WRAPPER
153 eulisse 1.26 chmod +x %{i}/bin/apt-get-wrapper
154 eulisse 1.25
155     cat << \EOF_BIN_RPM > %{i}/bin/rpm-wrapper
156     #!/bin/sh
157     if [ X"$(id -u)" = X0 ]; then
158     echo "*** CMS SOFTWARE INSTALLATION ABORTED ***" 1>&2
159     echo "CMS software cannot be installed as the super-user." 1>&2
160     echo "(We recommend reading any standard unix security guide.)" 1>&2
161     exit 1
162     fi
163     touch %{instroot}/log.txt
164     echo rpm ${1+"$@"} >> %{instroot}/log.txt
165     exec rpm ${1+"$@"}
166     EOF_BIN_RPM
167     chmod +x %{i}/bin/rpm-wrapper
168    
169 eulisse 1.16 cat %_sourcedir/bootstrap | perl -p -e "s!\@CMSPLATF\@!%{cmsplatf}!g;
170 eulisse 1.15 s!\@GCC_VERSION\@!$GCC_VERSION!g;
171     s!\@RPM_VERSION\@!$RPM_VERSION!g;
172     s!\@DB4_VERSION\@!$DB4_VERSION!g;
173     s!\@LIBXML2_VERSION\@!$LIBXML2_VERSION!g;
174     s!\@OPENSSL_VERSION\@!$OPENSSL_VERSION!g;
175     s!\@BEECRYPT_VERSION\@!$BEECRYPT_VERSION!g;
176     s!\@BZ2LIB_VERSION\@!$BZ2LIB_VERSION!g;
177     s!\@ZLIB_VERSION\@!$ZLIB_VERSION!g;
178     s!\@EXPAT_VERSION\@!$EXPAT_VERSION!g;
179     s!\@ELFUTILS_VERSION\@!$ELFUTILS_VERSION!g;
180     s!\@NEON_VERSION\@!$NEON_VERSION!g;
181     s!\@GCC_REVISION\@!$GCC_REVISION!g;
182     s!\@BEECRYPT_REVISION\@!$BEECRYPT_REVISION!g;
183     s!\@RPM_REVISION\@!$RPM_REVISION!g;
184     s!\@OPENSSL_REVISION\@!$OPENSSL_REVISION!g;
185     s!\@DB4_REVISION\@!$DB4_REVISION!g;
186     s!\@LIBXML2_REVISION\@!$LIBXML2_REVISION!g;
187     s!\@BZ2LIB_REVISION\@!$BZ2LIB_REVISION!g;
188     s!\@ZLIB_REVISION\@!$ZLIB_REVISION!g;
189     s!\@EXPAT_REVISION\@!$EXPAT_REVISION!g;
190     s!\@NEON_REVISION\@!$NEON_REVISION!g;
191     s!\@ELFUTILS_REVISION\@!$ELFUTILS_REVISION!g;
192     s!\@APT_VERSION\@!%{v}!g;
193     s!\@APT_REVISION\@!%{pkgrevision}!g;
194     s!\@INSTROOT\@!%{instroot}!g;
195 eulisse 1.26 " > %{i}/bin/bootstrap-%{cmsplatf}.sh
196 eulisse 1.8
197 eulisse 1.50 cat %_sourcedir/cms-apt-migration | perl -p -e "s!\@CMSPLATF\@!%{cmsplatf}!g;
198 eulisse 1.48 s!\@GCC_VERSION\@!$GCC_VERSION!g;
199     s!\@RPM_VERSION\@!$RPM_VERSION!g;
200     s!\@DB4_VERSION\@!$DB4_VERSION!g;
201     s!\@LIBXML2_VERSION\@!$LIBXML2_VERSION!g;
202     s!\@OPENSSL_VERSION\@!$OPENSSL_VERSION!g;
203     s!\@BEECRYPT_VERSION\@!$BEECRYPT_VERSION!g;
204     s!\@BZ2LIB_VERSION\@!$BZ2LIB_VERSION!g;
205     s!\@ZLIB_VERSION\@!$ZLIB_VERSION!g;
206     s!\@EXPAT_VERSION\@!$EXPAT_VERSION!g;
207     s!\@ELFUTILS_VERSION\@!$ELFUTILS_VERSION!g;
208     s!\@NEON_VERSION\@!$NEON_VERSION!g;
209     s!\@GCC_REVISION\@!$GCC_REVISION!g;
210     s!\@BEECRYPT_REVISION\@!$BEECRYPT_REVISION!g;
211     s!\@RPM_REVISION\@!$RPM_REVISION!g;
212     s!\@OPENSSL_REVISION\@!$OPENSSL_REVISION!g;
213     s!\@DB4_REVISION\@!$DB4_REVISION!g;
214     s!\@LIBXML2_REVISION\@!$LIBXML2_REVISION!g;
215     s!\@BZ2LIB_REVISION\@!$BZ2LIB_REVISION!g;
216     s!\@ZLIB_REVISION\@!$ZLIB_REVISION!g;
217     s!\@EXPAT_REVISION\@!$EXPAT_REVISION!g;
218     s!\@NEON_REVISION\@!$NEON_REVISION!g;
219     s!\@ELFUTILS_REVISION\@!$ELFUTILS_REVISION!g;
220     s!\@APT_VERSION\@!%{v}!g;
221     s!\@APT_REVISION\@!%{pkgrevision}!g;
222 eulisse 1.50 s!\@INSTROOT\@!%{instroot}!g;" > %{i}/bin/cms-apt-migration-%{cmsplatf}.sh
223 eulisse 1.54
224 eulisse 1.6 %post
225 eulisse 1.8 mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/apt/lists/partial
226     mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/rpm
227     mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/cache/%{cmsplatf}/partial
228 eulisse 1.24 mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc
229 eulisse 1.8 mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/rpm
230     mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/lib/apt/methods
231     mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/dpkg/status
232     mkdir -p $RPM_INSTALL_PREFIX/bin
233     mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/cache/%{cmsplatf}
234 eulisse 1.6 %{relocateConfig}etc/profile.d/dependencies-setup.sh
235     %{relocateConfig}etc/profile.d/dependencies-setup.csh
236 eulisse 1.25 %{relocateConfig}bin/apt-cache-wrapper
237     %{relocateConfig}bin/apt-get-wrapper
238     %{relocateConfig}bin/rpm-wrapper
239 eulisse 1.29 %{relocateConfig}etc/apt.conf