From daf949f6f409dd3c4d3ccf6164996fd1ef6b3ffe Mon Sep 17 00:00:00 2001 From: "Tom G. Christensen" Date: Fri, 9 Jan 2004 09:49:01 +0000 Subject: [PATCH] A good bzip2 package which includes a shared library (needed for bzip2 support in PHP). Needed at small patch to link the DSO since Solaris ld is too braindead to understand -soname. --- bzip2/build.sh | 118 ++++++++++++++++++ bzip2/meta/pkginfo.in | 11 ++ .../src/bzip2-braindead-solaris-linker.patch | 11 ++ 3 files changed, 140 insertions(+) create mode 100755 bzip2/build.sh create mode 100644 bzip2/meta/pkginfo.in create mode 100644 bzip2/src/bzip2-braindead-solaris-linker.patch diff --git a/bzip2/build.sh b/bzip2/build.sh new file mode 100755 index 0000000..2567144 --- /dev/null +++ b/bzip2/build.sh @@ -0,0 +1,118 @@ +#!/bin/bash +# +# This is a generic build.sh script +# It can be used nearly unmodified with many packages +# +# The concept of "method" registering and the logic that implements it was shamelessly +# stolen from jhlj's Compile.sh script :) +# +# Check the following 4 variables before running the script +topdir=bzip2 +version=1.0.2 +pkgver=1 +source[0]=$topdir-$version.tar.gz +# If there are no patches, simply comment this +patch[0]=bzip2-braindead-solaris-linker.patch + +# Source function library +. ${BUILDPKG_BASE}/scripts/buildpkg.functions + +# Fill in pkginfo values if necessary +# using pkgname,name,pkgcat,pkgvendor & pkgdesc +name="bzip2" +pkgcat="application" +pkgvendor="http://sources.redhat.com/bzip2/" +pkgdesc="A freely available, high-quality data compressor" + +# Define script functions and register them +METHODS="" +reg() { + METHODS="$METHODS $1" +} + +reg prep +prep() +{ + generic_prep +} + +reg build +build() +{ + setdir source + $MAKE_PROG -f Makefile-libbz2_so CFLAGS="-O2 -pipe -mcpu=ultrasparc -mtune=ultrasparc -D_FILE_OFFSET_BITS=64 -fpic -fPIC" all + $MAKE_PROG -f Makefile CFLAGS="-O2 -pipe -mcpu=ultrasparc -mtune=ultrasparc -D_FILE_OFFSET_BITS=64" all +} + +reg install +install() +{ + generic_install PREFIX + setdir source + $MKDIR -p $stagedir/share/doc/$topdir-$version + DOCS="LICENSE CHANGES README README.COMPILATION.PROBLEMS Y2K_INFO" + for i in $DOCS + do + $CP $i $stagedir/share/doc/$topdir-$version + done + $CP libbz2.so* $stagedir/lib + $RM $stagedir/lib/libbz2.a + setdir $stagedir/lib + ln -sf libbz2.so.1.0.2 libbz2.so.1.0 + ln -sf libbz2.so.1.0 libbz2.so +} + +reg pack +pack() +{ + generic_pack shortroot +} + +reg distclean +distclean() +{ + clean distclean +} + +################################################### +# No need to look below here +################################################### + +reg all +all() +{ + for METHOD in $METHODS + do + case $METHOD in + all*|*clean) ;; + *) $METHOD + ;; + esac + done + +} + +reg +usage() { + echo Usage $0 "{"$(echo $METHODS | tr " " "|")"}" + exit 1 +} + +OK=0 +for METHOD in $* +do + METHOD=" $METHOD *" + if [ "${METHODS%$METHOD}" == "$METHODS" ] ; then + usage + fi + OK=1 +done + +if [ $OK = 0 ] ; then + usage; +fi + +for METHOD in $* +do + ( $METHOD ) +done diff --git a/bzip2/meta/pkginfo.in b/bzip2/meta/pkginfo.in new file mode 100644 index 0000000..95b0128 --- /dev/null +++ b/bzip2/meta/pkginfo.in @@ -0,0 +1,11 @@ +PKG="%%pkgname%%" +NAME="%%name%%" +ARCH="sparc" +VERSION="%%version%%" +CATEGORY="%%pkgcat%%" +VENDOR="%%pkgvendor%%" +EMAIL="Tom G. Christenen - tgc@statsbiblioteket.dk" +PSTAMP="%%pkgver%%" +BASEDIR="%%topinstalldir%%" +CLASSES="none" +DESC="%%pkgdesc%%" diff --git a/bzip2/src/bzip2-braindead-solaris-linker.patch b/bzip2/src/bzip2-braindead-solaris-linker.patch new file mode 100644 index 0000000..4a73846 --- /dev/null +++ b/bzip2/src/bzip2-braindead-solaris-linker.patch @@ -0,0 +1,11 @@ +--- bzip2-1.0.2/Makefile-libbz2_so.orig 2004-01-09 10:17:44.310014000 +0100 ++++ bzip2-1.0.2/Makefile-libbz2_so 2004-01-09 10:17:57.600005000 +0100 +@@ -20,7 +20,7 @@ + bzlib.o + + all: $(OBJS) +- $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.2 $(OBJS) ++ $(CC) -shared -Wl,-h -Wl,libbz2.so.1.0 -o libbz2.so.1.0.2 $(OBJS) + $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.2 + rm -f libbz2.so.1.0 + ln -s libbz2.so.1.0.2 libbz2.so.1.0