summaryrefslogtreecommitdiffstats
path: root/debian/rules
blob: 8b2361f204fd9d47d8ad4e53f36a95ffc8ea90ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-

# Generate debian/control fron control.in with the following command:
# DEB_AUTO_UPDATE_DEBIAN_CONTROL=yes fakeroot debian/rules clean

# Comment this line if you wish to build without pycentral or pysupport
DEB_PYTHON_SYSTEM := pycentral
DEB_PYTHON_MODULE_PACKAGE := bcfg2
ifdef DEB_PYTHON_SYSTEM
DEB_DH_INSTALLINIT_ARGS := -n
else
DEB_DH_INSTALLINIT_ARGS := --no-start
endif

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk

# By default use 2.3 as the python version (follow the original behaviour)
# This only affects the build system if built without pycentral or pysupport
DEB_PYTHON_VERSIONS = 2.3

# Since cdbs is able to handle only one python package at once do things here:
binary-install/bcfg2-server :: binary-install/%:
# Mostly borrowed from /usr/share/cdbs/1/class/python-distutils.mk
ifdef DEB_PYTHON_SYSTEM
  ifeq (pysupport, $(DEB_PYTHON_SYSTEM))
        dh_pysupport -pbcfg2-server $(DEB_PYTHON_PRIVATE_MODULES_DIRS)
  else
	dh_pycentral -pbcfg2-server
  endif
endif
	dh_python -pbcfg2-server $(DEB_PYTHON_PRIVATE_MODULES_DIRS)

ifdef DEB_PYTHON_SYSTEM
# Invoke dh_installinit after compiling python modules
binary-install/bcfg2 ::
	dh_installinit -p$(cdbs_curpkg) -o --no-start

binary-install/bcfg2-server ::
	cd doc && make manual.html
	dh_installinit -p$(cdbs_curpkg) -o
	mkdir debian/bcfg2-server/usr/share/bcfg2/hostbase
	cp src/lib/Server/Hostbase/templates/* debian/bcfg2-server/usr/share/bcfg2/hostbase
endif