ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/apt.spec
Revision: 1.25
Committed: Thu Jun 21 15:00:24 2007 UTC (17 years, 10 months ago) by eulisse
Branch: MAIN
Changes since 1.24: +54 -64 lines
Log Message:
* More relocation issues
* Now the wrappers are generated and put in the apt directory, rather than
  in %{cmsplatf}/bin, this way we can modify them from one version of apt to
  another, without compromising existing installations.

File Contents

# User Rev Content
1 eulisse 1.10 ### RPM external apt 0.5.15lorg3.2-wt1
2 eulisse 1.24 ## INITENV SET APT_CONFIG %{i}/etc/apt.conf
3 eulisse 1.7
4 eulisse 1.10 Source: http://apt-rpm.org/releases/%n-%realversion.tar.bz2
5 eulisse 1.8 Source1: bootstrap
6 eulisse 1.5 Patch0: apt-rpm449
7 eulisse 1.9 Requires: libxml2 beecrypt rpm zlib bz2lib openssl
8 eulisse 1.5 %if "%(echo %{cmsos} | cut -d_ -f 2 | sed -e 's|.*64.*|64|')" == "64"
9     %define libdir lib64
10     %else
11     %define libdir lib
12     %endif
13 ratnik 1.1
14 eulisse 1.5 %prep
15     %setup -n %n-%{realversion}
16     %patch0 -p0
17 ratnik 1.1 %build
18 eulisse 1.5 export CPPFLAGS="-I$BEECRYPT_ROOT/include -I$RPM_ROOT/include -I$RPM_ROOT/include/rpm"
19     export LDFLAGS="-L$BEECRYPT_ROOT/%{libdir} -L$RPM_ROOT/%{libdir}"
20 eulisse 1.2 export LIBDIR="$LIBS"
21     export LIBXML2_CFLAGS="-I$LIBXML2_ROOT/include/libxml2 -I$BEECRYPT_ROOT/include -I$RPM_ROOT/include"
22 eulisse 1.5 export LIBXML2_LIBS="-lxml2 -L$LIBXML2_ROOT/lib -L$BEECRYPT_ROOT/%{libdir} -L$RPM_ROOT/%{libdir}"
23 ratnik 1.1
24 eulisse 1.2 ./configure --prefix=%{i} --exec-prefix=%{i} \
25     --disable-nls \
26     --disable-dependency-tracking \
27     --without-libintl-prefix \
28     --disable-rpath
29 eulisse 1.6 make %makeprocesses
30 eulisse 1.7
31    
32 eulisse 1.6 %install
33     make install
34     mkdir -p %{i}/etc/profile.d
35     (echo "#!/bin/sh"; \
36     echo "source $RPM_ROOT/etc/profile.d/init.sh"; \
37     echo "source $LIBXML2_ROOT/etc/profile.d/init.sh" ) > %{i}/etc/profile.d/dependencies-setup.sh
38     (echo "#!/bin/tcsh"; \
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 eulisse 1.7
42 eulisse 1.25 mkdir -p %{i}/etc/apt
43 eulisse 1.24 cat << \EOF_APT_CONF > %{i}/etc/apt.conf
44 eulisse 1.7 Dir "%{instroot}"
45     {
46     // Location of the state dir
47     State "%{cmsplatf}/var/lib/apt/"
48     {
49     lists "lists/";
50     xstatus "xstatus";
51     userstatus "status.user";
52     status "var/lib/dpkg/status";
53     cdroms "cdroms.list";
54     };
55    
56     // Location of the cache dir
57     Cache "%{cmsplatf}/var/lib/cache" {
58     archives "%{cmsplatf}";
59     srcpkgcache "srcpkgcache.bin";
60     pkgcache "pkgcache.bin";
61     };
62    
63     // Locations of binaries
64     Bin {
65 eulisse 1.25 methods "%{i}/%{libdir}/apt/methods/";
66 eulisse 1.7 gzip "/bin/gzip";
67     dpkg "/usr/bin/dpkg";
68     dpkg-source "/usr/bin/dpkg-source";
69     dpkg-buildpackage "/usr/bin/dpkg-buildpackage";
70 eulisse 1.25 apt-get "%{i}/bin/apt-get-wrapper";
71     apt-cache "%{i}/bin/apt-cache-wrapper";
72     rpm "%{i}/bin/rpm-wrapper";
73 eulisse 1.7 };
74    
75    
76     // Config files
77 eulisse 1.25 Etc "%{cmsplatf}/external/apt/%{realversion}/etc/" {
78 eulisse 1.7 sourcelist "sources.list";
79     main "apt.conf";
80     preferences "preferences";
81     };
82     };
83    
84     Debug::pkgProblemResolver="1";
85    
86     RPM
87     {
88     PM "external";
89     Options { "--define";"_rpmlock_path %{instroot}/%{cmsplatf}/var/lib/rpm/lock";"--dbpath";"%{instroot}/var/lib/rpm";"--nodeps";};
90     Install-Options { "--define";"_rpmlock_path %{instroot}/%{cmsplatf}/var/lib/rpm/lock";"--nodeps";"--force";"--dbpath";"%{instroot}/%{cmsplatf}/var/lib/rpm";"--prefix";"%{instroot}";};
91     RootDir "%{instroot}";
92     Architecture "%{cmsplatf}";
93     };
94     EOF_APT_CONF
95    
96 eulisse 1.25 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     cat << \EOF_RPMPRIORITIES > %{i}/etc/rpmpriorities
106     Essantial:
107    
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 $@
115     EOF_BIN_APT_CACHE_WRAPPER
116     chmod +x $RPM_INSTALL_PREFIX/bin/apt-cache-wrapper
117    
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 $@
123     EOF_BIN_APT_GET_WRAPPER
124     chmod +x $RPM_INSTALL_PREFIX/bin/apt-get-wrapper
125    
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 eulisse 1.16 cat %_sourcedir/bootstrap | perl -p -e "s!\@CMSPLATF\@!%{cmsplatf}!g;
141 eulisse 1.15 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 eulisse 1.8 " > %{instroot}/bootstrap-%{cmsplatf}.sh
167    
168 eulisse 1.6 %post
169 eulisse 1.8 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 eulisse 1.24 mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc
173 eulisse 1.8 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 eulisse 1.7
179 eulisse 1.6 %{relocateConfig}etc/profile.d/dependencies-setup.sh
180     %{relocateConfig}etc/profile.d/dependencies-setup.csh
181 eulisse 1.25 %{relocateConfig}bin/apt-cache-wrapper
182     %{relocateConfig}bin/apt-get-wrapper
183     %{relocateConfig}bin/rpm-wrapper
184     %{reloacteConfig}etc/apt/apt.conf
185 eulisse 1.8 %files
186     %{i}
187     %{instroot}/bootstrap-%{cmsplatf}.sh