diff --git a/configure.ac b/configure.ac index 8e03418a4d2e983164cc05aa83736703ec4531d0..c7c45324f9dcaeab856274721f63335f86bcd89e 100644 --- a/configure.ac +++ b/configure.ac @@ -19,11 +19,16 @@ then AC_MSG_WARN([docbook2man not found.]) fi -AC_SUBST(PACKAGE_VERSION) - -AC_CONFIG_FILES([Makefile man/Makefile doc/Makefile - testing/Makefile tools/Makefile - lib/Makefile scripts/Makefile daemons/Makefile - doc/examples/Makefile lib/version.py]) +AC_CONFIG_FILES([ + Makefile + daemons/Makefile + doc/Makefile + doc/examples/Makefile + lib/Makefile + man/Makefile + scripts/Makefile + testing/Makefile + tools/Makefile +]) AC_OUTPUT diff --git a/lib/Makefile.am b/lib/Makefile.am index 59d62fbafc7767fb40e35ec35f8564422f13dee8..48e90e8c4079365786d1d2a839a5ad3bf2b17e22 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,7 +1,13 @@ -MAINTAINERCLEANFILES = version.py -EXTRA_DIST = version.py.in -nodist_pkgpython_PYTHON = version.py +MAINTAINERCLEANFILES = _autoconf.py +nodist_pkgpython_PYTHON = _autoconf.py pkgpython_PYTHON = __init__.py backend.py cli.py cmdlib.py config.py \ objects.py errors.py logger.py ssh.py utils.py rpc.py \ bdev.py hypervisor.py opcodes.py mcpu.py constants.py \ ssconf.py + +_autoconf.py: Makefile + { echo '# This file is automatically generated, do not edit!'; \ + echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \ + echo "LOCALSTATEDIR = '$(localstatedir)'"; \ + echo "SYSCONFDIR = '$(sysconfdir)'"; \ + } > $@ diff --git a/lib/constants.py b/lib/constants.py index 183f32017adf738d2ecf56ace3823d4ab556698a..246136aa4cdba57cbd293b7e26883bc7968f4bf3 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -21,30 +21,30 @@ """Module holding different constants.""" -from ganeti import version +from ganeti import _autoconf # various versions CONFIG_VERSION = 3 PROTOCOL_VERSION = 2 -RELEASE_VERSION = version.RELEASE_VERSION +RELEASE_VERSION = _autoconf.PACKAGE_VERSION OS_API_VERSION = 4 EXPORT_VERSION = 0 # file paths -DATA_DIR = "/var/lib/ganeti" +DATA_DIR = _autoconf.LOCALSTATEDIR + "/lib/ganeti" CLUSTER_CONF_FILE = DATA_DIR + "/config.data" SSL_CERT_FILE = DATA_DIR + "/server.pem" WATCHER_STATEFILE = DATA_DIR + "/restart_state" SSH_KNOWN_HOSTS_FILE = DATA_DIR + "/known_hosts" -NODE_INITD_SCRIPT = "/etc/init.d/ganeti" +NODE_INITD_SCRIPT = _autoconf.SYSCONFDIR + "/init.d/ganeti" DEFAULT_NODED_PORT = 1811 FIRST_DRBD_PORT = 11000 LAST_DRBD_PORT = 14999 MASTER_SCRIPT = "ganeti-master" -LOG_DIR = "/var/log/ganeti" +LOG_DIR = _autoconf.LOCALSTATEDIR + "/log/ganeti" LOG_OS_DIR = LOG_DIR + "/os" LOG_NODESERVER = LOG_DIR + "/node-daemon.log" @@ -54,7 +54,7 @@ EXPORT_DIR = "/srv/ganeti/export" EXPORT_CONF_FILE = "config.ini" # hooks-related constants -HOOKS_BASE_DIR = "/etc/ganeti/hooks" +HOOKS_BASE_DIR = _autoconf.SYSCONFDIR + "/ganeti/hooks" HOOKS_PHASE_PRE = "pre" HOOKS_PHASE_POST = "post" HOOKS_VERSION = 1 diff --git a/lib/version.py.in b/lib/version.py.in deleted file mode 100644 index e6aa45e979b7baf6e1ba0dc14ea72f290f3bbf9f..0000000000000000000000000000000000000000 --- a/lib/version.py.in +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/python -# - -# Copyright (C) 2007 Google Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. - - -"""Ganeti version -""" - -RELEASE_VERSION = "@PACKAGE_VERSION@"