You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
5.0 KiB

# --- 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 \