openbsd-ports/chinese/bg5pdf/patches/patch-Makefile
kevlo 54ced0f0e4 Simplify the code by not hardcoding the python version at all
and using whatever is the default in python.mk.

Based on the diff from fgsch@
2010-09-08 02:08:53 +00:00

22 lines
663 B
Plaintext

--- Makefile.orig Wed Sep 8 09:40:21 2010
+++ Makefile Wed Sep 8 09:51:02 2010
@@ -0,0 +1,18 @@
+PYTHON_INCLUDES=-I$(LOCALBASE)/include/python${MODPY_VERSION}
+
+all: bg5pdflib.so
+
+bg5pdflib.so: bg5pdflib.o
+ $(CC) -shared bg5pdflib.o -L$(LOCALBASE)/lib -lpdf -lz -o $@
+
+.c.o:
+ $(CC) $(CFLAGS) -fPIC $(PYTHON_INCLUDES) -I$(LOCALBASE)/include -c $<
+
+install:
+ mkdir -p $(DESTDIR)/$(LOCALBASE)/lib/python${MODPY_VERSION}/site-packages
+ install -m 755 -o root -g bin bg5pdf $(DESTDIR)/$(LOCALBASE)/bin
+ install -m 644 -o root -g bin bg5pdflib.so \
+ $(DESTDIR)/$(LOCALBASE)/lib/python${MODPY_VERSION}/site-packages
+
+clean:
+ rm -f *.o bg5pdflib.so