aboutsummaryrefslogtreecommitdiffstats
path: root/dns/dhisd/files/patch-Makefile
blob: 48d58d4bf675f1cd88e083b97be818da0c4a8348 (plain) (blame)
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
71
72
73
74
75
76
77
78
79
80
--- Makefile.orig   2008-05-22 14:14:08 UTC
+++ Makefile
@@ -24,31 +24,31 @@
 # SUCH DAMAGE.
 #
 
-CC=gcc
+CC ?= ${CC}
 
-MYSQL_INCLUDE= -I/usr/local/include/mysql -I/usr/local/mysql/include \
-       -I/usr/local/mysql/include/mysql
+MYSQL_INCLUDE= -I${PREFIX}/include/mysql -I${PREFIX}/mysql/include \
+       -I${PREFIX}/mysql/include/mysql
 
-MYSQL_LIBDIR=  -L/usr/local/lib/mysql -L/usr/local/mysql/lib \
-       -L/usr/local/mysql/lib/mysql
+MYSQL_LIBDIR=  -L${PREFIX}/lib/mysql -L${PREFIX}/mysql/lib \
+       -L${PREFIX}/mysql/lib/mysql
 
-WFLAGS=-Wall -Wstrict-prototypes -Wpointer-arith \
-        -Wno-sign-compare -Wno-traditional -Wreturn-type -Wswitch -Wshadow \
+WFLAGS += -Wall -Wstrict-prototypes -Wpointer-arith \
+        -Wno-sign-compare -Wreturn-type -Wswitch -Wshadow \
         -Wwrite-strings -Wextra -funsigned-char 
 
 # Possible CFLAGS: -g -O3 -DDONT_FORK
 #
 
-CFLAGS= -O3 $(WFLAGS) -I. -I/usr/local/include # $(MYSQL_INCLUDE) -DWITH_MYSQL=1
-LFLAGS= -L/usr/local/lib # $(MYSQL_LIBDIR)
+CFLAGS= $(WFLAGS) -I. -I${PREFIX}/include
+LDFLAGS= -L${PREFIX}/lib
 
 # For System V (Solaris) add -lnsl and -lsocket
 # For MySQL support add -lmysqlclient
 LIBS=-lgmp # -lmysqlclient #-lnsl -lsocket 
 
-INSTALLBIN=/usr/local/sbin
-INSTALLCONF=/usr/local/etc
-INSTALLRC=/usr/local/etc/rc.d
+INSTALLBIN=${PREFIX}/sbin
+INSTALLCONF=${PREFIX}/etc
+INSTALLRC=${PREFIX}/etc/rc.d
 LOGDIR=/var/log/dhis
 PIDDIR=/var/run/dhis
 CP=cp
@@ -66,10 +66,10 @@ RM=rm -f
 all: dhisd dhisgenkeys
 
 dhisd: $(OBJS) main.o
-   $(CC) $(LFLAGS) -o dhisd $(OBJS) $(LIBS) main.o
+   $(CC) $(LDFLAGS) -o dhisd $(OBJS) $(LIBS) main.o
 
 dhisgenkeys: qrc.o genkeys.o
-   $(CC) $(LFLAGS) -o dhisgenkeys qrc.o $(LIBS) genkeys.o
+   $(CC) $(LDFLAGS) -o dhisgenkeys qrc.o $(LIBS) genkeys.o
 
 main.o: main.c
    $(CC) $(CFLAGS) -c main.c
@@ -84,18 +84,12 @@ install: dhisd  dhisgenkeys
    $(MKDIR) $(PIDDIR)
    $(CP) dhisd $(INSTALLBIN)
    $(CP) dhisgenkeys $(INSTALLBIN)
-   $(CHOWN) dhis $(INSTALLBIN)/dhisd $(INSTALLBIN)/dhisgenkeys $(LOGDIR) $(PIDDIR)
-   $(CHGRP) dhis $(INSTALLBIN)/dhisd $(INSTALLBIN)/dhisgenkeys $(LOGDIR) $(PIDDIR)
-   $(CHMOD) 770 $(INSTALLBIN)/dhisd $(INSTALLBIN)/dhisgenkeys $(LOGDIR) $(PIDDIR)
+   $(CHMOD) 750 $(INSTALLBIN)/dhisd $(INSTALLBIN)/dhisgenkeys $(LOGDIR) $(PIDDIR)
    $(CHMOD) u+s $(INSTALLBIN)/dhisd
    $(CP) dhis.db.sample dhisd.conf.sample $(INSTALLCONF)
-   $(CHOWN) dhis $(INSTALLCONF)/dhis.db.sample $(INSTALLCONF)/dhisd.conf.sample
-   $(CHGRP) dhis $(INSTALLCONF)/dhis.db.sample $(INSTALLCONF)/dhisd.conf.sample
    $(CHMOD) 640 $(INSTALLCONF)/dhis.db.sample $(INSTALLCONF)/dhisd.conf.sample
    $(CP) dhisd.rc $(INSTALLRC)/dhisd
-   $(CHOWN) dhis $(INSTALLRC)/dhisd
-   $(CHGRP) dhis $(INSTALLRC)/dhisd
-   $(CHMOD) 755 $(INSTALLRC)/dhisd
+   $(CHMOD) 555 $(INSTALLRC)/dhisd
 
 clean:
    $(RM) dhisgenkeys *.core core dhisd *.o *~