forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap-bundle.spec
58 lines (51 loc) · 1.83 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
54
55
56
57
58
### RPM external bootstrap-bundle 3.0
## NO_AUTO_DEPENDENCY
## NOCOMPILER
BuildRequires: gcc
BuildRequires: db6-bootstrap lua-bootstrap file-bootstrap
BuildRequires: xz-bootstrap libarchive-bootstrap
%define keep_archives true
%define libdir lib64
%define soname so
%ifos darwin
%define soname dylib
%endif
%prep
%build
%install
mkdir -p %{i}/bin %{i}/lib %{i}/include %{i}/share %{i}/tmp %{i}/etc/profile.d
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
mkdir %{i}/share/misc
cp ${FILE_BOOTSTRAP_ROOT}/share/misc/magic.mgc %{i}/share/misc/magic.mgc
rm -f %{i}/bin/xml2-config %{i}/lib/xml2Conf.sh
%if 0%{!?use_system_gcc:1}
#Bundle libstd and libgcc_s and libelf
%ifos darwin
cp -P $GCC_ROOT/lib/lib{stdc++,gcc_s}*.%{soname} %{i}/lib
%else
cp -P $GCC_ROOT/%{libdir}/lib{stdc++,gcc_s,gomp}.%{soname}* %{i}/lib
cp -P $GCC_ROOT/lib/libelf.%{soname}* %{i}/lib
cp -P $GCC_ROOT/lib/libelf-*.%{soname} %{i}/lib
cp -P $GCC_ROOT/lib/libdw.%{soname}* %{i}/lib
cp -P $GCC_ROOT/lib/libdw-*.%{soname} %{i}/lib
cp -P $GCC_ROOT/bin/readelf %{i}/bin
%endif
%endif
find %{i}/bin -type f -writable -exec %{strip} {} \;
# Do not strip archives, otherwise index of contents will be lost on newer binutils
# and an extra step (ranlib) would be required
find %{i}/lib -type f ! -name '*.a' -writable -exec %{strip} {} \;
# All shared libraries on RH/Fedora are installed with 0755
# RPM requires it to generate requires/provides also (otherwise it ignores the files)
find %{i}/lib -type f | xargs chmod 0755
mv %{i}/lib/lib{lua,archive}.a %{i}/tmp
rm -f %{i}/lib/*.{l,}a
mv %{i}/tmp/lib* %{i}/lib/
rm -rf %{i}/tmp