ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/apt.spec
Revision: 1.45
Committed: Fri Jul 6 16:42:43 2007 UTC (17 years, 9 months ago) by eulisse
Branch: MAIN
Changes since 1.44: +4 -0 lines
Log Message:
* now works on macosx.

File Contents

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