ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/apt.spec
Revision: 1.76
Committed: Mon Nov 26 16:51:51 2007 UTC (17 years, 5 months ago) by elmer
Branch: MAIN
CVS Tags: CMSSW_1_8_0_pre4-412, pe20071205b-for180p4-412, CMSSW_1_8_0_pre3a-412, pe20071202-for180p3a-gcc412, pe20071127a-ports-412
Changes since 1.75: +1 -1 lines
Log Message:
Update to -CMS18c

File Contents

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