[Commits] r649 - trunk/daemon

new-commit at lists.openvcp.org new-commit at lists.openvcp.org
Thu Feb 5 18:27:39 UTC 2009


Author: ftx
Date: 2009-02-05 18:27:39 +0000 (Thu, 05 Feb 2009)
New Revision: 649

Modified:
   trunk/daemon/Makefile.in
   trunk/daemon/configure.ac
Log:
applied DESTDIR patch and non-bash patch
Closes: #239 and #238



Modified: trunk/daemon/Makefile.in
===================================================================
--- trunk/daemon/Makefile.in	2009-01-10 14:26:10 UTC (rev 648)
+++ trunk/daemon/Makefile.in	2009-02-05 18:27:39 UTC (rev 649)
@@ -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

Modified: trunk/daemon/configure.ac
===================================================================
--- trunk/daemon/configure.ac	2009-01-10 14:26:10 UTC (rev 648)
+++ trunk/daemon/configure.ac	2009-02-05 18:27:39 UTC (rev 649)
@@ -8,6 +8,9 @@
 # Checks for programs.
 AC_PROG_CC
 
+AC_ARG_VAR([PKGCONFIG], [pkg-config path])
+AC_PATH_PROG([PKGCONFIG], [pkg-config], [no])
+
 # Checks for libraries.
 AC_CHECK_LIB([vserver], [vc_ctx_migrate], ,[AC_MSG_ERROR([libvserver(util-vserver) not found])])
 AC_CHECK_LIB([sqlite3], [sqlite3_close], ,[AC_MSG_ERROR([libsqlite3 not found])])
@@ -67,15 +70,20 @@
 fi
 
 if test "x$with_ipv6" != xno; then
-        CFLAGS+=" -DIPV6_SUPPORT"
+        CFLAGS="$CFLAGS -DIPV6_SUPPORT"
 fi
 
+if test "$PKGCONFIG" = "no"; then
+  AC_MSG_ERROR([pkg-config is required])
+fi
+
+
 xmlflags=`pkg-config libxml-2.0 --cflags`
-if test "$xmlflags" == ""; then
+if test "$xmlflags" = ""; then
 	AC_MSG_ERROR([libxml2 headers not found])
 fi
 
-CFLAGS+=" $xmlflags"
+CFLAGS="$CFLAGS $xmlflags"
 
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT



More information about the Commits mailing list