1 |
< |
### RPM external rpm 4.4.6 |
2 |
< |
Source: http://wraptastic.org/pub/rpm-4.4.x/%n-%v.tar.gz |
3 |
< |
Requires: zlib |
1 |
> |
### RPM external rpm 4.4.2.2-CMS19c |
2 |
> |
## INITENV +PATH LD_LIBRARY_PATH %i/lib64 |
3 |
> |
## INITENV SET LIBRPMALIAS_FILENAME %{i}/lib/rpm/rpmpopt-%{realversion} |
4 |
> |
## INITENV SET LIBRPMRC_FILENAME %{i}/lib/rpm/rpmrc |
5 |
> |
## INITENV SET RPM_MACROFILES %{i}/lib/rpm/macros |
6 |
> |
## INITENV SET USRLIBRPM %{i}/lib/rpm |
7 |
> |
## INITENV SET RPMMAGIC %{i}/lib/rpm/magic |
8 |
> |
## INITENV SET RPMCONFIGDIR %{i}/lib/rpm |
9 |
> |
## INITENV SET SYSCONFIGDIR %{i}/lib/rpm |
10 |
> |
Source: http://rpm.org/releases/rpm-4.4.x/rpm-%{realversion}.tar.gz |
11 |
> |
#Source: http://rpm5.org/files/rpm/rpm-4.4/%n-%realversion.tar.gz |
12 |
> |
|
13 |
> |
%if "%cmsplatf" != "slc4onl_ia32_gcc346" |
14 |
> |
Requires: beecrypt bz2lib neon db4 expat elfutils zlib |
15 |
> |
%else |
16 |
> |
Requires: beecrypt bz2lib neon db4 expat elfutils |
17 |
> |
%endif |
18 |
> |
|
19 |
> |
|
20 |
> |
# The following two lines are a workaround for an issue seen with gcc4.1.2 |
21 |
> |
Provides: perl(Archive::Tar) |
22 |
> |
Provides: perl(Specfile) |
23 |
> |
|
24 |
> |
Patch0: rpm-4.4.9-enum |
25 |
> |
Patch1: rpm-4.4.9-rpmps |
26 |
> |
Patch2: rpm-4.4.9-popt |
27 |
> |
Patch3: rpm-4.4.9-macrofiles |
28 |
> |
Patch4: rpm-4.4.6 |
29 |
> |
Patch5: rpm-4.4.2.1 |
30 |
> |
Patch6: rpm-macosx |
31 |
> |
Patch7: rpm-4.4.2.2 |
32 |
> |
Patch8: rpm-4.4.2.2-leopard |
33 |
> |
Patch9: rpm-4.4.x-flcompress |
34 |
> |
Patch10: rpm-fix-static-declaration |
35 |
> |
|
36 |
> |
# Defaults here |
37 |
> |
%define libdir lib |
38 |
> |
%define soname so |
39 |
> |
|
40 |
> |
%if "%(echo %{cmsos} | cut -d_ -f 2 | sed -e 's|.*64.*|64|')" == "64" |
41 |
> |
%define libdir lib64 |
42 |
> |
%endif |
43 |
> |
|
44 |
> |
# On macosx SONAME is dylib |
45 |
> |
%if "%(echo %{cmsos} | cut -d_ -f 1 | sed -e 's|osx.*|osx|')" == "osx" |
46 |
> |
%define soname dylib |
47 |
> |
Provides: Kerberos |
48 |
> |
%endif |
49 |
> |
|
50 |
> |
%prep |
51 |
> |
%setup -n %n-%{realversion} |
52 |
> |
%if "%{realversion}" == "4.4.9" |
53 |
> |
%patch0 -p0 |
54 |
> |
%endif |
55 |
> |
|
56 |
> |
#%patch1 -p0 |
57 |
> |
|
58 |
> |
%if "%{realversion}" == "4.4.9" |
59 |
> |
%patch2 -p0 |
60 |
> |
%patch3 -p0 |
61 |
> |
%endif |
62 |
> |
|
63 |
> |
%if "%{realversion}" == "4.4.6" |
64 |
> |
%patch4 -p0 |
65 |
> |
%endif |
66 |
> |
|
67 |
> |
%if "%{realversion}" == "4.4.2.1" |
68 |
> |
%patch5 -p0 |
69 |
> |
%endif |
70 |
> |
|
71 |
> |
%patch6 -p1 |
72 |
> |
|
73 |
> |
%if "%{realversion}" == "4.4.2.2" |
74 |
> |
%patch7 -p1 |
75 |
> |
%endif |
76 |
> |
|
77 |
> |
echo %(echo %{cmsos} | cut -f1 -d_) |
78 |
> |
%if "%(echo %{cmsos} | cut -f1 -d_)" == "osx105" |
79 |
> |
%patch8 -p1 |
80 |
> |
%endif |
81 |
> |
|
82 |
> |
%patch9 -p1 |
83 |
> |
%patch10 -p1 |
84 |
> |
|
85 |
> |
rm -rf neon sqlite beecrypt elfutils zlib |
86 |
> |
|
87 |
|
%build |
88 |
< |
./configure --prefix=%i --without-selinux --without-lua --without-python -without-libintl |
89 |
< |
make %makeprocesses |
88 |
> |
export CFLAGS="-fPIC -g -O0" |
89 |
> |
export CPPFLAGS="-I$BEECRYPT_ROOT/include -I$BEECRYPT_ROOT/include/beecrypt -I$BZ2LIB_ROOT/include -I$NEON_ROOT/include/neon -I$DB4_ROOT/include -I$EXPAT_ROOT/include/expat -I$ELFUTILS_ROOT/include -I$ZLIB_ROOT/include" |
90 |
> |
export LDFLAGS="-L$BEECRYPT_ROOT/%libdir -L$BZ2LIB_ROOT/lib -L$NEON_ROOT/lib -L$DB4_ROOT/lib -L$EXPAT_ROOT/%libdir -L$ELFUTILS_ROOT/lib -L$ZLIB_ROOT/lib -lz -lexpat -lbeecrypt -lbz2 -lneon -lpthread" |
91 |
> |
#FIXME: this does not seem to work and we still get /usr/bin/python in some of the files. |
92 |
> |
export __PYTHON="/usr/bin/env python" |
93 |
> |
perl -p -i -e "s|\@WITH_NEON_LIB\@|$NEON_ROOT/lib/libneon.a|; |
94 |
> |
s|^.*WITH_SELINUX.*$||; |
95 |
> |
s|-lselinux||; |
96 |
> |
" `find . -name \*.in` |
97 |
> |
perl -p -i -e "s|#undef HAVE_NEON_NE_GET_RESPONSE_HEADER|#define HAVE_NEON_NE_GET_RESPONSE_HEADER 1|; |
98 |
> |
s|#undef HAVE_BZ2_1_0|#define HAVE_BZ2_1_0|; |
99 |
> |
s|#undef HAVE_GETPASSPHRASE||; |
100 |
> |
s|#undef HAVE_LUA||;" config.h.in |
101 |
> |
#perl -p -i -e 's%^(WITH_DB_SUBDIR|WITH_INTERNAL_DB|DBLIBSRCS)%#$1%' configure |
102 |
> |
case `uname` in |
103 |
> |
Darwin*) |
104 |
> |
perl -p -i -e s'![\t]\@WITH_ZLIB_LIB\@!!' Makefile.in |
105 |
> |
;; |
106 |
> |
esac |
107 |
> |
|
108 |
> |
varprefix=%{instroot}/%{cmsplatf}/var ./configure --prefix=%i --disable-nls --without-selinux --without-python --without-libintl --without-perl --with-zlib-includes=$ZLIB_ROOT/include --with-zlib-lib=$ZLIB_ROOT/lib/libz.%soname --without-lua |
109 |
> |
perl -p -i -e "s|lua||" Makefile |
110 |
> |
|
111 |
> |
#this does nothing...(cd zlib; make) |
112 |
> |
if ! make %makeprocesses |
113 |
> |
then |
114 |
> |
# Very ugly hack to get rid of any kind of automatically generated dependecy on /usr/lib/beecrypt. |
115 |
> |
toBePatched=`grep -R -e '/usr/lib[6]*[4]*/[^ ]*.la' . | grep "\.la" | cut -f1 -d:` |
116 |
> |
if [ "X$toBePatched" != X ] |
117 |
> |
then |
118 |
> |
perl -p -i -e 's|/usr/lib[6]*[4]*/[^ ]*.la||' $toBePatched |
119 |
> |
make %makeprocesses |
120 |
> |
fi |
121 |
> |
fi |
122 |
> |
perl -p -i -e "s|#\!.*perl(.*)|#!/usr/bin/env perl$1|" scripts/get_magic.pl \ |
123 |
> |
scripts/rpmdiff.cgi \ |
124 |
> |
scripts/cpanflute2 \ |
125 |
> |
scripts/perldeps.pl \ |
126 |
> |
db/dist/camelize.pl |
127 |
> |
|
128 |
> |
|
129 |
> |
%install |
130 |
> |
make install |
131 |
> |
perl -p -i -e "s|#\!/usr/bin/python(.*)|#!/usr/bin/env python$1|" %i/lib/rpm/symclash.py |
132 |
> |
# The following patches the rpmrc to make sure that rpm macros are only picked up from |
133 |
> |
# what we distribute and not /etc or ~/ |
134 |
> |
perl -p -i -e "s!:/etc/[^:]*!!g; |
135 |
> |
s!~/[^:]*!!g" %i/lib/rpm/rpmrc |
136 |
> |
|
137 |
> |
# This is for compatibility with rpm 4.3.3 |
138 |
> |
perl -p -i -e "s!^.buildroot!#%%buildroot!; |
139 |
> |
s!^%%_repackage_dir.*/var/spool/repackage!%%_repackage_dir %{instroot}/%{cmsplatf}/var/spool/repackage!" %i/lib/rpm/macros |
140 |
> |
|
141 |
> |
# Removes any reference to /usr/lib/rpm in lib/rpm |
142 |
> |
perl -p -i -e 's|/usr/lib/rpm([^a-zA-Z])|%{i}/lib/rpm$1|g' \ |
143 |
> |
%{i}/lib/rpm/check-rpaths \ |
144 |
> |
%{i}/lib/rpm/check-rpaths-worker \ |
145 |
> |
%{i}/lib/rpm/cpanflute \ |
146 |
> |
%{i}/lib/rpm/cpanflute2 \ |
147 |
> |
%{i}/lib/rpm/cross-build \ |
148 |
> |
%{i}/lib/rpm/find-debuginfo.sh \ |
149 |
> |
%{i}/lib/rpm/find-provides.perl \ |
150 |
> |
%{i}/lib/rpm/find-requires.perl \ |
151 |
> |
%{i}/lib/rpm/freshen.sh \ |
152 |
> |
%{i}/lib/rpm/perldeps.pl \ |
153 |
> |
%{i}/lib/rpm/rpmdb_loadcvt \ |
154 |
> |
%{i}/lib/rpm/rpmrc \ |
155 |
> |
%{i}/lib/rpm/trpm \ |
156 |
> |
%{i}/lib/rpm/vpkg-provides.sh \ |
157 |
> |
%{i}/lib/rpm/vpkg-provides2.sh |
158 |
> |
|
159 |
> |
# Changes the shebang from /usr/bin/perl to /usr/bin/env perl |
160 |
> |
perl -p -i -e 's|^#[!]/usr/bin/perl(.*)|#!/usr/bin/env perl$1|' \ |
161 |
> |
%{i}/lib/rpm/perl.prov \ |
162 |
> |
%{i}/lib/rpm/perl.req \ |
163 |
> |
%{i}/lib/rpm/rpmdiff \ |
164 |
> |
%{i}/lib/rpm/sql.prov \ |
165 |
> |
%{i}/lib/rpm/sql.req \ |
166 |
> |
%{i}/lib/rpm/tcl.req \ |
167 |
> |
%{i}/lib/rpm/magic.prov \ |
168 |
> |
%{i}/lib/rpm/magic.req \ |
169 |
> |
%{i}/lib/rpm/cpanflute |
170 |
> |
|
171 |
> |
mkdir -p %{instroot}/%{cmsplatf}/var/spool/repackage |
172 |
> |
|
173 |
> |
# Generates the dependencies-setup.sh/dependencies-setup.csh |
174 |
> |
# which is automatically sourced by init.sh/init.csh, providing |
175 |
> |
# the environment for all the dependencies. |
176 |
> |
mkdir -p %{i}/etc/profile.d |
177 |
> |
|
178 |
> |
echo '#!/bin/sh' > %{i}/etc/profile.d/dependencies-setup.sh |
179 |
> |
echo '#!/bin/tcsh' > %{i}/etc/profile.d/dependencies-setup.csh |
180 |
> |
echo requiredtools `echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'` |
181 |
> |
for tool in `echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'` |
182 |
> |
do |
183 |
> |
case X$tool in |
184 |
> |
Xdistcc|Xccache ) |
185 |
> |
;; |
186 |
> |
* ) |
187 |
> |
toolcap=`echo $tool | tr a-z- A-Z_` |
188 |
> |
eval echo ". $`echo ${toolcap}_ROOT`/etc/profile.d/init.sh" >> %{i}/etc/profile.d/dependencies-setup.sh |
189 |
> |
eval echo "source $`echo ${toolcap}_ROOT`/etc/profile.d/init.csh" >> %{i}/etc/profile.d/dependencies-setup.csh |
190 |
> |
;; |
191 |
> |
esac |
192 |
> |
done |
193 |
> |
|
194 |
> |
perl -p -i -e 's|\. /etc/profile\.d/init\.sh||' %{i}/etc/profile.d/dependencies-setup.sh |
195 |
> |
perl -p -i -e 's|source /etc/profile\.d/init\.csh||' %{i}/etc/profile.d/dependencies-setup.csh |
196 |
> |
|
197 |
> |
ln -sf rpm/rpmpopt-%{realversion} %i/lib/rpmpopt |
198 |
> |
|
199 |
> |
# Remove some of the path macros defined in macros since they could come |
200 |
> |
# from different places (e.g. from system or from macports) and this would |
201 |
> |
# lead to problems if a developer with macports builds a bootstrap package set. |
202 |
> |
for shellUtil in tar cat chgrp chmod chown cp file gpg id make mkdir mv pgp rm rsh sed ssh gzip cpio perl unzip patch grep |
203 |
> |
do |
204 |
> |
perl -p -i -e "s|^%__$shellUtil\s(.*)|%__$shellUtil $shellUtil|" %i/lib/rpm/macros |
205 |
> |
done |
206 |
> |
|
207 |
> |
%post |
208 |
> |
%{relocateConfig}etc/profile.d/dependencies-setup.sh |
209 |
> |
%{relocateConfig}etc/profile.d/dependencies-setup.csh |
210 |
> |
%{relocateConfig}lib/rpm/check-rpaths |
211 |
> |
%{relocateConfig}lib/rpm/check-rpaths-worker |
212 |
> |
%{relocateConfig}lib/rpm/cpanflute |
213 |
> |
%{relocateConfig}lib/rpm/cpanflute2 |
214 |
> |
%{relocateConfig}lib/rpm/cross-build |
215 |
> |
%{relocateConfig}lib/rpm/find-debuginfo.sh |
216 |
> |
%{relocateConfig}lib/rpm/find-provides.perl |
217 |
> |
%{relocateConfig}lib/rpm/find-requires.perl |
218 |
> |
%{relocateConfig}lib/rpm/freshen.sh |
219 |
> |
%{relocateConfig}lib/rpm/perldeps.pl |
220 |
> |
%{relocateConfig}lib/rpm/rpmdb_loadcvt |
221 |
> |
%{relocateConfig}lib/rpm/rpmrc |
222 |
> |
%{relocateConfig}lib/rpm/trpm |
223 |
> |
%{relocateConfig}lib/rpm/vpkg-provides.sh |
224 |
> |
%{relocateConfig}lib/rpm/vpkg-provides2.sh |
225 |
> |
perl -p -i -e "s|%instroot|$RPM_INSTALL_PREFIX|g" `grep -r %instroot $RPM_INSTALL_PREFIX/%pkgrel | grep -v Binary | cut -d: -f1 | sort | uniq` |
226 |
> |
%files |
227 |
> |
%{i} |
228 |
> |
%{instroot}/%{cmsplatf}/var/spool/repackage |