Hostinfo day 6: RPM packaging, initscripts, hostinfo-status, hostinfo-test.
[virt-hostinfo.git] / configure.ac
index 7a1377e..33dbad9 100644 (file)
@@ -15,7 +15,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-AC_INIT([virt-hostinfo],[0.1])
+AC_INIT([virt-hostinfo],[0.2.2])
 AM_INIT_AUTOMAKE
 
 AC_CONFIG_MACRO_DIR([m4])
@@ -37,7 +37,7 @@ dnl C functions which may be missing on older systems.
 AC_CHECK_FUNCS([inotify_init1 clock_gettime])
 
 dnl Check for required packages using pkg-config.
-PKG_CHECK_MODULES([HOSTINFOD],[apr-1 >= 1.3 libvirt >= 0.2.1])
+PKG_CHECK_MODULES([HOSTINFOD],[apr-1 >= 1.2.7 libvirt >= 0.2.1])
 
 dnl Check for Perl and POD.
 AC_CHECK_PROG([PERL],[perl],[perl],[no])
@@ -48,9 +48,26 @@ AC_CHECK_PROG([POD2TEXT],[pod2text],[pod2text],[no])
 test "x$POD2TEXT" = "xno" &&
      AC_MSG_ERROR([pod2text must be installed])
 
+dnl Check for required Perl modules.
+missing_perl_modules=no
+required="Pod::Usage Getopt::Long Sys::Virt XML::XPath XML::XPath::XMLParser"
+for pm in $required; do
+    AC_MSG_CHECKING([for Perl module $pm])
+    if ! perl -M$pm -e1 >/dev/null 2>&1; then
+        AC_MSG_RESULT([no])
+        missing_perl_modules=yes
+    else
+        AC_MSG_RESULT([yes])
+    fi
+done
+if test "x$missing_perl_modules" = "xyes"; then
+    AC_MSG_ERROR([some required Perl modules are missing])
+fi
+
 dnl Produce output files.
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_FILES([Makefile
+       virt-hostinfo.spec
        hostinfod/Makefile
        conf/Makefile
        conf/hostinfo.conf
@@ -58,10 +75,16 @@ AC_CONFIG_FILES([Makefile
        hostinfo-status/Makefile
        hostinfo-set/Makefile
        hostinfo-test/Makefile])
-AC_CONFIG_FILES([hostinfo-status/hostinfo-status:hostinfo-status/hostinfo-status.pl],
+AC_CONFIG_FILES(
+       [hostinfo-status/hostinfo-status:hostinfo-status/hostinfo-status.pl],
        [chmod 0555 hostinfo-status/hostinfo-status])
-AC_CONFIG_FILES([hostinfo-set/hostinfo-set:hostinfo-set/hostinfo-set.pl],
+AC_CONFIG_FILES(
+       [hostinfo-set/hostinfo-set:hostinfo-set/hostinfo-set.pl],
        [chmod 0555 hostinfo-set/hostinfo-set])
-AC_CONFIG_FILES([hostinfo-test/hostinfo-test:hostinfo-test/hostinfo-test.pl],
+AC_CONFIG_FILES(
+       [hostinfo-test/hostinfo-test:hostinfo-test/hostinfo-test.pl],
        [chmod 0555 hostinfo-test/hostinfo-test])
+AC_CONFIG_FILES(
+       [conf/hostinfo:conf/hostinfo.init.in],
+       [chmod 0555 conf/hostinfo])
 AC_OUTPUT