bzip2: Honour LDFLAGS

bzip2 is using a very unusual build system which makes some
patches required to pass flags from the environment.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer 2016-10-18 01:40:49 +02:00
parent 892dc94009
commit 84b2d20ea4
5 changed files with 43 additions and 57 deletions

View File

@ -5,7 +5,7 @@
name = bzip2
version = 1.0.6
release = 6
release = 7
groups = Applications/Compression
url = http://www.bzip.org/
@ -29,10 +29,12 @@ build
build
%{DO_FIX_LIBTOOL}
make -f Makefile-libbz2_so %{PARALLELISMFLAGS} CFLAGS="%{CFLAGS}"
make -f Makefile-libbz2_so %{PARALLELISMFLAGS} \
CFLAGS="%{CFLAGS}" LDFLAGS="%{LDFLAGS}"
make clean
make %{PARALLELISMFLAGS} CFLAGS="%{CFLAGS}"
make %{PARALLELISMFLAGS} \
CFLAGS="%{CFLAGS}" LDFLAGS="%{LDFLAGS}"
end
install

View File

@ -0,0 +1,25 @@
--- Makefile
+++ 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) $(CPPFLAGS)
# Where you want it installed when you do 'make install'
PREFIX=/usr/local
--- Makefile-libbz2_so
+++ 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) $(CPPFLAGS)
OBJS= blocksort.o \
huffman.o \

View File

@ -1,12 +0,0 @@
diff -up bzip2-1.0.6/Makefile-libbz2_so.pom bzip2-1.0.6/Makefile-libbz2_so
--- bzip2-1.0.6/Makefile-libbz2_so.pom 2010-09-11 01:07:52.000000000 +0200
+++ bzip2-1.0.6/Makefile-libbz2_so 2010-09-22 10:31:46.000000000 +0200
@@ -35,7 +35,7 @@ OBJS= blocksort.o \
bzlib.o
all: $(OBJS)
- $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS)
+ $(CC) -shared -Wl,-soname -Wl,libbz2.so.1 -o libbz2.so.1.0.6 $(OBJS)
$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6
rm -f libbz2.so.1.0
ln -s libbz2.so.1.0.6 libbz2.so.1.0

View File

@ -1,42 +0,0 @@
Submitted By: Matthew Burgess <matthew@linuxfromscratch.org>
Date: 2007-01-31
Initial Package Version: 1.0.4
Upstream Status: Not submitted
Origin: Randy McMurchy & Steve Crosby
Description: Installs pre-formatted documentation
diff -Naur bzip2-1.0.4.orig/Makefile bzip2-1.0.4/Makefile
--- bzip2-1.0.4.orig/Makefile 2007-01-03 03:49:21.000000000 +0000
+++ bzip2-1.0.4/Makefile 2007-01-26 20:00:01.000000000 +0000
@@ -25,7 +25,7 @@
# Where you want it installed when you do 'make install'
PREFIX=/usr/local
-
+DOCDIR=share/doc/$(DISTNAME)
OBJS= blocksort.o \
huffman.o \
@@ -74,6 +74,7 @@
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)/$(DOCDIR) ) ; then mkdir -p $(PREFIX)/$(DOCDIR); fi
if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi
cp -f bzip2 $(PREFIX)/bin/bzip2
cp -f bzip2 $(PREFIX)/bin/bunzip2
@@ -107,6 +108,14 @@
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
+ cp -f manual.html $(PREFIX)/$(DOCDIR)
+ cp -f manual.pdf $(PREFIX)/$(DOCDIR)
+ cp -f manual.ps $(PREFIX)/$(DOCDIR)
+ cp -f bzip2.txt $(PREFIX)/$(DOCDIR)
+ chmod a+r $(PREFIX)/$(DOCDIR)/manual.html
+ chmod a+r $(PREFIX)/$(DOCDIR)/manual.pdf
+ chmod a+r $(PREFIX)/$(DOCDIR)/manual.ps
+ chmod a+r $(PREFIX)/$(DOCDIR)/bzip2.txt
clean:
rm -f *.o libbz2.a bzip2 bzip2recover \

View File

@ -0,0 +1,13 @@
--- Makefile-libbz2_so
+++ 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.6 $(OBJS)
- $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6
+ $(CC) $(LDFLAGS) -shared -Wl,-soname -Wl,libbz2.so.1 -o libbz2.so.1.0.6 $(OBJS)
+ $(CC) $(LDFLAGS) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6
rm -f libbz2.so.1.0
ln -s libbz2.so.1.0.6 libbz2.so.1.0