Codebase list libvirt / debian/1.0.2-3 debian / rules
debian/1.0.2-3

Tree @debian/1.0.2-3 (Download .tar.gz)

rules @debian/1.0.2-3raw · history · blame

#!/usr/bin/make -f

DEB_BUILD_PARALLEL = yes
export VIR_TEST_DEBUG=1

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

ifneq (,$(findstring $(DEB_HOST_ARCH), i386 amd64))
  DEB_MAKE_CHECK_TARGET = check
  WITH_XEN = --with-xen
  WITH_VBOX = --with-vbox
else
  WITH_XEN = --without-xen
  WITH_VBOX = --without-vbox
endif

ifneq (,$(findstring $(DEB_HOST_ARCH_OS), linux))
  WITH_STORAGE_LVM    = --with-storage-lvm
  WITH_STORAGE_ISCSI  = --with-storage-iscsi
  WITH_STORAGE_DISK   =	--with-storage-disk
  WITH_STORAGE_SHEEPDOG = --with-storage-sheepdog
  WITH_UDEV           = --with-udev --without-hal
  WITH_CAPNG          = --with-capng
  WITH_POLKIT         = --with-polkit
  WITH_MACVTAP        = --with-macvtap
  WITH_NETWORK        = --with-network
  WITH_QEMU           = --with-qemu
  WITH_OPENVZ         = --with-openvz
  WITH_NETCF          = --with-netcf
  WITH_SANLOCK        = --with-sanlock
  WITH_INIT_SCRIPT    =	--with-init-script=systemd
  WITH_AUDIT          = --with-audit
  ifneq (,$(findstring $(DEB_HOST_ARCH), amd64 armel armhf i386 ia64 powerpc s390))
      WITH_DTRACE     = --with-dtrace
  else
      WITH_DTRACE     = --without-dtrace
  endif
  ifneq (,$(findstring $(DEB_HOST_ARCH), amd64 i386 ia64 mips mipsel powerpc))
      WITH_NUMA       = --with-numactl
  else
      WITH_NUMA       = --without-numactl
  endif
  ifneq (,$(findstring $(DEB_HOST_ARCH), ia64))
      WITH_LXC        = --without-lxc
  else
      WITH_LXC        = --with-lxc
  endif
else
  WITH_STORAGE_LVM    = --without-storage-lvm
  WITH_STORAGE_ISCSI  = --without-storage-iscsi
  WITH_STORAGE_DISK   =	--without-storage-disk
  WITH_STORAGE_SHEEPDOG = --without-storage-sheepdog
  WITH_UDEV           = --without-udev --with-hal
  WITH_CAPNG          = --without-capng
  WITH_POLKIT         = --without-polkit
  WITH_MACVTAP        = --without-macvtap
  WITH_NETWORK        = --without-network
  WITH_QEMU           = --without-qemu
  WITH_LXC            = --without-lxc
  WITH_NUMA           = --without-numactl
  WITH_NETCF          = --without-netcf
  WITH_INIT_SCRIPT    =	--with-init-script=none
  WITH_AUDIT          = --without-audit
  WITH_DTRACE         = --without-dtrace
endif

DEB_BUILDDIR := $(CURDIR)/debian/build
DEB_CONFIGURE_EXTRA_FLAGS :=     \
	--disable-rpath          \
	$(WITH_QEMU)		 \
	--with-qemu-user=libvirt-qemu  \
	--with-qemu-group=libvirt-qemu \
        $(WITH_OPENVZ)		 \
	--with-avahi             \
	--with-sasl              \
	--with-yajl              \
	$(WITH_POLKIT)		 \
	$(WITH_UDEV)		 \
	--with-storage-fs        \
	$(WITH_STORAGE_LVM)	 \
	$(WITH_STORAGE_ISCSI)	 \
	$(WITH_STORAGE_DISK)	 \
	$(WITH_INIT_SCRIPT)      \
	$(WITH_NUMA)             \
	--without-selinux        \
	--without-esx		 \
	--without-libssh2	 \
	$(WITH_CAPNG)		 \
	--enable-debug		 \
	$(WITH_MACVTAP)		 \
	$(WITH_NETWORK)		 \
	$(WITH_NETCF)		 \
	$(WITH_XEN)		 \
	$(WITH_VBOX)		 \
	$(WITH_LXC)              \
	$(WITH_DTRACE)           \
	$(WITH_AUDIT)            \
	--without-firewalld

DEB_COMPRESS_EXCLUDE = .o event-test hellolibvirt info1 suspend
DEB_PYTHON_SETUP_CMD = /dev/null
DEB_DH_MAKESHLIBS_ARGS_libvirt0 += -V 'libvirt0 (>= 0.5.0)'
DEB_DH_INSTALLINIT_ARGS = --no-restart-on-upgrade -- defaults 28 72
DEB_PYTHON_MODULE_PACKAGE = python-libvirt

LOGROTATE = $(basename $(basename $(notdir $(wildcard daemon/libvirtd*.logrotate.in))))
EXAMPLES_DIR = $(CURDIR)/debian/libvirt-doc/usr/share/doc/libvirt-doc/examples/

include debian/python.mk

binary-install/libvirt-bin::
	cp debian/tmp/usr/lib/libvirt/libvirt-guests.sh \
	    debian/libvirt-bin.libvirt-guests.init
	cp tools/libvirt-guests.sysconf \
	    debian/libvirt-bin.libvirt-guests.default
	dh_installinit --name=libvirt-guests --no-restart-on-upgrade -- defaults 29 71
	-mv debian/libvirt-bin/lib/systemd/system/libvirtd.service \
	    debian/libvirt-bin/lib/systemd/system/libvirt-bin.service
	rm debian/libvirt-bin/usr/lib/libvirt/connection-driver/*.la

	for l in $(LOGROTATE); do \
		cp $(CURDIR)/debian/build/daemon/$$l.logrotate \
                   debian/libvirt-bin.$$l.logrotate; \
		dh_installlogrotate --name=$$l;     \
	done

build/libvirt-bin::
	# Add empty dirs so dh_install doesn't fail on kFreebsd until we have
	# Polkit/Systemd support
	mkdir -p debian/tmp/usr/share/polkit-1 \
	         debian/tmp/lib/systemd/system \
	         debian/tmp/usr/share/systemtap


binary-install/libvirt-doc::
	find $(EXAMPLES_DIR) -name "*.o" -type f -delete -o -name .libs -type d -exec rm -rf {} \;
	rm -f $(EXAMPLES_DIR)domain-events/events-c/event-test
	rm -f $(EXAMPLES_DIR)dominfo/info1
	rm -f $(EXAMPLES_DIR)domsuspend/suspend
	rm -f $(EXAMPLES_DIR)hellolibvirt/hellolibvirt

clean::
	rm -f $(CURDIR)/debian/libvirt-bin.libvirt-guests.init
	rm -f $(CURDIR)/debian/libvirt-bin.libvirt-guests.default
	rm -f $(CURDIR)/debian/libvirt-bin.*.logrotate
	rm -rf $(DEB_BUILDDIR)