debian swirl logo

Back to the packages list flumotion

#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2006-2009 Loic Minier 
# Copyright © 2012 IOhannes m zmölnig 
# Description: Main Debian packaging script for flumotion
#
# 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, 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, see .


DEB_BUILDDIR = build
DEB_PYTHON2_MODULE_PACKAGES = flumotion

-include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/class/python-autotools.mk
include /usr/share/cdbs/1/rules/debhelper.mk

# suppress optional build-dependencies
CDBS_BUILD_DEPENDS_rules_upstream-tarball = 

## you can get the upstream tarball with
##   debian/rules get-orig-source
DEB_UPSTREAM_PACKAGE = flumotion
DEB_UPSTREAM_URL = http://www.flumotion.net/src/flumotion
DEB_UPSTREAM_TARBALL_MD5 = 99bcc4c0dc0a7d4351e6d463ea856e65


# Suppress scanning images causing false alarms.
DEB_COPYRIGHT_CHECK_IGNORE_REGEX = data/image/.*|debian/(changelog|copyright(|_hints|_newhints))$


DEB_CONFIGURE_SCRIPT_ENV += env -u DISPLAY

DEB_FIXPERMS_EXCLUDE_flumotion += etc/flumotion

clean::
		find -name *.pyc -exec rm '{}' ';'

common-binary-arch::
		find "$(cdbs_python_destdir)/usr/lib" -name '*.pyc' -exec rm '{}' ';'

binary-post-install/flumotion::
	# install the rtupdate script to handle Python default runtime change
		install -d $(cdbs_python_destdir)/usr/share/python/runtime.d
		install debian/flumotion.rtupdate $(cdbs_python_destdir)/usr/share/python/runtime.d
	# force executable bit on files looking like python scripts
		egrep -rlZ '^#!(.*)python' $(cdbs_python_destdir)/usr/lib/flumotion | xargs -0 chmod a+x --
	# force executable bit on the SSL cert script
		chmod a+x $(cdbs_python_destdir)/usr/share/flumotion/make-dummy-cert
	# protect configuration file with sensitive information
		chmod 750 $(cdbs_python_destdir)/etc/flumotion
	# install the logrotate configuration file; fix executable bit
		install -d $(cdbs_python_destdir)/etc/logrotate.d
		install doc/redhat/flumotion.logrotate $(cdbs_python_destdir)/etc/logrotate.d/flumotion
		chmod a-x debian/flumotion/etc/logrotate.d/flumotion

#####################################################################
## upstream lacks some manpages
## so we generate them on the fly, using help2man
CDBS_BUILD_DEPENDS += , help2man (>= 1.37.1~)
manpages = $(patsubst %,debian/help2man/flumotion-%.1,\
 admin-text command inspect job launch nagios tester rrdmon)
manpages += debian/help2man/flumotion.8

DEB_INSTALL_MANPAGES_flumotion = $(manpages)
common-binary-arch:: $(manpages)
debian/help2man:
		mkdir -p $@
$(manpages): debian/help2man
$(manpages): install/flumotion
%.1:
	export PYTHONPATH= "$(cdbs_python_destdir)/usr/lib/flumotion/python/"; \
		  help2man \
			 --name="Fluendo Streaming Server" \
			 --version-string="$(DEB_UPSTREAM_VERSION)" \
			 --no-info \
			 --output=$@ \
			 $(cdbs_python_destdir)/usr/bin/$(@:debian/help2man/%.1=%)
%.8:
	export PYTHONPATH= "$(cdbs_python_destdir)/usr/lib/flumotion/python/"; \
		  help2man \
			 --name="Fluendo Streaming Server" \
			 --version-string="$(DEB_UPSTREAM_VERSION)" \
			 --no-info \
			 --output=$@ \
			 $(cdbs_python_destdir)/usr/sbin/$(@:debian/help2man/%.8=%)

clean::
		rm -f $(manpages)
		rm -rf debian/help2man

## end of manpage generation
#####################################################################

Builds:

flumotion
fluendo streaming server - manager, worker and admin