ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/apt.spec
Revision: 1.30
Committed: Fri Jun 22 08:17:01 2007 UTC (17 years, 10 months ago) by eulisse
Branch: MAIN
CVS Tags: ge20070622
Changes since 1.29: +3 -0 lines
Log Message:
* Revision bump
* compiling apt with -g option.

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.30 export CFLAGS="-O2 -g"
19     export CXXFLAGS="-O2 -g"
20 eulisse 1.5 export CPPFLAGS="-I$BEECRYPT_ROOT/include -I$RPM_ROOT/include -I$RPM_ROOT/include/rpm"
21     export LDFLAGS="-L$BEECRYPT_ROOT/%{libdir} -L$RPM_ROOT/%{libdir}"
22 eulisse 1.2 export LIBDIR="$LIBS"
23     export LIBXML2_CFLAGS="-I$LIBXML2_ROOT/include/libxml2 -I$BEECRYPT_ROOT/include -I$RPM_ROOT/include"
24 eulisse 1.5 export LIBXML2_LIBS="-lxml2 -L$LIBXML2_ROOT/lib -L$BEECRYPT_ROOT/%{libdir} -L$RPM_ROOT/%{libdir}"
25 ratnik 1.1
26 eulisse 1.2 ./configure --prefix=%{i} --exec-prefix=%{i} \
27     --disable-nls \
28     --disable-dependency-tracking \
29     --without-libintl-prefix \
30     --disable-rpath
31 eulisse 1.6 make %makeprocesses
32 eulisse 1.7
33    
34 eulisse 1.6 %install
35     make install
36     mkdir -p %{i}/etc/profile.d
37     (echo "#!/bin/sh"; \
38     echo "source $RPM_ROOT/etc/profile.d/init.sh"; \
39     echo "source $LIBXML2_ROOT/etc/profile.d/init.sh" ) > %{i}/etc/profile.d/dependencies-setup.sh
40     (echo "#!/bin/tcsh"; \
41     echo "source $RPM_ROOT/etc/profile.d/init.csh"; \
42     echo "source $LIBXML2_ROOT/etc/profile.d/init.csh" ) > %{i}/etc/profile.d/dependencies-setup.csh
43 eulisse 1.7
44 eulisse 1.25 mkdir -p %{i}/etc/apt
45 eulisse 1.24 cat << \EOF_APT_CONF > %{i}/etc/apt.conf
46 eulisse 1.7 Dir "%{instroot}"
47     {
48     // Location of the state dir
49     State "%{cmsplatf}/var/lib/apt/"
50     {
51     lists "lists/";
52     xstatus "xstatus";
53     userstatus "status.user";
54     status "var/lib/dpkg/status";
55     cdroms "cdroms.list";
56     };
57    
58     // Location of the cache dir
59     Cache "%{cmsplatf}/var/lib/cache" {
60     archives "%{cmsplatf}";
61     srcpkgcache "srcpkgcache.bin";
62     pkgcache "pkgcache.bin";
63     };
64    
65     // Locations of binaries
66     Bin {
67 eulisse 1.28 methods "%{i}/lib/apt/methods/";
68 eulisse 1.7 gzip "/bin/gzip";
69     dpkg "/usr/bin/dpkg";
70     dpkg-source "/usr/bin/dpkg-source";
71     dpkg-buildpackage "/usr/bin/dpkg-buildpackage";
72 eulisse 1.25 apt-get "%{i}/bin/apt-get-wrapper";
73     apt-cache "%{i}/bin/apt-cache-wrapper";
74     rpm "%{i}/bin/rpm-wrapper";
75 eulisse 1.7 };
76    
77    
78     // Config files
79 eulisse 1.28 Etc "%{cmsplatf}/external/apt/%{v}/etc/" {
80 eulisse 1.7 sourcelist "sources.list";
81     main "apt.conf";
82     preferences "preferences";
83     };
84     };
85    
86     Debug::pkgProblemResolver="1";
87    
88     RPM
89     {
90     PM "external";
91     Options { "--define";"_rpmlock_path %{instroot}/%{cmsplatf}/var/lib/rpm/lock";"--dbpath";"%{instroot}/var/lib/rpm";"--nodeps";};
92     Install-Options { "--define";"_rpmlock_path %{instroot}/%{cmsplatf}/var/lib/rpm/lock";"--nodeps";"--force";"--dbpath";"%{instroot}/%{cmsplatf}/var/lib/rpm";"--prefix";"%{instroot}";};
93     RootDir "%{instroot}";
94     Architecture "%{cmsplatf}";
95     };
96     EOF_APT_CONF
97    
98 eulisse 1.25 cat << \EOF_SOURCES_LIST > %{i}/etc/sources.list
99     rpm http://cmsrep.cern.ch cms/cpt/Software/download/cms.eulisse/apt/%{cmsplatf} cms lcg external
100     rpm-src http://cmsrep.cern.ch cms/cpt/Software/download/cms.eulisse/apt/%{cmsplatf} cms lcg external
101     # This are defined to support experimental repositories. The bootstrap file rewrites and uncomments
102     # them when passed the appropriate commandline option.
103     ## rpm @SERVER@ @SERVER_PATH@/@REPOSITORY@/apt/%{cmsplatf} @GROUPS@
104     ## rpm-src @SERVER@ @SERVER_PATH@/@REPOSITORY@/apt/%{cmsplatf} @GROUPS@
105     EOF_SOURCES_LIST
106    
107     cat << \EOF_RPMPRIORITIES > %{i}/etc/rpmpriorities
108     Essantial:
109    
110     EOF_RPMPRIORITIES
111    
112     cat << \EOF_BIN_APT_CACHE_WRAPPER > %{i}/bin/apt-cache-wrapper
113     #!/bin/sh
114     touch %{instroot}/log.txt
115     echo $@ >> %{instroot}/log.txt
116     apt-cache $@
117     EOF_BIN_APT_CACHE_WRAPPER
118 eulisse 1.26 chmod +x %{i}/bin/apt-cache-wrapper
119 eulisse 1.25
120     cat << \EOF_BIN_APT_GET_WRAPPER > %{i}/bin/apt-get-wrapper
121     #!/bin/sh
122     touch %{instroot}/log.txt
123     echo $@ >> %{instroot}/log.txt
124     apt-get $@
125     EOF_BIN_APT_GET_WRAPPER
126 eulisse 1.26 chmod +x %{i}/bin/apt-get-wrapper
127 eulisse 1.25
128     cat << \EOF_BIN_RPM > %{i}/bin/rpm-wrapper
129     #!/bin/sh
130     if [ X"$(id -u)" = X0 ]; then
131     echo "*** CMS SOFTWARE INSTALLATION ABORTED ***" 1>&2
132     echo "CMS software cannot be installed as the super-user." 1>&2
133     echo "(We recommend reading any standard unix security guide.)" 1>&2
134     exit 1
135     fi
136     touch %{instroot}/log.txt
137     echo rpm ${1+"$@"} >> %{instroot}/log.txt
138     exec rpm ${1+"$@"}
139     EOF_BIN_RPM
140     chmod +x %{i}/bin/rpm-wrapper
141    
142 eulisse 1.16 cat %_sourcedir/bootstrap | perl -p -e "s!\@CMSPLATF\@!%{cmsplatf}!g;
143 eulisse 1.15 s!\@GCC_VERSION\@!$GCC_VERSION!g;
144     s!\@RPM_VERSION\@!$RPM_VERSION!g;
145     s!\@DB4_VERSION\@!$DB4_VERSION!g;
146     s!\@LIBXML2_VERSION\@!$LIBXML2_VERSION!g;
147     s!\@OPENSSL_VERSION\@!$OPENSSL_VERSION!g;
148     s!\@BEECRYPT_VERSION\@!$BEECRYPT_VERSION!g;
149     s!\@BZ2LIB_VERSION\@!$BZ2LIB_VERSION!g;
150     s!\@ZLIB_VERSION\@!$ZLIB_VERSION!g;
151     s!\@EXPAT_VERSION\@!$EXPAT_VERSION!g;
152     s!\@ELFUTILS_VERSION\@!$ELFUTILS_VERSION!g;
153     s!\@NEON_VERSION\@!$NEON_VERSION!g;
154     s!\@GCC_REVISION\@!$GCC_REVISION!g;
155     s!\@BEECRYPT_REVISION\@!$BEECRYPT_REVISION!g;
156     s!\@RPM_REVISION\@!$RPM_REVISION!g;
157     s!\@OPENSSL_REVISION\@!$OPENSSL_REVISION!g;
158     s!\@DB4_REVISION\@!$DB4_REVISION!g;
159     s!\@LIBXML2_REVISION\@!$LIBXML2_REVISION!g;
160     s!\@BZ2LIB_REVISION\@!$BZ2LIB_REVISION!g;
161     s!\@ZLIB_REVISION\@!$ZLIB_REVISION!g;
162     s!\@EXPAT_REVISION\@!$EXPAT_REVISION!g;
163     s!\@NEON_REVISION\@!$NEON_REVISION!g;
164     s!\@ELFUTILS_REVISION\@!$ELFUTILS_REVISION!g;
165     s!\@APT_VERSION\@!%{v}!g;
166     s!\@APT_REVISION\@!%{pkgrevision}!g;
167     s!\@INSTROOT\@!%{instroot}!g;
168 eulisse 1.26 " > %{i}/bin/bootstrap-%{cmsplatf}.sh
169 eulisse 1.8
170 eulisse 1.6 %post
171 eulisse 1.8 mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/apt/lists/partial
172     mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/rpm
173     mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/cache/%{cmsplatf}/partial
174 eulisse 1.24 mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc
175 eulisse 1.8 mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/etc/rpm
176     mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/lib/apt/methods
177     mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/dpkg/status
178     mkdir -p $RPM_INSTALL_PREFIX/bin
179     mkdir -p $RPM_INSTALL_PREFIX/%{cmsplatf}/var/lib/cache/%{cmsplatf}
180 eulisse 1.6 %{relocateConfig}etc/profile.d/dependencies-setup.sh
181     %{relocateConfig}etc/profile.d/dependencies-setup.csh
182 eulisse 1.25 %{relocateConfig}bin/apt-cache-wrapper
183     %{relocateConfig}bin/apt-get-wrapper
184     %{relocateConfig}bin/rpm-wrapper
185 eulisse 1.29 %{relocateConfig}etc/apt.conf
186 eulisse 1.30