From b70981b68efcce5256eb11c6cd26ae123b10b6ea Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Fri, 24 Jul 2009 08:01:31 +0000
Subject: moved extra/* to main/

and fixed misc build issues
---
 main/bzip2/APKBUILD                          | 48 ++++++++++++++++++++++++++++
 main/bzip2/bzip2-1.0.4-POSIX-shell.patch     | 21 ++++++++++++
 main/bzip2/bzip2-1.0.4-makefile-CFLAGS.patch | 25 +++++++++++++++
 main/bzip2/bzip2-1.0.4-man-links.patch       | 12 +++++++
 main/bzip2/bzip2-1.0.4-saneso.patch          | 13 ++++++++
 main/bzip2/bzip2.post-deinstall              |  3 ++
 6 files changed, 122 insertions(+)
 create mode 100644 main/bzip2/APKBUILD
 create mode 100644 main/bzip2/bzip2-1.0.4-POSIX-shell.patch
 create mode 100644 main/bzip2/bzip2-1.0.4-makefile-CFLAGS.patch
 create mode 100644 main/bzip2/bzip2-1.0.4-man-links.patch
 create mode 100644 main/bzip2/bzip2-1.0.4-saneso.patch
 create mode 100644 main/bzip2/bzip2.post-deinstall

(limited to 'main/bzip2')

diff --git a/main/bzip2/APKBUILD b/main/bzip2/APKBUILD
new file mode 100644
index 0000000000..09721bb760
--- /dev/null
+++ b/main/bzip2/APKBUILD
@@ -0,0 +1,48 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=bzip2
+pkgver=1.0.5
+pkgrel=1
+pkgdesc="A high-quality data compression program"
+url="http://sources.redhat.com/bzip2"
+license="BZIP2"
+depends="uclibc"
+install="$pkgname.post-deinstall"
+source="http://www.bzip.org/$pkgver/$pkgname-$pkgver.tar.gz
+	$install
+	bzip2-1.0.4-POSIX-shell.patch
+	bzip2-1.0.4-makefile-CFLAGS.patch
+	bzip2-1.0.4-man-links.patch
+	bzip2-1.0.4-saneso.patch
+	"
+subpackages="$pkgname-dev $pkgname-doc"
+
+build () { 
+	local i
+	cd "$srcdir"/$pkgname-$pkgver
+	for i in ../*.patch; do
+		msg "Applying ${i##*/}"
+		patch -p1 < $i || return 1
+	done
+
+	# Fix man path
+	# Generate relative symlinks
+	sed -i \
+		-e 's:\$(PREFIX)/man:\$(PREFIX)/share/man:g' \
+		-e 's:ln -s -f $(PREFIX)/bin/:ln -s :' \
+		Makefile || return 1
+
+	# fixup broken version stuff
+	sed -i \
+		-e "s:1\.0\.4:$pkgver:" \
+		bzip2.1 bzip2.txt Makefile-libbz2_so manual.* || return 1
+
+	make -f Makefile-libbz2_so all || return 1
+	make all || return 1
+	make PREFIX="$pkgdir"/usr install || return 1
+}
+md5sums="3c15a0c8d1d3ee1c46a1634d00617b1a  bzip2-1.0.5.tar.gz
+b84506d253e04db3c5af9016fead45a3  bzip2.post-deinstall
+2e9bcfeb1614b55f5ba2d087ac65a3fe  bzip2-1.0.4-POSIX-shell.patch
+56b90131e3c2ae425b758de9c7be7682  bzip2-1.0.4-makefile-CFLAGS.patch
+fd13ef6bc55276c7e3adc346bde56cd1  bzip2-1.0.4-man-links.patch
+643983e8134723ebe53c858b1a3938ad  bzip2-1.0.4-saneso.patch"
diff --git a/main/bzip2/bzip2-1.0.4-POSIX-shell.patch b/main/bzip2/bzip2-1.0.4-POSIX-shell.patch
new file mode 100644
index 0000000000..74f8df000b
--- /dev/null
+++ b/main/bzip2/bzip2-1.0.4-POSIX-shell.patch
@@ -0,0 +1,21 @@
+bzgrep uses !/bin/sh but then uses the bashism ${var//} so replace those
+with calls to sed so POSIX shells work
+
+http://bugs.gentoo.org/193365
+
+--- a/bzgrep
++++ b/bzgrep
+@@ -63,10 +63,9 @@
+     bzip2 -cdfq "$i" | $grep $opt "$pat"
+     r=$?
+   else
+-    j=${i//\\/\\\\}
+-    j=${j//|/\\|}
+-    j=${j//&/\\&}
+-    j=`printf "%s" "$j" | tr '\n' ' '`
++    # the backslashes here are doubled up as we have to escape each one for the
++    # shell and then escape each one for the sed expression
++    j=`printf "%s" "${i}" | sed -e 's:\\\\:\\\\\\\\:g' -e 's:[|]:\\\\|:g' -e 's:[&]:\\\\&:g' | tr '\n' ' '`
+     bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|"
+     r=$?
+   fi
diff --git a/main/bzip2/bzip2-1.0.4-makefile-CFLAGS.patch b/main/bzip2/bzip2-1.0.4-makefile-CFLAGS.patch
new file mode 100644
index 0000000000..85a3c6af6c
--- /dev/null
+++ b/main/bzip2/bzip2-1.0.4-makefile-CFLAGS.patch
@@ -0,0 +1,25 @@
+--- a/Makefile
++++ b/Makefile
+@@ -18,10 +18,9 @@
+ CC=gcc
+ AR=ar
+ RANLIB=ranlib
+-LDFLAGS=
+ 
+ BIGFILES=-D_FILE_OFFSET_BITS=64
+-CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)
++CFLAGS+=-Wall -Winline $(BIGFILES)
+ 
+ # Where you want it installed when you do 'make install'
+ PREFIX=/usr/local
+--- a/Makefile-libbz2_so
++++ b/Makefile-libbz2_so
+@@ -24,7 +24,7 @@
+ SHELL=/bin/sh
+ CC=gcc
+ BIGFILES=-D_FILE_OFFSET_BITS=64
+-CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES)
++CFLAGS+=-fpic -fPIC -Wall -Winline $(BIGFILES)
+ 
+ OBJS= blocksort.o  \
+       huffman.o    \
diff --git a/main/bzip2/bzip2-1.0.4-man-links.patch b/main/bzip2/bzip2-1.0.4-man-links.patch
new file mode 100644
index 0000000000..2427d6a7fb
--- /dev/null
+++ b/main/bzip2/bzip2-1.0.4-man-links.patch
@@ -0,0 +1,12 @@
+http://bugs.gentoo.org/172986
+
+--- bzip2-1.0.4/Makefile
++++ bzip2-1.0.4/Makefile
+@@ -85,4 +85,7 @@
+ 	cp -f bzip2.1 $(PREFIX)/share/man/man1
+ 	chmod a+r $(PREFIX)/share/man/man1/bzip2.1
++	ln -s bzip2.1 $(PREFIX)/share/man/man1/bunzip2.1
++	ln -s bzip2.1 $(PREFIX)/share/man/man1/bzcat.1
++	ln -s bzip2.1 $(PREFIX)/share/man/man1/bzip2recover.1
+ 	cp -f bzlib.h $(PREFIX)/include
+ 	chmod a+r $(PREFIX)/include/bzlib.h
diff --git a/main/bzip2/bzip2-1.0.4-saneso.patch b/main/bzip2/bzip2-1.0.4-saneso.patch
new file mode 100644
index 0000000000..9a71342ca9
--- /dev/null
+++ b/main/bzip2/bzip2-1.0.4-saneso.patch
@@ -0,0 +1,13 @@
+--- a/Makefile-libbz2_so
++++ b/Makefile-libbz2_so
+@@ -35,8 +35,8 @@
+       bzlib.o
+ 
+ all: $(OBJS)
+-	$(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.4 $(OBJS)
+-	$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.4
++	$(CC) $(LDFLAGS) -shared -Wl,-soname -Wl,libbz2.so.1 -o libbz2.so.1.0.4 $(OBJS)
++	$(CC) $(LDFLAGS) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.4
+ 	rm -f libbz2.so.1.0
+ 	ln -s libbz2.so.1.0.4 libbz2.so.1.0
+ 
diff --git a/main/bzip2/bzip2.post-deinstall b/main/bzip2/bzip2.post-deinstall
new file mode 100644
index 0000000000..99b57c4635
--- /dev/null
+++ b/main/bzip2/bzip2.post-deinstall
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+busybox --install -s
-- 
cgit v1.2.3