slackbuilds_ponce/libraries/iniparser/patches/fixup_Makefile.patch
Steven King 31ececa12a libraries/iniparser: Added (stand-alone INI file parsing library)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
2010-11-29 12:45:56 +01:00

70 lines
1.8 KiB
Diff

diff -Nur iniparser-2.17.orig//Makefile iniparser-2.17/Makefile
--- iniparser-2.17.orig//Makefile 2007-05-27 08:07:09.000000000 -0500
+++ iniparser-2.17/Makefile 2010-11-27 20:53:39.674677644 -0600
@@ -6,20 +6,29 @@
CC = gcc
CFLAGS = -O3 -fPIC
+# Install paths
+PREFIX = /usr
+LIBDIR = $(PREFIX)/lib
+INCDIR = $(PREFIX)/include
+DOCDIR = $(PREFIX)/share/doc/iniparser
+
# Ar settings to build the library
AR = ar
ARFLAGS = rcv
SHLD = ${CC} ${CFLAGS}
-LDSHFLAGS = -shared -Wl,-Bsymbolic -Wl,-rpath -Wl,/usr/lib -Wl,-rpath,/usr/lib
-LDFLAGS = -Wl,-rpath -Wl,/usr/lib -Wl,-rpath,/usr/lib
+LDSHFLAGS = -shared -Wl,-Bsymbolic -Wl,-rpath -Wl,$(LIBDIR) -Wl,-rpath,$(LIBDIR)
+LDFLAGS = -Wl,-rpath -Wl,$(LIBDIR) -Wl,-rpath,$(LIBDIR)
# Set RANLIB to ranlib on systems that require it (Sun OS < 4, Mac OSX)
# RANLIB = ranlib
RANLIB = true
RM = rm -f
-
+MKDIR = mkdir -p
+CP = cp -a
+LN = ln -s
+INSTALL = install
# Implicit rules
@@ -37,6 +46,7 @@
OBJS = $(SRCS:.c=.o)
+DOCFILES = AUTHORS INSTALL LICENSE README
default: libiniparser.a libiniparser.so
@@ -48,6 +58,25 @@
@$(SHLD) $(LDSHFLAGS) -o $@.0 $(OBJS) $(LDFLAGS) \
-Wl,-soname=`basename $@`.0
+install-lib: libiniparser.a libiniparser.so
+ $(MKDIR) $(DESTDIR)/$(LIBDIR)
+ $(INSTALL) -m 0755 libiniparser.so.0 $(DESTDIR)/$(LIBDIR)
+ $(INSTALL) -m 0644 libiniparser.a $(DESTDIR)/$(LIBDIR)
+ @(cd $(DESTDIR)/$(LIBDIR) ; $(LN) libiniparser.so.0 libiniparser.so)
+
+install-dev:
+ $(MKDIR) $(DESTDIR)/$(INCDIR)
+ $(INSTALL) -m 0644 src/iniparser.h $(DESTDIR)/$(INCDIR)
+ $(MKDIR) $(DESTDIR)/$(INCDIR)/iniparser
+ $(INSTALL) -m 0644 src/dictionary.h $(DESTDIR)/$(INCDIR)/iniparser/
+
+install-docs:
+ $(MKDIR) $(DESTDIR)/$(DOCDIR)
+ $(INSTALL) -m 0644 $(DOCFILES) $(DESTDIR)/$(DOCDIR)
+ $(CP) html $(DESTDIR)/$(DOCDIR)
+
+install: install-lib install-dev
+
clean:
$(RM) $(OBJS)