ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/apt.spec
Revision: 1.73
Committed: Thu Nov 22 22:44:31 2007 UTC (17 years, 5 months ago) by elmer
Branch: MAIN
CVS Tags: pe20071123a-ports-422, pe20071123a-ports-412, pe20071123a-ports
Changes since 1.72: +1 -1 lines
Log Message:
Update to 0.5.15lorg3.2-CMS18 (again, with Giulio's latest fixes/changes)

File Contents

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