forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap-bundle.spec
58 lines (49 loc) · 1.79 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 1.7
## INITENV +PATH PATH %{i}/bin
## NOCOMPILER
BuildRequires: gcc
BuildRequires: db6-bootstrap lua-bootstrap
BuildRequires: openssl-bootstrap xz-bootstrap libarchive-bootstrap
%define keep_archives true
%define is64bit %(case %{cmsplatf} in (*_amd64_*|*_mic_*|*_aarch64_*|*_ppc64le_*|*_ppc64_*) 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 %is64bit
%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
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 -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