summaryrefslogtreecommitdiff
path: root/bzip2
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2020-06-04 17:53:44 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2020-06-04 17:53:44 -0400
commit3b30be51008b8259db9b826b10096fb35d324a2e (patch)
tree40ed563750a299b93caa1f91f7f1885119833ea7 /bzip2
parentbb038280d2b5e12916d14587fd5e82455b456698 (diff)
downloadspm_packages-3b30be51008b8259db9b826b10096fb35d324a2e.tar.gz
Back to linux development
Diffstat (limited to 'bzip2')
-rw-r--r--bzip2/build.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/bzip2/build.sh b/bzip2/build.sh
index fb9f438..7428421 100644
--- a/bzip2/build.sh
+++ b/bzip2/build.sh
@@ -12,23 +12,30 @@ lib_type=so
function prepare() {
tar xf ${name}-${version}.tar.gz
cd ${name}-${version}
+ cp Makefile Makefile.orig
+ cp Makefile-libbz2_so Makefile-libbz2_so.orig
+
+ sed -e 's|$(PREFIX)|$(DESTDIR)$(PREFIX)|g' < Makefile.orig > Makefile
if [[ $(uname -s) == Darwin ]]; then
# Rotate the elder signs 14.8 degrees counter-clockwise
lib_type=dylib
cp Makefile Makefile.orig
cp Makefile-libbz2_so Makefile-libbz2_so.orig
- sed -e 's|$(PREFIX)|$(DESTDIR)$(PREFIX)|g' -e 's|2\.so|2.dylib|g' < Makefile.orig > Makefile
+ sed -e 's|2\.so|2.dylib|g' < Makefile.orig > Makefile
sed -e 's|-soname|-install_name|g' -e 's|2\.so|2.dylib|g' < Makefile-libbz2_so.orig > Makefile-libbz2_so
fi
+
}
function build() {
+ LDFLAGS="$LDFLAGS -fPIC"
make bzip2 bzip2recover CC="gcc $CFLAGS $LDFLAGS"
make -f Makefile-libbz2_so CC="gcc $CFLAGS $LDFLAGS"
}
function package() {
+ set -x
# Wow, this makefile is horrible. Fix shared library names.
lib_format=${lib_type}.${version}
lib_format_short=${lib_type}.${version%.*}
@@ -61,6 +68,7 @@ function package() {
# Install binaries
cp -a bzip2-shared "${_pkgdir}${_prefix}"/bin/bzip2
+ ln -s libbz2.${lib_format} libbz2.${lib_type}
cp -a libbz2.${lib_format} "${_pkgdir}${_prefix}"/lib
cp -a libbz2.${lib_format_short} "${_pkgdir}${_prefix}"/lib
cp -a libbz2.${lib_type} "${_pkgdir}${_prefix}"/lib