ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/apt.spec
(Generate patch)

Comparing COMP/CMSDIST/apt.spec (file contents):
Revision 1.1 by ratnik, Wed Aug 2 23:48:14 2006 UTC vs.
Revision 1.67 by eulisse, Fri Jul 27 09:39:48 2007 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines