1 From 0904c124156935c17f29a74e9ba7b49c9dddb56b Mon Sep 17 00:00:00 2001
2 From: babak sarashki <babak.sarashki@windriver.com>
3 Date: Mon, 26 Aug 2019 13:05:32 -0700
4 Subject: [PATCH] Makefile patch fix build errors
7 Makefile | 35 ++++++++++-----------------------
8 zlib-1.2.2.f-rsyncable/Makefile | 6 +++---
9 2 files changed, 13 insertions(+), 28 deletions(-)
11 diff --git a/Makefile b/Makefile
12 index e6d4609..bce1b0d 100644
15 @@ -8,10 +8,10 @@ zlibbundled=$(zlibdir)/libz.a
16 zlibldflags=$(zlibbundled)
17 zlibcppflags=-I$(zlibdir)
19 -CFLAGS = -fPIC -O2 -Wall -g -DWITH_ZSTD=1
20 -CPPFLAGS = -fPIC -DDELTARPM_64BIT -DBSDIFF_NO_SUF -DRPMDUMPHEADER=\"$(rpmdumpheader)\" $(zlibcppflags)
21 +CFLAGS += -fPIC -O2 -Wall -g -DWITH_ZSTD=1
22 +CPPFLAGS += -fPIC -DDELTARPM_64BIT -DBSDIFF_NO_SUF -DRPMDUMPHEADER=\"$(rpmdumpheader)\" $(zlibcppflags)
23 LDLIBS = -lbz2 $(zlibldflags) -llzma -lzstd
26 PYTHONS = python python3
28 all: makedeltarpm applydeltarpm rpmdumpheader makedeltaiso applydeltaiso combinedeltarpm fragiso
29 @@ -38,17 +38,10 @@ applydeltaiso: applydeltaiso.o util.o md5.o cfile.o $(zlibbundled)
30 fragiso: fragiso.o util.o md5.o rpmhead.o cfile.o $(zlibbundled)
32 _deltarpmmodule.so: readdeltarpm.o rpmhead.o util.o md5.o cfile.o $(zlibbundled)
33 - for PY in $(PYTHONS) ; do \
34 - if [ -x /usr/bin/$$PY-config ] && [ -x /usr/bin/$$PY ]; then \
35 - PYVER=`$$PY -c 'from distutils import sysconfig ; print(sysconfig.get_python_version())'`; \
36 - PYCFLAGS=`$$PY-config --cflags`; \
37 - if [ ! -f "python$$PYVER/$@" ]; then \
38 - mkdir -p python$$PYVER ;\
39 - $(CC) $(CFLAGS) $$PYCFLAGS $(zlibcppflags) -fPIC -c -o python$$PYVER/deltarpmmodule.o deltarpmmodule.c ;\
40 - $(CC) $(LDFLAGS) -o python$$PYVER/$@ python$$PYVER/deltarpmmodule.o $^ -shared -Wl,-soname,_deltarpmmodule.so $(LDLIBS); \
45 + $(CC) $(CFLAGS) -I=/usr/include/python2.7 $(zlibcppflags) -fPIC -c -o python2.7/_deltarpmmodule.o deltarpmmodule.c
46 + $(CC) $(LDFLAGS) -o python2.7/_deltarpmmodule.so python2.7/_deltarpmmodule.o $^ \
47 + -shared -Wl,-soname,_deltarpmmodule.so $(LDLIBS)
50 cd $(zlibdir) ; make CFLAGS="-fPIC $(CFLAGS)" libz.a
51 @@ -76,17 +69,9 @@ install:
52 install -m 644 applydeltaiso.8 $(DESTDIR)$(mandir)/man8
53 install -m 644 fragiso.8 $(DESTDIR)$(mandir)/man8
54 install -m 644 drpmsync.8 $(DESTDIR)$(mandir)/man8
55 - for PY in $(PYTHONS) ; do \
56 - if [ -x /usr/bin/$$PY ]; then \
57 - PYLIB=`$$PY -c 'from distutils import sysconfig ; print(sysconfig.get_python_lib(1))'` ; \
58 - PYVER=`$$PY -c 'from distutils import sysconfig ; print(sysconfig.get_python_version())'` ; \
59 - if [ -e python$$PYVER/_deltarpmmodule.so ]; then \
60 - mkdir -p $(DESTDIR)$(pylibprefix)$$PYLIB ; \
61 - install -m 755 python$$PYVER/_deltarpmmodule.so $(DESTDIR)$(pylibprefix)$$PYLIB ; \
62 - install -m 644 deltarpm.py $(DESTDIR)$(pylibprefix)$$PYLIB ; \
66 + mkdir -p $(DESTDIR)/$(libdir)/python2.7/site-packages/
67 + install -m 755 python2.7/_deltarpmmodule.so $(DESTDIR)/$(libdir)/python2.7/site-packages/
68 + install -m 644 deltarpm.py $(DESTDIR)/$(libdir)/python2.7/site-packages/
70 .PHONY: clean install perl
72 diff --git a/zlib-1.2.2.f-rsyncable/Makefile b/zlib-1.2.2.f-rsyncable/Makefile
73 index 29f53de..23b5daf 100644
74 --- a/zlib-1.2.2.f-rsyncable/Makefile
75 +++ b/zlib-1.2.2.f-rsyncable/Makefile
77 # To install in $HOME instead of /usr/local, use:
78 # make install prefix=$HOME
85 #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
87 #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
88 # -Wstrict-prototypes -Wmissing-prototypes