forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bz2lib.spec
50 lines (45 loc) · 1.44 KB
/
bz2lib.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
### RPM external bz2lib 1.0.5
# Build system patches by Lassi A. Tuura <[email protected]>
Source: http://www.bzip.org/%{realversion}/bzip2-%{realversion}.tar.gz
%define cpu %(echo "%{cmsplatf}" | cut -f2 -d_)
Provides: libbz2.so.1
%if "%{cpu}" == "amd64"
Provides: libbz2.so.1()(64bit)
%endif
%define isdarwin %(case %{cmsos} in (osx*) echo 1 ;; (*) echo 0 ;; esac)
%prep
%setup -n bzip2-%{realversion}
sed -e 's/ -shared/ -dynamiclib/' \
-e 's/ -Wl,-soname -Wl,[^ ]*//' \
-e 's/libbz2\.so/libbz2.dylib/g' \
< Makefile-libbz2_so > Makefile-libbz2_dylib
%build
%if %isdarwin
so=dylib
%else
so=so
%endif
make %{makeprocesses} -f Makefile-libbz2_$so
%install
%if %isdarwin
so=dylib
%else
so=so
%endif
make install PREFIX=%{i}
# For bzip2 1.0.5, the library appears to retain the name libbz2.so.1.0.4
# rather than libbz2.so.1.0.5 as one would expect, so use this "tmpversion"
# instead of realversion
%define tmpversion 1.0.4
cp libbz2.${so}.%{tmpversion} %{i}/lib
ln -s libbz2.${so}.%{tmpversion} %{i}/lib/libbz2.$so
ln -s libbz2.${so}.%{tmpversion} %{i}/lib/libbz2.${so}.`echo %{tmpversion} | cut -d. -f 1,2`
ln -s libbz2.${so}.%{tmpversion} %{i}/lib/libbz2.${so}.`echo %{tmpversion} | cut -d. -f 1`
ln -sf bzdiff %{i}/bin/bzcmp
ln -sf bzgrep %{i}/bin/bzegrep
ln -sf bzgrep %{i}/bin/bzfgrep
ln -sf bzmore %{i}/bin/bzless
# Strip libraries, we are not going to debug them.
%define strip_files %{i}/lib
# Look up documentation online.
%define drop_files %{i}/man