summaryrefslogtreecommitdiffstats
path: root/net/sntop/files/patch-Makefile.in
blob: 7bf76d7fab9985a7eaf47f613b9062c4ad14162a (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
--- Makefile.in.orig	2001-11-11 21:54:15 UTC
+++ Makefile.in
@@ -36,12 +36,12 @@ DOWENEEDGETOPT = @LIBOBJS@
 MANDIR = @mandir@/man1
 SNTOPRC = $(ETCDIR)/sntoprc
 CC = @CC@
-CFLAGS = -Wall -Wstrict-prototypes -O2 @DEFS@ -DCONF_SFILE=\"$(SNTOPRC)\"
+CFLAGS+= -Wall -Wstrict-prototypes @DEFS@ -DCONF_SFILE=\"$(SNTOPRC)\"
 
 proper: clean sntop
 
 sntop: sntop.o
-	$(CC) -o sntop sntop.o $(OBJS) $(LIBS)
+	$(CC) -o sntop sntop.o $(OBJS) $(LDFLAGS) $(LIBS)
 	@echo "sntop: done compiling, now install with 'make install'"
 
 sntop.o: sntop.c
@@ -56,34 +56,33 @@ clean:
 	-rm getopt_long.o
 
 install: sntop
-	@if [ -d $(INSTDIR) ]; \
+	@if [ -d $(DESTDIR)$(INSTDIR) ]; \
 		then \
-		cp sntop $(INSTDIR); \
-		chmod 755 $(INSTDIR)/sntop; \
+		cp sntop $(DESTDIR)$(INSTDIR); \
+		chmod 755 $(DESTDIR)$(INSTDIR)/sntop; \
 	else \
 		echo "sntop: $(INSTDIR) does not exist"; false; \
 	fi
-	@if [ -d $(ETCDIR) ]; \
+	@if [ -d $(DESTDIR)$(ETCDIR) ]; \
 		then \
-		if [ ! -f $(ETCDIR)/sntoprc ]; \
+		if [ ! -f $(DESTDIR)$(ETCDIR)/sntoprc.sample ]; \
 			then \
-			cp sntoprc.EXAMPLE $(ETCDIR)/sntoprc; \
-			chmod 644 $(ETCDIR)/sntoprc; \
+			cp sntoprc.EXAMPLE $(DESTDIR)$(ETCDIR)/sntoprc.sample; \
+			chmod 644 $(DESTDIR)$(ETCDIR)/sntoprc.sample; \
 		fi; \
-		echo "sntop: Sample config exists at $(ETCDIR)/sntoprc"; \
+		echo "sntop: Sample config exists at $(ETCDIR)/sntoprc.sample"; \
 	else \
 		echo "sntop: $(ETCDIR) does not exist"; false; \
 	fi
-	@if [ -d $(MANDIR) ]; \
+	@if [ -d $(DESTDIR)$(MANDIR) ]; \
 		then \
-		cp sntop.1 $(MANDIR); \
-		chmod 644 $(MANDIR)/sntop.1; \
-		gzip -9 $(MANDIR)/sntop.1; \
+		cp sntop.1 $(DESTDIR)$(MANDIR); \
+		chmod 644 $(DESTDIR)$(MANDIR)/sntop.1; \
 		echo "sntop: Man file installed in $(MANDIR)"; \
 	else \
 		echo "sntop: $(MANDIR) does not exist, not installing man file"; \
 	fi
-	@if [ -f $(INSTDIR)/sntop ]; \
+	@if [ -f $(DESTDIR)$(INSTDIR)/sntop ]; \
 		then \
 		echo "sntop: Executable installed in $(INSTDIR)"; \
 	else \
OpenPOWER on IntegriCloud