forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap-bundle.spec
53 lines (45 loc) · 1.59 KB
/
bootstrap-bundle.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
### RPM external bootstrap-bundle 1.0
## INITENV SET MAGIC %{i}/share/magic.mgc
## NOCOMPILER
BuildRequires: gcc
BuildRequires: bz2lib-bootstrap db4-bootstrap file-bootstrap libxml2-bootstrap lua-bootstrap nspr-bootstrap nss-bootstrap
BuildRequires: openssl-bootstrap popt-bootstrap sqlite-bootstrap zlib-bootstrap
%define keep_archives true
%define isamd64 %(case %{cmsplatf} in (*amd64*|*_mic_*) echo 1 ;; (*) echo 0 ;; esac)
%define ismac %(case %{cmsplatf} in (osx*) echo 1 ;; (*) echo 0 ;; esac)
%define soname so
%if %ismac
%define soname dylib
%endif
%define libdir lib
%if %isamd64
%define libdir lib64
%endif
%prep
%build
%install
mkdir %{i}/bin %{i}/lib %{i}/include %{i}/share %{i}/tmp
for tool in `echo %{buildrequiredtools} | tr ' ' '\n' | grep '\-bootstrap$'`; do
toolcap=`echo $tool | tr a-z- A-Z_`
toolbase=`eval echo \\$${toolcap}_ROOT`
for sdir in bin lib include ; do
[ -d ${toolbase}/${sdir} ] || continue
rsync -r --links --ignore-existing ${toolbase}/${sdir}/ %{i}/${sdir}/
done
done
cp -r ${FILE_BOOTSTRAP_ROOT}/share/misc/magic.mgc %{i}/share
rm -f %{i}/bin/xml2-config %{i}/lib/xml2Conf.sh
#Bundle libstd and libgcc_s and libelf
%if %ismac
cp -P $GCC_ROOT/lib/lib{stdc++,gcc_s}*.%{soname} %{i}/lib
%else
cp -P $GCC_ROOT/%{libdir}/lib{stdc++,gcc_s}.%{soname}* %{i}/lib
cp -P $GCC_ROOT/lib/libelf.%{soname}* %{i}/lib
cp -P $GCC_ROOT/lib/libelf-*.%{soname} %{i}/lib
%endif
find %{i}/bin -type f -perm -a+x -exec %strip {} \;
find %{i}/lib -type f -perm -a+x -exec %strip {} \;
mv %{i}/lib/lib{lua,magic}.a %{i}/tmp
rm -f %{i}/lib/*.{l,}a
mv %{i}/tmp/lib* %{i}/lib/
rm -rf %{i}/tmp