Revision 2ec08468

b/configure.ac
19 19
  AC_MSG_WARN([docbook2man not found.])
20 20
fi
21 21

  
22
AC_SUBST(PACKAGE_VERSION)
23

  
24
AC_CONFIG_FILES([Makefile man/Makefile doc/Makefile
25
  testing/Makefile tools/Makefile
26
  lib/Makefile scripts/Makefile daemons/Makefile
27
  doc/examples/Makefile lib/version.py])
22
AC_CONFIG_FILES([
23
  Makefile
24
  daemons/Makefile
25
  doc/Makefile
26
  doc/examples/Makefile
27
  lib/Makefile
28
  man/Makefile
29
  scripts/Makefile
30
  testing/Makefile
31
  tools/Makefile
32
])
28 33

  
29 34
AC_OUTPUT
b/lib/Makefile.am
1
MAINTAINERCLEANFILES = version.py
2
EXTRA_DIST = version.py.in
3
nodist_pkgpython_PYTHON = version.py
1
MAINTAINERCLEANFILES = _autoconf.py
2
nodist_pkgpython_PYTHON = _autoconf.py
4 3
pkgpython_PYTHON = __init__.py backend.py cli.py cmdlib.py config.py \
5 4
	objects.py errors.py logger.py ssh.py utils.py rpc.py \
6 5
	bdev.py hypervisor.py opcodes.py mcpu.py constants.py \
7 6
	ssconf.py
7

  
8
_autoconf.py: Makefile
9
	{ echo '# This file is automatically generated, do not edit!'; \
10
	  echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
11
	  echo "LOCALSTATEDIR = '$(localstatedir)'"; \
12
	  echo "SYSCONFDIR = '$(sysconfdir)'"; \
13
	} > $@
b/lib/constants.py
21 21

  
22 22
"""Module holding different constants."""
23 23

  
24
from ganeti import version
24
from ganeti import _autoconf
25 25

  
26 26
# various versions
27 27
CONFIG_VERSION = 3
28 28
PROTOCOL_VERSION = 2
29
RELEASE_VERSION = version.RELEASE_VERSION
29
RELEASE_VERSION = _autoconf.PACKAGE_VERSION
30 30
OS_API_VERSION = 4
31 31
EXPORT_VERSION = 0
32 32

  
33 33

  
34 34
# file paths
35
DATA_DIR = "/var/lib/ganeti"
35
DATA_DIR = _autoconf.LOCALSTATEDIR + "/lib/ganeti"
36 36
CLUSTER_CONF_FILE = DATA_DIR + "/config.data"
37 37
SSL_CERT_FILE = DATA_DIR + "/server.pem"
38 38
WATCHER_STATEFILE = DATA_DIR + "/restart_state"
39 39
SSH_KNOWN_HOSTS_FILE = DATA_DIR + "/known_hosts"
40 40

  
41
NODE_INITD_SCRIPT = "/etc/init.d/ganeti"
41
NODE_INITD_SCRIPT = _autoconf.SYSCONFDIR + "/init.d/ganeti"
42 42
DEFAULT_NODED_PORT = 1811
43 43
FIRST_DRBD_PORT = 11000
44 44
LAST_DRBD_PORT = 14999
45 45
MASTER_SCRIPT = "ganeti-master"
46 46

  
47
LOG_DIR = "/var/log/ganeti"
47
LOG_DIR = _autoconf.LOCALSTATEDIR + "/log/ganeti"
48 48
LOG_OS_DIR = LOG_DIR + "/os"
49 49
LOG_NODESERVER = LOG_DIR + "/node-daemon.log"
50 50

  
......
54 54
EXPORT_CONF_FILE = "config.ini"
55 55

  
56 56
# hooks-related constants
57
HOOKS_BASE_DIR = "/etc/ganeti/hooks"
57
HOOKS_BASE_DIR = _autoconf.SYSCONFDIR + "/ganeti/hooks"
58 58
HOOKS_PHASE_PRE = "pre"
59 59
HOOKS_PHASE_POST = "post"
60 60
HOOKS_VERSION = 1
/dev/null
1
#!/usr/bin/python
2
#
3

  
4
# Copyright (C) 2007 Google Inc.
5
#
6
# This program is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 2 of the License, or
9
# (at your option) any later version.
10
#
11
# This program is distributed in the hope that it will be useful, but
12
# WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
# General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with this program; if not, write to the Free Software
18
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
# 02110-1301, USA.
20

  
21

  
22
"""Ganeti version
23
"""
24

  
25
RELEASE_VERSION = "@PACKAGE_VERSION@"

Also available in: Unified diff