Browse Source

bzip2: Fixed to handle DESTDIR correctly

early
Alejandro Mery 17 years ago
parent
commit
12632fbf1c
  1. 37
      archiver/bzip2/001-relative-symlinks.patch
  2. 123
      archiver/bzip2/002-destdir.patch
  3. 7
      archiver/bzip2/bzip2.conf
  4. 125
      archiver/bzip2/makefile.patch

37
archiver/bzip2/001-relative-symlinks.patch

@ -0,0 +1,37 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../bzip2/001-relative-symlinks.patch
# Copyright (C) 2008 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- ./Makefile.orig 2008-07-05 22:08:23.000000000 +0300
+++ ./Makefile 2008-07-05 22:17:59.000000000 +0300
@@ -90,14 +90,14 @@
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
+ ln -s -f bzgrep $(PREFIX)/bin/bzegrep
+ ln -s -f 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
+ ln -s -f 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
+ ln -s -f 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

123
archiver/bzip2/002-destdir.patch

@ -0,0 +1,123 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../bzip2/002-destdir.patch
# Copyright (C) 2008 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
The first two chunks define a default DESTDIR, and skip `make test`
when cross compiling, the rest is a simple:
sed -i -e 's|$(PREFIX)|$(DESTDIR)$(PREFIX)|g' Makefile
--- ./Makefile.orig 2008-07-05 22:20:18.000000000 +0300
+++ ./Makefile 2008-07-05 22:24:39.000000000 +0300
@@ -24,6 +24,7 @@
CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)
# Where you want it installed when you do 'make install'
+DESTDIR=
PREFIX=/usr/local
@@ -35,7 +36,11 @@
decompress.o \
bzlib.o
+ifeq ($(DESTDIR),)
all: libbz2.a bzip2 bzip2recover test
+else
+all: libbz2.a bzip2 bzip2recover
+endif
bzip2: libbz2.a bzip2.o
$(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
@@ -70,43 +75,43 @@
@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 bzgrep $(PREFIX)/bin/bzegrep
- ln -s -f bzgrep $(PREFIX)/bin/bzfgrep
- chmod a+x $(PREFIX)/bin/bzgrep
- cp -f bzmore $(PREFIX)/bin/bzmore
- ln -s -f bzmore $(PREFIX)/bin/bzless
- chmod a+x $(PREFIX)/bin/bzmore
- cp -f bzdiff $(PREFIX)/bin/bzdiff
- ln -s -f 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
+ if ( test ! -d $(DESTDIR)$(PREFIX)/bin ) ; then mkdir -p $(DESTDIR)$(PREFIX)/bin ; fi
+ if ( test ! -d $(DESTDIR)$(PREFIX)/lib ) ; then mkdir -p $(DESTDIR)$(PREFIX)/lib ; fi
+ if ( test ! -d $(DESTDIR)$(PREFIX)/man ) ; then mkdir -p $(DESTDIR)$(PREFIX)/man ; fi
+ if ( test ! -d $(DESTDIR)$(PREFIX)/man/man1 ) ; then mkdir -p $(DESTDIR)$(PREFIX)/man/man1 ; fi
+ if ( test ! -d $(DESTDIR)$(PREFIX)/include ) ; then mkdir -p $(DESTDIR)$(PREFIX)/include ; fi
+ cp -f bzip2 $(DESTDIR)$(PREFIX)/bin/bzip2
+ cp -f bzip2 $(DESTDIR)$(PREFIX)/bin/bunzip2
+ cp -f bzip2 $(DESTDIR)$(PREFIX)/bin/bzcat
+ cp -f bzip2recover $(DESTDIR)$(PREFIX)/bin/bzip2recover
+ chmod a+x $(DESTDIR)$(PREFIX)/bin/bzip2
+ chmod a+x $(DESTDIR)$(PREFIX)/bin/bunzip2
+ chmod a+x $(DESTDIR)$(PREFIX)/bin/bzcat
+ chmod a+x $(DESTDIR)$(PREFIX)/bin/bzip2recover
+ cp -f bzip2.1 $(DESTDIR)$(PREFIX)/man/man1
+ chmod a+r $(DESTDIR)$(PREFIX)/man/man1/bzip2.1
+ cp -f bzlib.h $(DESTDIR)$(PREFIX)/include
+ chmod a+r $(DESTDIR)$(PREFIX)/include/bzlib.h
+ cp -f libbz2.a $(DESTDIR)$(PREFIX)/lib
+ chmod a+r $(DESTDIR)$(PREFIX)/lib/libbz2.a
+ cp -f bzgrep $(DESTDIR)$(PREFIX)/bin/bzgrep
+ ln -s -f bzgrep $(DESTDIR)$(PREFIX)/bin/bzegrep
+ ln -s -f bzgrep $(DESTDIR)$(PREFIX)/bin/bzfgrep
+ chmod a+x $(DESTDIR)$(PREFIX)/bin/bzgrep
+ cp -f bzmore $(DESTDIR)$(PREFIX)/bin/bzmore
+ ln -s -f bzmore $(DESTDIR)$(PREFIX)/bin/bzless
+ chmod a+x $(DESTDIR)$(PREFIX)/bin/bzmore
+ cp -f bzdiff $(DESTDIR)$(PREFIX)/bin/bzdiff
+ ln -s -f bzdiff $(DESTDIR)$(PREFIX)/bin/bzcmp
+ chmod a+x $(DESTDIR)$(PREFIX)/bin/bzdiff
+ cp -f bzgrep.1 bzmore.1 bzdiff.1 $(DESTDIR)$(PREFIX)/man/man1
+ chmod a+r $(DESTDIR)$(PREFIX)/man/man1/bzgrep.1
+ chmod a+r $(DESTDIR)$(PREFIX)/man/man1/bzmore.1
+ chmod a+r $(DESTDIR)$(PREFIX)/man/man1/bzdiff.1
+ echo ".so man1/bzgrep.1" > $(DESTDIR)$(PREFIX)/man/man1/bzegrep.1
+ echo ".so man1/bzgrep.1" > $(DESTDIR)$(PREFIX)/man/man1/bzfgrep.1
+ echo ".so man1/bzmore.1" > $(DESTDIR)$(PREFIX)/man/man1/bzless.1
+ echo ".so man1/bzdiff.1" > $(DESTDIR)$(PREFIX)/man/man1/bzcmp.1
clean:
rm -f *.o libbz2.a bzip2 bzip2recover \

7
archiver/bzip2/bzip2.conf

@ -2,7 +2,7 @@
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../bzip2/bzip2.conf
# Copyright (C) 2006 - 2007 The OpenSDE Project
# Copyright (C) 2006 - 2008 The OpenSDE Project
# Copyright (C) 2004 - 2006 The T2 SDE Project
# Copyright (C) 1998 - 2003 Clifford Wolf
#
@ -14,11 +14,8 @@
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
# apply the patches defined in the package description
#var_append patchfiles ' ' "`match_source_file -p 'patch'`"
var_append makeopt ' ' "AR=$AR RANLIB=$RANLIB"
var_append makeinstopt ' ' "PREFIX=$root USRPREFIX=$root/usr"
var_append makeinstopt ' ' "PREFIX=/$prefix"
if [ "$SDECFG_STATIC" != 1 -a "$SDECFG_DIETLIBC_bzip2" != 1 ] ; then
hook_add inmake 5 "$MAKE $makeopt -f Makefile-libbz2_so"

125
archiver/bzip2/makefile.patch

@ -1,125 +0,0 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../bzip2/makefile.patch
# Copyright (C) 2007 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- bzip2-1.0.4/Makefile.orig 2007-01-03 05:49:21.000000000 +0200
+++ bzip2-1.0.4/Makefile 2007-03-11 23:30:56.781657750 +0200
@@ -24,8 +24,8 @@
CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)
# Where you want it installed when you do 'make install'
-PREFIX=/usr/local
-
+PREFIX=/
+USRPREFIX=/usr
OBJS= blocksort.o \
huffman.o \
@@ -35,7 +35,7 @@
decompress.o \
bzlib.o
-all: libbz2.a bzip2 bzip2recover test
+all: libbz2.a bzip2 bzip2recover
bzip2: libbz2.a bzip2.o
$(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
@@ -46,12 +46,7 @@
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
-
+ $(RANLIB) libbz2.a
check: test
test: bzip2
@cat words1
@@ -71,42 +66,42 @@
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
+ if ( test ! -d $(USRPREFIX)/lib ) ; then mkdir -p $(USRPREFIX)/lib ; fi
+ if ( test ! -d $(USRPREFIX)/man ) ; then mkdir -p $(USRPREFIX)/man ; fi
+ if ( test ! -d $(USRPREFIX)/man/man1 ) ; then mkdir -p $(USRPREFIX)/man/man1 ; fi
+ if ( test ! -d $(USRPREFIX)/include ) ; then mkdir -p $(USRPREFIX)/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
+ cp -f bzip2recover $(USRPREFIX)/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
+ chmod a+x $(USRPREFIX)/bin/bzip2recover
+ cp -f bzip2.1 $(USRPREFIX)/man/man1
+ chmod a+r $(USRPREFIX)/man/man1/bzip2.1
+ cp -f bzlib.h $(USRPREFIX)/include
+ chmod a+r $(USRPREFIX)/include/bzlib.h
+ cp -f libbz2.a $(USRPREFIX)/lib
+ chmod a+r $(USRPREFIX)/lib/libbz2.a
+ cp -f bzgrep $(USRPREFIX)/bin/bzgrep
+ ln -s -f $(USRPREFIX)/bin/bzgrep $(USRPREFIX)/bin/bzegrep
+ ln -s -f $(USRPREFIX)/bin/bzgrep $(USRPREFIX)/bin/bzfgrep
+ chmod a+x $(USRPREFIX)/bin/bzgrep
+ cp -f bzmore $(USRPREFIX)/bin/bzmore
+ ln -s -f $(USRPREFIX)/bin/bzmore $(USRPREFIX)/bin/bzless
+ chmod a+x $(USRPREFIX)/bin/bzmore
+ cp -f bzdiff $(USRPREFIX)/bin/bzdiff
+ ln -s -f $(USRPREFIX)/bin/bzdiff $(USRPREFIX)/bin/bzcmp
+ chmod a+x $(USRPREFIX)/bin/bzdiff
+ cp -f bzgrep.1 bzmore.1 bzdiff.1 $(USRPREFIX)/man/man1
+ chmod a+r $(USRPREFIX)/man/man1/bzgrep.1
+ chmod a+r $(USRPREFIX)/man/man1/bzmore.1
+ chmod a+r $(USRPREFIX)/man/man1/bzdiff.1
+ echo ".so man1/bzgrep.1" > $(USRPREFIX)/man/man1/bzegrep.1
+ echo ".so man1/bzgrep.1" > $(USRPREFIX)/man/man1/bzfgrep.1
+ echo ".so man1/bzmore.1" > $(USRPREFIX)/man/man1/bzless.1
+ echo ".so man1/bzdiff.1" > $(USRPREFIX)/man/man1/bzcmp.1
clean:
rm -f *.o libbz2.a bzip2 bzip2recover \
Loading…
Cancel
Save