summaryrefslogtreecommitdiffstats
path: root/testing/openvcp/openvcpd-0.4-rc1-makefile.patch
blob: a7a26e52cb23296d7b7d8e174a0d3fecd5552aea (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
--- a/Makefile.in	Wed Feb  4 10:55:05 2009
+++ b/Makefile.in	Wed Feb  4 10:57:25 2009
@@ -3,8 +3,9 @@
 datadir = @datarootdir@
 sysconfdir = @sysconfdir@
 
+REV:=$(shell svnversion 2>/dev/null | sed 's/M//')
 CC=@CC@
-CFLAGS=@CFLAGS@ @DEFS@ -DOPENVCP_CONFIG=\"$(sysconfdir)/openvcpd.conf\" -DOPENVCP_DATA=\"$(datadir)/openvcpd\" -Ilib/ -Isrc/ -rdynamic -DREVISION=\"`svnversion | sed 's/M//'`\"
+CFLAGS=@CFLAGS@ @DEFS@ -DOPENVCP_CONFIG=\"$(sysconfdir)/openvcpd.conf\" -DOPENVCP_DATA=\"$(datadir)/openvcpd\" -Ilib/ -Isrc/ -rdynamic -DREVISION=\"$(REV)\"
 LDFLAGS=@LDFLAGS@
 LIBS=@LIBS@
 
@@ -39,22 +40,24 @@
 	@rm -f parse_ipfmlogs
 
 install:
-	mkdir -p $(datadir)/openvcpd
-	cp openvcpd $(bindir)/openvcpd
-	cp parse_ipfmlogs $(bindir)/parse_ipfmlogs
+	mkdir -p "$(DESTDIR)/$(datadir)"/openvcpd \
+		"$(DESTDIR)/$(bindir)" \
+		"$(DESTDIR)/$(sysconfdir)"
+	cp openvcpd "$(DESTDIR)/$(bindir)"/openvcpd
+	cp parse_ipfmlogs "$(DESTDIR)/$(bindir)"/parse_ipfmlogs
 
-	@if (test -e $(sysconfdir)/openvcpd.conf); then \
+	@if (test -e "$(DESTDIR)/$(sysconfdir)"/openvcpd.conf); then \
 		echo "Configuration File exists. Please check for updates of the configurationfile"; \
 	else	\
                 cfgdir=`vserver-info 2>&1 | grep 'cfg-Directory:' | awk -F: '{ print $$2 }' | cut -c2-`; \
                 rootdir=`vserver-info 2>&1 | grep 'vserver-Rootdir:' | awk -F: '{ print $$2 }' | cut -c2-`; \
                 rundir=`vserver-info 2>&1 | grep 'pkgstate-Directory:' | awk -F: '{ print $$2 }' | cut -c2-`; \
                 echo "CONF: $$cfgdir, $$rootdir, $$rundir"; \
-                cat openvcpd.conf | sed s#'CONFIGDIR'#$$cfgdir# | sed s#'ROOTDIR'#$$rootdir# | sed s#'RUNDIR'#$$rundir# > $(sysconfdir)/openvcpd.conf; \
+                cat openvcpd.conf | sed s#'CONFIGDIR'#$$cfgdir# | sed s#'ROOTDIR'#$$rootdir# | sed s#'RUNDIR'#$$rundir# > $(DESTDIR)/$(sysconfdir)/openvcpd.conf; \
 		echo "Configuration File created ($(sysconfdir)/openvcpd.conf)"; \
 	fi \
 
 uninstall:
-	rm -rf $(datadir)/openvcpd
-	rm -f $(bindir)/openvcpd
-	rm -f $(sysconfdir)/openvcpd.conf
+	rm -rf "$(DESTDIR)/$(datadir)"/openvcpd
+	rm -f "$(DESTDIR)/$(bindir)"/openvcpd
+	rm -f "$(DESTDIR)/$(sysconfdir)"/openvcpd.conf