summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Staal2015-08-29 07:30:15 +0200
committerJens Staal2015-08-29 07:30:15 +0200
commit33fdca2938299ce8c6daf2abb06b45162f72e576 (patch)
treeb70a595f3def9906901eea5be31af8539a50a4dc
downloadaur-ow-libbz2.tar.gz
libbz2 for open watcom cross compiler
-rw-r--r--.SRCINFO31
-rw-r--r--PKGBUILD202
-rw-r--r--pragma.patch11
-rw-r--r--wmake.patch103
4 files changed, 347 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..a543f2ebbea
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,31 @@
+pkgbase = ow-libbz2
+ pkgdesc = A high-quality data compression program (watcom-cross)
+ pkgver = 1.0.6
+ pkgrel = 2
+ url = http://www.bzip.org/
+ arch = any
+ license = custom
+ makedepends = openwatcom-v2
+ depends = openwatcom-v2
+ options = !strip
+ options = !buildflags
+ options = staticlibs
+ source = http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
+ source = wmake.patch
+ source = pragma.patch
+ sha1sums = 3f89f861209ce81a6bab1fd1998c0ef311712002
+ sha1sums = 1166d733e176f9687328bbb47875bea45f922b38
+ sha1sums = 9a36d53bda3a03c5f27c40f31cca2f100a16ab59
+
+pkgname = ow-libbz2
+
+pkgname = ow-libbz2-dos
+
+pkgname = ow-libbz2-win16
+
+pkgname = ow-libbz2-win32
+
+pkgname = ow-libbz2-os2
+
+pkgname = ow-libbz2-netware
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..39bf3bc5eeb
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,202 @@
+#Maintainer Jens Staal <staal1978@gmail.com>
+
+pkgbase=ow-libbz2
+pkgver=1.0.6
+pkgrel=2
+pkgdesc="A high-quality data compression program (watcom-cross)"
+arch=(any)
+url="http://www.bzip.org/"
+license=("custom")
+makedepends=(openwatcom-v2)
+depends=(openwatcom-v2)
+options=(!strip !buildflags staticlibs)
+source=("http://www.bzip.org/${pkgver}/bzip2-${pkgver}.tar.gz" \
+ "wmake.patch" "pragma.patch")
+sha1sums=('3f89f861209ce81a6bab1fd1998c0ef311712002' \
+ '1166d733e176f9687328bbb47875bea45f922b38' '9a36d53bda3a03c5f27c40f31cca2f100a16ab59')
+
+pkgname=("${pkgbase}" "${pkgbase}-dos" "${pkgbase}-win16" "${pkgbase}-win32" "${pkgbase}-os2" "${pkgbase}-netware")
+
+for _p in ${pkgname[@]}; do
+ eval "package_${_p}() {
+ $(declare -f "_package${_p#${pkgbase}}")
+ _package${_p#${pkgbase}}
+ }"
+done
+
+prepare() {
+ cd "$srcdir/bzip2-$pkgver"
+ patch Makefile < "$srcdir/"wmake.patch
+}
+
+build() {
+ cd $srcdir/bzip2-$pkgver
+ unset LDFLAGS
+ source /opt/watcom/owsetenv.sh
+
+ msg "build for Linux"
+ export CFLAGS="-blinux -O2 -D_FILE_OFFSET_BITS=64"
+ sed 's|-lbz2|libbz2.lib|g' -i Makefile
+ rm -rf linux
+ mkdir -p linux
+ make
+ mv libbz2.lib linux/
+ cp bzlib.h linux/
+ mv bzip2 linux/
+ mv bzip2recover linux/
+ patch linux/bzlib.h < "$srcdir/"pragma.patch
+ make clean
+ rm -f *.{o,lib}
+
+ msg "build for DOS"
+ msg2 "16 bit..."
+ export INCLUDE=$WATCOM/h
+ export CFLAGS="-bdos -O2 -DMSDOS -D_FILE_OFFSET_BITS=64"
+ rm -rf dos
+ mkdir -p dos/{2,3}86
+ make libbz2.lib
+ mv libbz2.lib dos/286/
+ cp bzlib.h dos/
+ patch dos/bzlib.h < "$srcdir/"pragma.patch
+ make clean
+ rm -f *.{o,lib}
+
+ msg2 "32 bit..."
+ export CFLAGS="-bdos4g -O2 -DMSDOS -D_FILE_OFFSET_BITS=64"
+ make libbz2.lib
+ cp libbz2.lib dos/386/
+ make clean
+ rm -f *.{o,lib}
+
+ msg "build for Win16"
+ export INCLUDE=$WATCOM/h:$WATCOM/win
+ export CFLAGS="-bwin -O2 -D_FILE_OFFSET_BITS=64"
+ rm -rf win
+ mkdir -p win
+ make libbz2.lib
+ mv libbz2.lib win/
+ cp bzlib.h win/
+ patch win/bzlib.h < "$srcdir/"pragma.patch
+ make clean
+ rm -f *.{o,lib}
+
+ msg "build for Win32"
+ export INCLUDE=$WATCOM/h:$WATCOM/h/nt
+ export CFLAGS="-bnt -O2 -DWIN32 -D_FILE_OFFSET_BITS=64"
+ rm -rf nt
+ mkdir -p nt
+ make libbz2.lib
+ mv libbz2.lib nt/
+ cp bzlib.h nt/
+ patch nt/bzlib.h < "$srcdir/"pragma.patch
+ make clean
+ rm -f *.{o,lib}
+
+ msg "build for OS/2"
+ msg2 "16 bit ..."
+ export INCLUDE=$WATCOM/h:$WATCOM/os21x
+ export CFLAGS="-bos2 -O2 -DOS2 -D_FILE_OFFSET_BITS=64"
+ rm -rf os2
+ mkdir -p os2/{2,3}86
+ make libbz2.lib
+ mv libbz2.lib os2/286/
+ cp bzlib.h os2/286/
+ patch os2/286/bzlib.h < "$srcdir/"pragma.patch
+ make clean
+ rm -f *.{o,lib}
+
+ msg2 "32 bit ..."
+ export INCLUDE=$WATCOM/h:$WATCOM/os2
+ export CFLAGS="-bos2v2 -O2 -DOS2 -D_FILE_OFFSET_BITS=64"
+ make libbz2.lib
+ mv libbz2.lib os2/386/
+ cp bzlib.h os2/386/
+ patch os2/386/bzlib.h < "$srcdir/"pragma.patch
+ make clean
+ rm -f *.{o,lib}
+
+ msg "build for Netware"
+ export INCLUDE=$WATCOM/h
+ export CFLAGS="-bnetware -O2 -D_FILE_OFFSET_BITS=64"
+ rm -rf netware
+ mkdir -p netware
+ make libbz2.lib
+ mv libbz2.lib netware/
+ cp bzlib.h netware/
+ patch netware/bzlib.h < "$srcdir/"pragma.patch
+ make clean
+ rm -f *.{o,lib}
+}
+
+_package() {
+ pkgdesc="A high-quality data compression program (Watcom-linux)"
+ groups=('watcom-linux')
+ mkdir -p ${pkgdir}${WATCOM}/{lib386/linux,lh,binl}
+ cd $srcdir/bzip2-$pkgver
+ cp linux/libbz2.lib ${pkgdir}${WATCOM}/lib386/linux/
+ cp linux/bzlib.h ${pkgdir}${WATCOM}/lh/
+ cp linux/bzip2 ${pkgdir}${WATCOM}/binl/
+ cp linux/bzip2recover ${pkgdir}${WATCOM}/binl/
+ mkdir -p $pkgdir/usr/share/licenses/Linux/bzip2
+ cp LICENSE $pkgdir/usr/share/licenses/Linux/bzip2/
+}
+
+_package-dos() {
+ pkgdesc="A high-quality data compression program (Watcom-dos)"
+ groups=('watcom-dos')
+ mkdir -p ${pkgdir}${WATCOM}/{lib{2,3}86/dos,h}
+ cd $srcdir/bzip2-$pkgver
+ cp dos/286/libbz2.lib ${pkgdir}${WATCOM}/lib286/dos/
+ cp dos/386/libbz2.lib ${pkgdir}${WATCOM}/lib386/dos/
+ cp dos/bzlib.h ${pkgdir}${WATCOM}/h/
+ mkdir -p $pkgdir/usr/share/licenses/DOS/bzip2
+ cp LICENSE $pkgdir/usr/share/licenses/DOS/bzip2/
+ }
+
+_package-win16() {
+ pkgdesc="A high-quality data compression program (Watcom-win16)"
+ groups=('watcom-win16')
+ mkdir -p ${pkgdir}${WATCOM}/{lib286/win,h/win}
+ cd $srcdir/bzip2-$pkgver
+ cp win/libbz2.lib ${pkgdir}${WATCOM}/lib286/win/
+ cp win/bzlib.h ${pkgdir}${WATCOM}/h/win/
+ mkdir -p $pkgdir/usr/share/licenses/Win16/bzip2
+ cp LICENSE $pkgdir/usr/share/licenses/Win16/bzip2/
+}
+
+_package-win32() {
+ pkgdesc="A high-quality data compression program (Watcom-win32)"
+ groups=('watcom-win32')
+ mkdir -p ${pkgdir}${WATCOM}/{lib386/nt,h/nt}
+ cd $srcdir/bzip2-$pkgver
+ cp nt/libbz2.lib ${pkgdir}${WATCOM}/lib386/nt/
+ cp nt/bzlib.h ${pkgdir}${WATCOM}/h/nt/
+ mkdir -p $pkgdir/usr/share/licenses/Win32/bzip2
+ cp LICENSE $pkgdir/usr/share/licenses/Win32/bzip2/
+}
+
+_package-os2() {
+ pkgdesc="A high-quality data compression program (Watcom-os2)"
+ groups=('watcom-os2')
+ mkdir -p ${pkgdir}${WATCOM}/{lib{2,3}86/os2,h/os2{,1x}}
+ cd $srcdir/bzip2-$pkgver
+ cp os2/286/libbz2.lib ${pkgdir}${WATCOM}/lib286/os2/
+ cp os2/386/libbz2.lib ${pkgdir}${WATCOM}/lib386/os2/
+ cp os2/286/bzlib.h ${pkgdir}${WATCOM}/h/os21x/
+ cp os2/386/bzlib.h ${pkgdir}${WATCOM}/h/os2/
+ mkdir -p $pkgdir/usr/share/licenses/OS2/bzip2
+ cp LICENSE $pkgdir/usr/share/licenses/OS2/bzip2/
+}
+
+_package-netware() {
+ pkgdesc="A high-quality data compression program (Watcom-netware)"
+ groups=('watcom-netware')
+ depends=('open_watcom-v2')
+ mkdir -p ${pkgdir}${WATCOM}/{lib386/netware,novh}
+ cd $srcdir/bzip2-$pkgver
+ cp netware/libbz2.lib ${pkgdir}${WATCOM}/lib386/netware/
+ cp netware/bzlib.h ${pkgdir}${WATCOM}/novh/
+ mkdir -p $pkgdir/usr/share/licenses/Netware/bzip2
+ cp LICENSE $pkgdir/usr/share/licenses/Netware/bzip2/
+
+} \ No newline at end of file
diff --git a/pragma.patch b/pragma.patch
new file mode 100644
index 00000000000..d2f29c679de
--- /dev/null
+++ b/pragma.patch
@@ -0,0 +1,11 @@
+--- bzlib.h.orig 2014-10-10 17:21:06.358034792 +0200
++++ bzlib.h 2014-10-10 17:21:58.925034236 +0200
+@@ -22,6 +22,8 @@
+ #ifndef _BZLIB_H
+ #define _BZLIB_H
+
++pragma library ("libbz2.lib")
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
diff --git a/wmake.patch b/wmake.patch
new file mode 100644
index 00000000000..702dbef5b4f
--- /dev/null
+++ b/wmake.patch
@@ -0,0 +1,103 @@
+--- Makefile.orig 2010-09-11 00:46:02.000000000 +0200
++++ Makefile 2014-10-11 09:21:16.490420617 +0200
+@@ -15,17 +15,13 @@
+ SHELL=/bin/sh
+
+ # To assist in cross-compiling
+-CC=gcc
+-AR=ar
+-RANLIB=ranlib
++CC=owcc
++AR=wlib
++RANLIB=echo
+ LDFLAGS=
+
+-BIGFILES=-D_FILE_OFFSET_BITS=64
+-CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)
+-
+-# Where you want it installed when you do 'make install'
+-PREFIX=/usr/local
+-
++#BIGFILES=-D_FILE_OFFSET_BITS=64
++#CFLAGS=-O2 -g $(BIGFILES)
+
+ OBJS= blocksort.o \
+ huffman.o \
+@@ -35,22 +31,18 @@
+ decompress.o \
+ bzlib.o
+
+-all: libbz2.a bzip2 bzip2recover test
++all: libbz2.lib bzip2 bzip2recover test
+
+-bzip2: libbz2.a bzip2.o
++bzip2: libbz2.lib bzip2.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
+
+ bzip2recover: bzip2recover.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o
+
+-libbz2.a: $(OBJS)
+- rm -f libbz2.a
+- $(AR) cq libbz2.a $(OBJS)
+- @if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \
+- -f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \
+- echo $(RANLIB) libbz2.a ; \
+- $(RANLIB) libbz2.a ; \
+- fi
++libbz2.lib: $(OBJS)
++ rm -f libbz2.lib
++ $(AR) -q -n -t libbz2.lib $(OBJS)
++
+
+ check: test
+ test: bzip2
+@@ -69,47 +61,8 @@
+ cmp sample3.tst sample3.ref
+ @cat words3
+
+-install: bzip2 bzip2recover
+- if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
+- if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi
+- if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi
+- if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi
+- if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi
+- cp -f bzip2 $(PREFIX)/bin/bzip2
+- cp -f bzip2 $(PREFIX)/bin/bunzip2
+- cp -f bzip2 $(PREFIX)/bin/bzcat
+- cp -f bzip2recover $(PREFIX)/bin/bzip2recover
+- chmod a+x $(PREFIX)/bin/bzip2
+- chmod a+x $(PREFIX)/bin/bunzip2
+- chmod a+x $(PREFIX)/bin/bzcat
+- chmod a+x $(PREFIX)/bin/bzip2recover
+- cp -f bzip2.1 $(PREFIX)/man/man1
+- chmod a+r $(PREFIX)/man/man1/bzip2.1
+- cp -f bzlib.h $(PREFIX)/include
+- chmod a+r $(PREFIX)/include/bzlib.h
+- cp -f libbz2.a $(PREFIX)/lib
+- chmod a+r $(PREFIX)/lib/libbz2.a
+- cp -f bzgrep $(PREFIX)/bin/bzgrep
+- ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
+- ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
+- chmod a+x $(PREFIX)/bin/bzgrep
+- cp -f bzmore $(PREFIX)/bin/bzmore
+- ln -s -f $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless
+- chmod a+x $(PREFIX)/bin/bzmore
+- cp -f bzdiff $(PREFIX)/bin/bzdiff
+- ln -s -f $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp
+- chmod a+x $(PREFIX)/bin/bzdiff
+- cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
+- chmod a+r $(PREFIX)/man/man1/bzgrep.1
+- chmod a+r $(PREFIX)/man/man1/bzmore.1
+- chmod a+r $(PREFIX)/man/man1/bzdiff.1
+- echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1
+- echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1
+- echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1
+- echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1
+-
+ clean:
+- rm -f *.o libbz2.a bzip2 bzip2recover \
++ rm -f *.o libbz2.lib bzip2 bzip2recover \
+ sample1.rb2 sample2.rb2 sample3.rb2 \
+ sample1.tst sample2.tst sample3.tst
+