public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: "Fabio M. Di Nitto" <fabbione@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: resource-agents: master - build: convert to autoconf/automake/libtool
Date: Wed, 24 Jun 2009 06:50:00 -0000	[thread overview]
Message-ID: <20090624064943.D28E1120280@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git;a=commitdiff;h=9a3ad477a7d13441ddd941762a1ace98341e2c6f
Commit:        9a3ad477a7d13441ddd941762a1ace98341e2c6f
Parent:        70f5c5dcda594aa29ad07cfe23bd3342e1e7c5c5
Author:        Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate:    Wed Jun 24 08:48:41 2009 +0200
Committer:     Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Wed Jun 24 08:48:41 2009 +0200

build: convert to autoconf/automake/libtool

requires:
 - autoconf  2.63b
 - automake  1.11
 - libtool   2.2.7a
 - pkgconfig 0.23
 - m4        1.4.13

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
 .gitignore                                |   44 +++++--
 Makefile                                  |   46 -------
 Makefile.am                               |   20 +++
 autogen.sh                                |    3 +
 configure                                 |  209 -----------------------------
 configure.ac                              |   87 ++++++++++++
 doc/Makefile                              |   16 ---
 doc/Makefile.am                           |   10 ++
 make/clean.mk                             |    7 -
 make/defines.mk.input                     |   21 ---
 make/install.mk                           |    8 -
 make/official_release_version             |    1 -
 make/passthrough.mk                       |    7 -
 make/uninstall.mk                         |    4 -
 rgmanager/Makefile                        |    4 -
 rgmanager/Makefile.am                     |    3 +
 rgmanager/src/Makefile                    |    4 -
 rgmanager/src/Makefile.am                 |    3 +
 rgmanager/src/resources/Makefile          |   85 ------------
 rgmanager/src/resources/Makefile.am       |   62 +++++++++
 rgmanager/src/resources/utils/Makefile.am |   28 ++++
 scripts/uninstall.pl                      |   71 ----------
 22 files changed, 247 insertions(+), 496 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4ca135d..eeb5815 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,14 +1,32 @@
-make/defines.mk
-.configure.sh
-*.d
+*.swp
+Makefile.in
+aclocal.m4
+autoconf
+autoheader
+autom4te.cache
+automake
+compile
+configure
+config.guess
+config.log
+config.sub
+config.status
+Makefile
+depcomp
+install-sh
+libtoolize
+ltmain.sh
+libtool
+make/stamp-h1
+m4
+make/clusterautoconfig.h*
+missing
+*.pc
+.deps
+.libs
 *.o
-*.a
-*.so*
-*.lcrso
-*.po
-.*.*o.cmd
-.tmp_versions
-*.ko
-Module.symvers
-modules.order
-*.mod.c
+*.la
+*.lo
+rgmanager/src/resources/fs.sh
+rgmanager/src/resources/oracledb.sh
+rgmanager/src/resources/utils/config-utils.sh
diff --git a/Makefile b/Makefile
deleted file mode 100644
index c3e6c96..0000000
--- a/Makefile
+++ /dev/null
@@ -1,46 +0,0 @@
-include make/defines.mk
-
-REALSUBDIRS = rgmanager doc
-
-SUBDIRS = $(REALSUBDIRS)
-
-all: ${SUBDIRS}
-
-${SUBDIRS}:
-	[ -n "${without_$@}" ] || ${MAKE} -C $@ all
-
-rgmanager:
-
-oldconfig:
-	@if [ -f $(OBJDIR)/.configure.sh ]; then \
-		sh $(OBJDIR)/.configure.sh; \
-	else \
-		echo "Unable to find old configuration data"; \
-	fi
-
-install:
-	set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
-	install -d ${logdir}
-	install -d ${DESTDIR}/var/lib/cluster
-	install -d ${DESTDIR}/var/run/cluster
-
-uninstall:
-	set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
-	rmdir ${logdir} || :;
-	rmdir ${DESTDIR}/var/lib/cluster || :;
-	rmdir ${DESTDIR}/var/run/cluster || :;
-
-clean:
-	set -e && for i in ${REALSUBDIRS}; do \
-		contrib_code=1 \
-		legacy_code=1 \
-		${MAKE} -C $$i $@;\
-	done
-
-distclean: clean
-	rm -f make/defines.mk
-	rm -f .configure.sh
-	rm -f *tar.gz
-	rm -rf build
-
-.PHONY: ${REALSUBDIRS}
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..a570954
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,20 @@
+EXTRA_DIST		= autogen.sh
+
+AUTOMAKE_OPTIONS	= foreign
+
+MAINTAINERCLEANFILES	= Makefile.in aclocal.m4 configure \
+			  missing install-sh
+
+noinst_HEADERS		= make/copyright.cf
+
+SUBDIRS			= rgmanager doc
+
+install-exec-local:
+			$(INSTALL) -d $(DESTDIR)/$(LOGDIR)
+			$(INSTALL) -d $(DESTDIR)/$(CLUSTERVARRUN)
+			$(INSTALL) -d $(DESTDIR)/$(CLUSTERVARLIB)
+
+uninstall-local:
+			rmdir $(DESTDIR)/$(LOGDIR) || :;
+			rmdir $(DESTDIR)/$(CLUSTERVARRUN) || :;
+			rmdir $(DESTDIR)/$(CLUSTERVARLIB) || :;
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..a10bf96
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+autoreconf -i -v && echo Now run ./configure and make
diff --git a/configure b/configure
deleted file mode 100755
index fdbb6d1..0000000
--- a/configure
+++ /dev/null
@@ -1,209 +0,0 @@
-#!/usr/bin/perl -w
-
-use warnings;
-use Getopt::Long;
-use Cwd 'abs_path';
-use File::Basename;
-
-print "\nConfiguring Makefiles for your system...\n";
-
-# Set a bunch of variables
-
-my @invoke = @ARGV;
-
-my $ret = 0;
-
-my %options = (
-	help => \$help,
-	objdir => \$objdir,
-	prefix => \$prefix,
-	sharedir => \$sharedir,
-	docdir => \$docdir,
-	logdir => \$logdir,
-	confdir => \$confdir,
-	conffile => \$conffile,
-	enable_crack_of_the_day => \$enable_crack_of_the_day,
-	enable_legacy_code => \$enable_legacy_code,
-	release_version => \$release_version,
-);
-
-my $err = &GetOptions (\%options,
-		    'help',
-		    'objdir=s',
-		    'prefix=s',
-		    'sharedir=s',
-		    'docdir=s',
-		    'logdir=s',
-		    'confdir=s',
-		    'conffile=s',
-		    'release_version=s',
-		    'enable_crack_of_the_day',
-		    'enable_legacy_code');
-
-if(!$err) {
-  $ret = 1;
-  print "*** ERROR: Invalid option detected ***\n";
-}
-
-# Check for the --help flag
-if ($help || !$err) {
-  $_ = $0;
-  s/.*\.\/(.*)/$1/;
-  print "Usage: $_ [flags]\n";
-  print "--help\t\tPrints this usage information\n\n";
-  print "install flags:\n";
-  print "--prefix=\tthe base directory to install into.  (Default: /usr)\n";
-  print "--sharedir=\tthe base directory for misc cluster files.  (Default: {prefix}/share/cluster)\n";
-  print "--docdir=\tthe base directory for misc cluster documentation files.  (Default: {prefix}/share/doc/cluster)\n";
-  print "--logdir=\tthe base directory for cluster logging files.  (Default: /var/log/cluster/)\n";
-  print "--confdir=\tthe cluster config directory.  (Default: /etc/cluster)\n";
-  print "--conffile=\tthe cluster config file.  (Default: cluster.conf)\n";
-  print "\nbuild flags:\n";
-  print "--objdir=\tspecify directory where to store object files.  (Defaults: current build dir)\n";
-  print "--enable_crack_of_the_day\tEnable build of highly experimental features that rely on code that is not yet available for general use. (Default: no)\n";
-  print "--enable_legacy_code\tEnable build of old/obsolete/unsupported code/tools.  (Default: no)\n";
-  exit $ret;
-}
-
-sub symlinks {
-  my $dir = shift;
-  my $pattern = shift;
-  @args = "find $dir -type f -name $pattern";
-  open (IFILE, "@args |");
-  while (<IFILE>) {
-    chomp;
-    s|\./||g;
-    s|.*make\/defines.mk||g;
-    $dirname = dirname($_);
-    $filename = basename($_);
-    system("mkdir -p $objdir/$dirname");
-    symlink("${cdir}/$_","$objdir/$dirname/$filename");
-  }
-  close IFILE;
-  return 0;
-}
-
-$pwd = `pwd`;
-chomp($pwd);
-
-
-if (!$prefix) {
-  $prefix="/usr";
-}
-
-print "\nChecking tree: ";
-if (!$objdir) {
-  $objdir="${pwd}";
-}
-$objdir = abs_path( $objdir );
-$cdir = dirname ( abs_path( $0 ) );
-unless ("$cdir" eq "$objdir") {
-  chdir "$cdir";
-}
-
-if (! -d "$objdir/make") {
-  print "setting up $objdir\n";
-  mkdir "$objdir";
-  symlinks(".","Makefile");
-  symlinks(".","*.mk");
-} else {
-  print "nothing to do\n";
-}
-
-if (!$sharedir) {
-  $sharedir="${prefix}/share/cluster";
-}
-if (!$docdir) {
-  $docdir="${prefix}/share/doc/cluster";
-}
-if (!$logdir) {
-  $logdir="/var/log/cluster";
-}
-if (!$confdir) {
-  $confdir="/etc/cluster";
-}
-if (!$conffile) {
-  $conffile="cluster.conf";
-}
-if (!$enable_crack_of_the_day) {
-  $enable_crack_of_the_day="";
-} else {
-  print "\n********************************************************************************************\n";
-  print "WARNING: *you* have explicitly enabled all possible experimental features under development!\n";
-  print "         This code will have no mercy for your data and your machines. You have been warned!\n";
-  print "\n********************************************************************************************\n";
-  $cflags="${cflags} -DEXPERIMENTAL_BUILD";
-}
-if (!$enable_legacy_code) {
-  $enable_legacy_code="";
-} else {
-  print "\n********************************************************************************************\n";
-  print "WARNING: *you* have explicitly enabled the build of old/obsoleted/unsupported code/tools\n";
-  print "         This code is provided *only* for backward compatibility\n";
-  print "\n********************************************************************************************\n";
-  $cflags="${cflags} -DLEGACY_CODE";
-}
-if (defined($release_version) && not length $release_version) {
-  $release_version="";
-}
-
-open IFILE, "<make/defines.mk.input" or die "Can't redirect stdin";
-open OFILE, ">${objdir}/make/defines.mk" or die "Can't redirect stdout";
-
-print OFILE "# This file was generated by configure from defines.mk.input\n";
-
-while (<IFILE>) {
-  chomp;
-  $_ =~ s/\@SRCDIR\@/$cdir/;
-  $_ =~ s/\@OBJDIR\@/$objdir/;
-  $_ =~ s/\@SHAREDIR\@/$sharedir/;
-  $_ =~ s/\@DOCDIR\@/$docdir/;
-  $_ =~ s/\@LOGDIR\@/$logdir/;
-  $_ =~ s/\@CONFDIR\@/$confdir/;
-  $_ =~ s/\@CONFFILE\@/$conffile/;
-  $_ =~ s/\@ENABLE_CRACK_OF_THE_DAY\@/$enable_crack_of_the_day/;
-  $_ =~ s/\@ENABLE_LEGACY_CODE\@/$enable_legacy_code/;
-
-  print OFILE "$_\n";
-}
-
-close IFILE;
-
-if (not defined($release_version)) {
-
-  my $current_version;
-  if ( -f 'make/official_release_version' ) {
-    open OFFICIAL_VERSION, '<', "make/official_release_version";
-    while (<OFFICIAL_VERSION>) {
-      if ($_ =~ /VERSION/) {
-	$current_version = $_;
-      }
-    }
-    close OFFICIAL_VERSION;
-  }
-
-  if (not defined($release_version)) {
-    if (not defined($current_version)) {
-      $release_version = `date +%s`;
-      chomp $release_version;
-    } else {
-      $release_version = $current_version;
-      $release_version =~ s/.*"(.*)"\n/$1/;
-    }
-  }
-}
-
-print OFILE "RELEASE_VERSION = $release_version\n";
-print OFILE "CFLAGS += -DRELEASE_VERSION=\\\"$release_version\\\"\n";
-
-close OFILE;
-
-open OFILE, ">${objdir}/.configure.sh.tmp" or die "Can't redirect stdout";
-print OFILE "#!/bin/bash\n";
-print OFILE "$0 @invoke \$@\n";
-print OFILE "exit \$?\n";
-close OFILE;
-
-system("mv ${objdir}/.configure.sh.tmp ${objdir}/.configure.sh");
-
-print "Completed Makefile configuration\n\n";
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..ace859f
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,87 @@
+
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.63b])
+AC_INIT([resource-agents], [master], [linux-cluster@redhat.com])
+AM_INIT_AUTOMAKE([-Wno-portability])
+
+AC_CONFIG_SRCDIR([rgmanager/src/resources/ip.sh])
+
+# Sanitize path
+
+if test "$prefix" = "NONE"; then
+	prefix="/usr"
+	if test "$localstatedir" = "\${prefix}/var"; then
+		localstatedir="/var"
+	fi
+	if test "$sysconfdir" = "\${prefix}/etc"; then
+		sysconfdir="/etc"
+	fi
+	if test "$libdir" = "\${exec_prefix}/lib"; then
+		if test -e /usr/lib64; then
+			libdir="/usr/lib64"
+		else
+			libdir="/usr/lib"
+		fi
+	fi
+fi
+
+case $exec_prefix in
+  NONE)   exec_prefix=$prefix;;
+  prefix) exec_prefix=$prefix;;
+esac
+
+# Checks for programs.
+
+# check stolen from gnulib/m4/gnu-make.m4
+if ! ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then
+	AC_MSG_ERROR([you don't seem to have GNU make; it is required])
+fi
+
+AC_PROG_AWK
+AC_PROG_LN_S
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+
+# local options
+AC_ARG_ENABLE([debug],
+	[  --enable-debug          enable debug build. ],
+	[ default="no" ])
+
+AC_ARG_WITH([default-config-dir],
+	[  --default-config-dir=DIR
+                          cluster config directory. ],
+	[ DEFAULT_CONFIG_DIR="$withval" ],
+	[ DEFAULT_CONFIG_DIR="$sysconfdir/cluster" ])
+
+AC_ARG_WITH([default-config-file],
+	[  --default-config-file=FILE
+                          cluster config file. ],
+	[ DEFAULT_CONFIG_FILE="$withval" ],
+	[ DEFAULT_CONFIG_FILE="cluster.conf" ])
+
+## random vars
+
+LOGDIR=${localstatedir}/log/cluster
+CLUSTERVARRUN=${localstatedir}/run/cluster
+CLUSTERVARLIB=${localstatedir}/lib/cluster
+CLUSTERDATA=${datadir}/cluster
+
+## do subst
+
+AC_SUBST([DEFAULT_CONFIG_DIR])
+AC_SUBST([DEFAULT_CONFIG_FILE])
+AC_SUBST([LOGDIR])
+AC_SUBST([CLUSTERVARRUN])
+AC_SUBST([CLUSTERVARLIB])
+AC_SUBST([CLUSTERDATA])
+
+AC_CONFIG_FILES([Makefile
+		 rgmanager/Makefile
+		 rgmanager/src/Makefile
+		 rgmanager/src/resources/Makefile
+		 rgmanager/src/resources/utils/Makefile
+		 doc/Makefile
+		 ])
+
+AC_OUTPUT
diff --git a/doc/Makefile b/doc/Makefile
deleted file mode 100644
index 24192ba..0000000
--- a/doc/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-DOCS =	gfs2.txt \
-	journaling.txt \
-	min-gfs.txt \
-	usage.txt \
-	COPYING.applications \
-	COPYING.libraries \
-	COPYRIGHT \
-	README.licence
-
-all:
-
-clean:
-
-include ../make/defines.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..2e6a2ec
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,10 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+dist_doc_DATA		= gfs2.txt \
+			  journaling.txt \
+			  min-gfs.txt \
+			  usage.txt \
+			  COPYING.applications \
+			  COPYING.libraries \
+			  COPYRIGHT \
+			  README.licence
diff --git a/make/clean.mk b/make/clean.mk
deleted file mode 100644
index b31a3fa..0000000
--- a/make/clean.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-generalclean:
-	rm -rf *~* *.o *.a *.so *.so.* a.out *.po *.s *.d *.pyc
-	rm -rf core core.* .depend cscope.* *.orig *.rej
-	rm -rf linux .*.o.cmd .*.ko.cmd *.mod.c .tmp_versions
-	rm -rf Module.symvers Module.markers .*.o.d modules.order
-	rm -rf ${TARGET} ${TARGETS} ${TARGET}_test
-	rm -rf ${TARGET1} ${TARGET2} ${TARGET3} ${TARGET4} ${TARGET5} ${TARGET6}
diff --git a/make/defines.mk.input b/make/defines.mk.input
deleted file mode 100644
index 738cefe..0000000
--- a/make/defines.mk.input
+++ /dev/null
@@ -1,21 +0,0 @@
-# Install Locations
-sharedir ?= ${DESTDIR}@SHAREDIR@
-docdir ?= ${DESTDIR}@DOCDIR@
-logdir ?= ${DESTDIR}@LOGDIR@
-
-# Build information
-
-SRCDIR = @SRCDIR@
-OBJDIR = @OBJDIR@
-
-experimental_build ?= @ENABLE_CRACK_OF_THE_DAY@
-legacy_code ?= @ENABLE_LEGACY_CODE@
-
-THISDIR = $(shell echo $(CURDIR) | sed -e 's|$(OBJDIR)/||g')
-S=$(SRCDIR)/$(THISDIR)
-
-CONFDIR=@CONFDIR@
-CONFFILE=@CONFFILE@
-
-UNINSTALL = perl @SRCDIR@/scripts/uninstall.pl
-FENCEPARSE = bash @SRCDIR@/scripts/fenceparse
diff --git a/make/install.mk b/make/install.mk
deleted file mode 100644
index b73ccdf..0000000
--- a/make/install.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-install:
-ifdef DOCS
-	install -d ${docdir}
-	set -e; \
-	for i in ${DOCS}; do \
-		install -m644 $(S)/$$i ${docdir}; \
-	done
-endif
diff --git a/make/official_release_version b/make/official_release_version
deleted file mode 100644
index 211c0c2..0000000
--- a/make/official_release_version
+++ /dev/null
@@ -1 +0,0 @@
-SONAME "3.0"
diff --git a/make/passthrough.mk b/make/passthrough.mk
deleted file mode 100644
index 979a86c..0000000
--- a/make/passthrough.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-all: ${SUBDIRS}
-
-%:
-	set -e && \
-	for i in ${SUBDIRS}; do \
-		${MAKE} -C $$i $@; \
-	done
diff --git a/make/uninstall.mk b/make/uninstall.mk
deleted file mode 100644
index 1c6e490..0000000
--- a/make/uninstall.mk
+++ /dev/null
@@ -1,4 +0,0 @@
-uninstall:
-ifdef DOCS
-	${UNINSTALL} ${DOCS} ${docdir}
-endif
diff --git a/rgmanager/Makefile b/rgmanager/Makefile
deleted file mode 100644
index 313743d..0000000
--- a/rgmanager/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../make/defines.mk
-include $(OBJDIR)/make/passthrough.mk
-
-SUBDIRS=src
diff --git a/rgmanager/Makefile.am b/rgmanager/Makefile.am
new file mode 100644
index 0000000..bc2f2a8
--- /dev/null
+++ b/rgmanager/Makefile.am
@@ -0,0 +1,3 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+SUBDIRS			= src
diff --git a/rgmanager/src/Makefile b/rgmanager/src/Makefile
deleted file mode 100644
index bf6396b..0000000
--- a/rgmanager/src/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../../make/defines.mk
-include $(OBJDIR)/make/passthrough.mk
-
-SUBDIRS=resources
diff --git a/rgmanager/src/Makefile.am b/rgmanager/src/Makefile.am
new file mode 100644
index 0000000..8b16e1a
--- /dev/null
+++ b/rgmanager/src/Makefile.am
@@ -0,0 +1,3 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+SUBDIRS			= resources
diff --git a/rgmanager/src/resources/Makefile b/rgmanager/src/resources/Makefile
deleted file mode 100644
index 08d5489..0000000
--- a/rgmanager/src/resources/Makefile
+++ /dev/null
@@ -1,85 +0,0 @@
-TARGET1=utils/config-utils.sh
-TARGET2=fs.sh
-TARGET3=oracledb.sh
-
-all: $(TARGET1) $(TARGET2) $(TARGET3)
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/clean.mk
-
-RESOURCES=service.sh ip.sh nfsclient.sh nfsexport.sh \
-	script.sh netfs.sh clusterfs.sh smb.sh \
-	apache.sh openldap.sh samba.sh mysql.sh \
-	postgres-8.sh tomcat-5.sh lvm.sh \
-	vm.sh SAPInstance SAPDatabase named.sh \
-	ASEHAagent.sh
-
-METADATA=apache.metadata openldap.metadata samba.metadata \
-	mysql.metadata postgres-8.metadata tomcat-5.metadata \
-	named.metadata lvm.metadata
-
-EVENT_TARGETS= \
-	default_event_script.sl \
-	follow-service.sl
-
-GENERAL_TARGETS=ocf-shellfuncs svclib_nfslock lvm_by_lv.sh lvm_by_vg.sh
-
-UTIL_TARGETS= \
-	utils/ra-skelet.sh utils/messages.sh \
-	utils/httpd-parse-config.pl utils/tomcat-parse-config.pl \
-	utils/member_util.sh
-
-$(TARGET1):
-	mkdir -p utils
-	cat $(S)/$(TARGET1).in | sed \
-		-e 's#@CONFDIR@#${CONFDIR}#g' \
-		-e 's#@CONFFILE@#${CONFFILE}#g' \
-	> $(TARGET1)
-
-$(TARGET2):
-	cat $(S)/$(TARGET2).in | sed \
-		-e 's#@LOGDIR@#${logdir}#g' \
-	> $(TARGET2)
-
-$(TARGET3):
-	cat $(S)/$(TARGET3).in | sed \
-		-e 's#@LOGDIR@#${logdir}#g' \
-	> $(TARGET3)
-
-install:
-	install -d ${sharedir}/utils
-	set -e; \
-	for i in $(RESOURCES); do \
-	 install -m755 $(S)/$$i ${sharedir}; \
-	done
-	set -e; \
-	for i in $(METADATA) $(EVENT_TARGETS); do \
-	 install -m644 $(S)/$$i ${sharedir}; \
-	done
-	set -e; \
-	for i in $(GENERAL_TARGETS); do \
-	 install -m755 $(S)/$$i ${sharedir}; \
-	done
-	set -e; \
-	for i in $(UTIL_TARGETS); do \
-	 install -m755 $(S)/$$i ${sharedir}/utils; \
-	done
-	install -m755 $(TARGET1) ${sharedir}/utils
-	install -m755 $(TARGET2) $(TARGET3) ${sharedir}
-
-uninstall:
-	${UNINSTALL} ${RESOURCES} ${GENERAL_TARGETS} \
-		     ${METADATA} ${EVENT_TARGETS} ${UTIL_TARGETS} \
-		     $(TARGET1) $(TARGET2) $(TARGET3) \
-		     ${sharedir}
-
-clean: generalclean
-
-check: $(RESOURCES) $(TARGET2) $(TARGET3) ra-api-1-modified.dtd
-	@echo Validating resource agent meta-data
-	@for f in $(RESOURCES) $(TARGET2) $(TARGET3); do \
-		echo "   ./$$f "; \
-		bash ./$$f meta-data | xmllint --dtdvalid \
-				  ./ra-api-1-modified.dtd --noout -; \
-		if [ $$? -ne 0 ]; then exit 1; fi \
-	done
diff --git a/rgmanager/src/resources/Makefile.am b/rgmanager/src/resources/Makefile.am
new file mode 100644
index 0000000..ebeb61e
--- /dev/null
+++ b/rgmanager/src/resources/Makefile.am
@@ -0,0 +1,62 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+SUBDIRS			= utils
+
+TARGET			= fs.sh oracledb.sh
+
+RESOURCES		= service.sh ip.sh nfsclient.sh nfsexport.sh \
+			  script.sh netfs.sh clusterfs.sh smb.sh \
+			  apache.sh openldap.sh samba.sh mysql.sh \
+			  postgres-8.sh tomcat-5.sh lvm.sh \
+			  vm.sh SAPInstance SAPDatabase named.sh \
+			  ASEHAagent.sh
+
+METADATA		= apache.metadata openldap.metadata samba.metadata \
+			  mysql.metadata postgres-8.metadata \
+			  tomcat-5.metadata named.metadata lvm.metadata
+
+EVENT_TARGETS		= default_event_script.sl follow-service.sl
+
+HELPERS			= ocf-shellfuncs svclib_nfslock \
+			  lvm_by_lv.sh lvm_by_vg.sh
+
+DTD			= ra-api-1-modified.dtd
+
+EXTRA_DIST		= $(TARGET:=.in) \
+			  $(RESOURCES) \
+			  $(METADATA) \
+			  $(EVENT_TARGETS) \
+			  $(HELPERS) \
+			  $(DTD)
+
+rasdir			= ${CLUSTERDATA}
+
+ras_SCRIPTS		= $(TARGET) \
+			  $(RESOURCES) \
+			  $(HELPERS)
+
+ras_DATA		= $(METADATA) \
+			  $(EVENT_TARGETS)
+
+$(TARGET): 
+	cat $@.in | sed \
+		-e 's#@''LOGDIR@#${LOGDIR}#g' \
+	> $@
+
+clean-local:
+	rm -f $(TARGET)
+
+ras-validation: $(RESOURCES) $(TARGET) $(DTD)
+	@echo Validating resource agent meta-data
+	@for f in $(RESOURCES); do \
+		echo "   $(abs_srcdir)/$$f "; \
+		bash $(abs_srcdir)/$$f meta-data | xmllint --dtdvalid \
+			$(abs_srcdir)/$(DTD) --noout -; \
+		if [ $$? -ne 0 ]; then exit 1; fi \
+	done
+	@for f in $(TARGET); do \
+		echo "   $(abs_builddir)/$$f "; \
+		bash $(abs_builddir)/$$f  meta-data | xmllint --dtdvalid \
+			$(abs_srcdir)/$(DTD) --noout -; \
+		if [ $$? -ne 0 ]; then exit 1; fi \
+	done
diff --git a/rgmanager/src/resources/utils/Makefile.am b/rgmanager/src/resources/utils/Makefile.am
new file mode 100644
index 0000000..b5010d4
--- /dev/null
+++ b/rgmanager/src/resources/utils/Makefile.am
@@ -0,0 +1,28 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+TARGET			= config-utils.sh
+
+commonscripts		= httpd-parse-config.pl \
+			  member_util.sh \
+			  messages.sh \
+			  named-parse-config.pl \
+			  ra-skelet.sh \
+			  tomcat-parse-config.pl
+
+EXTRA_DIST		= $(commonscripts) \
+			  $(TARGET).in
+
+rasutilsdir		= ${CLUSTERDATA}/utils
+
+rasutils_SCRIPTS	= $(commonscripts) \
+			  $(TARGET)
+
+
+$(TARGET): $(TARGET).in
+	cat $^ | sed \
+		-e 's#@''CONFDIR@#${CONFDIR}#g' \
+		-e 's#@''CONFFILE@#${CONFFILE}#g' \
+	> $@
+
+clean-local:
+	rm -f $(TARGET)
diff --git a/scripts/uninstall.pl b/scripts/uninstall.pl
deleted file mode 100644
index 4326e85..0000000
--- a/scripts/uninstall.pl
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/perl
-
-##    Description: Basically the reverse of the install program, except it
-##                 only supports a list of files and a directory as arguments
-
-$| = 1;
-
-use Getopt::Std;
-
-# list all valid options here.  User will get errors if invalid options are 
-# specified on the command line
-getopts('hD');
-
-$args = 1;
-
-# We need at least two arguments to uninstall
-if(!defined($ARGV[1])) {
-    $args = 0;
-}
-    
-# if the user set the help flag or didn't provide enough args, print help 
-# and die.
-if(defined($opt_h) || ($args == 0)) {
-  $msg = "usage: $0 [OPTIONS] TARGET DIRECTORY\n";
-  $msg = $msg . "\t-D\tRemove specified directory if empty\n";
-  $msg = $msg . "\t-h\tDisplay this help message\n";
-  die $msg;
-}
-
-# find out how many command line arguments we have
-$length = $#ARGV;
-# We need a special case if there is only one file specified
-if($length > 1) {
-  @filelist = @ARGV;
-  $#filelist = $length - 1;
-}
-else {
-  @filelist = @ARGV[0];
-}
-
-# the last argument is the directory
-$dir = @ARGV[$length];
-
-# prepend the directory name to all files in the filelist
-$i = 0;
-print "Attempting to remove the following files from directory $dir/:\n";
-while($i < $length) {
-  print "@filelist[$i] ";
-  @filelist[$i] = "$dir/" . @filelist[$i];
-  $i++;
-}
-print "\n";
-  
-#print "Files:@filelist\n";
-#print "Directory: $dir\n";
-
-# delete the files in filelist
-$unlinked = unlink @filelist;
-if($unlinked < $length) {
-  print "Error! Unable to remove all files in $dir:\n\tYou may have to manually delete some of them.\n"
-}
-# if user specifed they want the directory deleted, try to delete it.  Print 
-# error message if not able to delete directory, including error.
-if(defined($opt_D)) {
-  $result = rmdir($dir);
-  if($result == FALSE) {
-    print "Error! Unable to remove directory $dir/:\n\t$!\n";
-  }
-}
-
-


                 reply	other threads:[~2009-06-24  6:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090624064943.D28E1120280@lists.fedorahosted.org \
    --to=fabbione@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).