summaryrefslogtreecommitdiff
path: root/libraries/iniparser/patches/fixup_Makefile.patch
blob: b2ee300778f4c63f34fb218f4c09219ea0b469f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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)