[vhffs-dev] [583] Added compat scripts installation to autotools.

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 583
Author:   beuss
Date:     2007-04-19 20:05:49 +0000 (Thu, 19 Apr 2007)

Log Message:
-----------
Added compat scripts installation to autotools.
Fixed a couple of typo.

Modified Paths:
--------------
    trunk/configure.ac
    trunk/vhffs-compat/updatedb.pl

Added Paths:
-----------
    trunk/vhffs-compat/Makefile.am


Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2007-04-19 10:50:04 UTC (rev 582)
+++ trunk/configure.ac	2007-04-19 20:05:49 UTC (rev 583)
@@ -126,7 +126,7 @@
 dnl Mail
 AC_ARG_WITH(mail-path,
 	AC_HELP_STRING([--with-mail-path=path],
-		[Complete path for email files (/usr/share/vhffs/mails)]),
+		[Complete path for email files (/usr/share/vhffs/listengine)]),
 	MAILSDIR=$withval,
 	MAILSDIR=/usr/lib/vhffs/listengine
 )
@@ -144,12 +144,23 @@
 dnl documentation
 AC_ARG_WITH(doc-path,
 	AC_HELP_STRING([--with-doc-path=path],
-		[Complete path for documentation files (/usr/share/vhffs/mails)]),
+		[Complete path for documentation files (/usr/share/doc/vhffs)]),
 	DOCSDIR=$withval,
-	DOCSDIR=/usr/docs/
+	DOCSDIR=/usr/share/doc/vhffs
 )
 AC_SUBST(DOCSDIR)
 
+dnl Compatibility stuff
+
+AC_ARG_WITH(compat-path,
+    AC_HELP_STRING([--with-compat-path=path],
+        [Complete path for compatibility scripts (/usr/share/doc/vhffs/compat)]),
+    COMPATDIR=$withval,
+    COMPATDIR=/usr/share/doc/vhffs/compat
+)
+AC_SUBST(COMPATDIR)
+
+
 dnl setup min uid and gid
 AC_ARG_WITH(min-uid,
 	AC_HELP_STRING([--with-min-uid=uid],
@@ -167,7 +178,6 @@
 )
 AC_SUBST(MINGID)
 
-
 # -- Starting system checks
 AC_CHECK_HEADERS([stdlib.h string.h sys/time.h syslog.h unistd.h])
 
@@ -202,6 +212,7 @@
 	vhffs-api/src/Makefile
 	vhffs-api/src/Vhffs/Makefile
 	vhffs-backend/Makefile
+    vhffs-compat/Makefile
 	vhffs-doc/Makefile
 	vhffs-intl/Makefile
 	vhffs-jabber/Makefile

Added: trunk/vhffs-compat/Makefile.am
===================================================================
--- trunk/vhffs-compat/Makefile.am	2007-04-19 10:50:04 UTC (rev 582)
+++ trunk/vhffs-compat/Makefile.am	2007-04-19 20:05:49 UTC (rev 583)
@@ -0,0 +1,24 @@
+compatdir = @COMPATDIR@
+compat_DATA = \
+	4.0pre1.sql \
+	4.0.sql
+
+compat_SCRIPTS = \
+	updatedb.pl
+
+# Define the substitution we need to point perl script at correct location
+do_sed = $(SED) --in-place \
+	-e 's,%PERL%,$(PERL),g' \
+	-e 's,'%VHFFS_LIB_DIR%',$(VHFFS_LIBDIR),g' \
+	-e 's,'%VHFFS_BACKEND_DIR%',$(BACKENDDIR),g' \
+	-e 's,'%VHFFS_COMPAT_DIR%',$(compatdir),g'
+
+# Because automake, exec-hook is executed before install-scripts
+# so install-data is after. Here we use a data-hook
+install-data-hook :
+	for f in $(compat_DATA) ; do \
+		$(do_sed) $(DESTDIR)$(compatdir)/$$f; \
+	done
+	for f in $(compat_SCRIPTS) ; do \
+		$(do_sed) $(DESTDIR)$(compatdir)/$$f; \
+	done

Modified: trunk/vhffs-compat/updatedb.pl
===================================================================
--- trunk/vhffs-compat/updatedb.pl	2007-04-19 10:50:04 UTC (rev 582)
+++ trunk/vhffs-compat/updatedb.pl	2007-04-19 20:05:49 UTC (rev 583)
@@ -31,7 +31,7 @@
 # 
 
 
-use lib "/usr/share/vhffs/api";
+use lib '%VHFFS_LIB_DIR%';
 use Term::ReadPassword;
 use File::Basename;
 use File::Temp;
@@ -42,9 +42,7 @@
 
 use strict;
 
-# get vhffs sources base dir
-my $BASE_DIR = dirname(dirname(abs_path(getcwd()."/$0")));
-my $SQL_DIR = $BASE_DIR.'/vhffs-backend/src/pgsql/';
+my $SQL_DIR = '%VHFFS_BACKEND_DIR%/';
 
 
 sub confirm($) {
@@ -60,12 +58,12 @@
 }
 
 sub upgrade_40_pre1() {
-    my $script = $BASE_DIR.'/vhffs-compat/4.0pre1.sql';
+    my $script = '%VHFFS_COMPAT_DIR%/4.0pre1.sql';
     system("psql -f $script");
 }
 
 sub upgrade_40() {
-    my $script = $BASE_DIR.'/vhffs-compat/4.0.sql';
+    my $script = '%VHFFS_COMPAT_DIR%/4.0.sql';
     system("psql -f $script");
 }
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/