debian swirl logo

Back to the packages list hydrogen

#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2010, 2011 Jonas Smedegaard 
# Description: Main Debian packaging script for Hydrogen
#
# 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 .

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

DEB_CMAKE_EXTRA_FLAGS = -DWANT_SHARED=OFF \
 -DWANT_PORTAUDIO=ON \
 -DWANT_PORTMIDI=ON \
 -DWANT_RUBBERBAND=ON

DEB_UPSTREAM_URL = http://downloads.sourceforge.net/hydrogen

DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^.*\.(flac|png|qm)|debian/(changelog|copyright(|_hints|_newhints))$

# according to upstream INSTALL.txt this avoids potential clash with Qt3
export QTDIR= /usr/share/qt4

DEB_INSTALL_MANPAGES_hydrogen = debian/hydrogen.1

# Put aside upstream-shipped autogenerated files during build
upstreamtmpfiles = $(wildcard data/doc/*.html data/doc/*.docbook)
upstreamtmpfiles_ = $(patsubst %.upstream,%,$(wildcard data/doc/*.html.upstream data/doc/*.docbook.upstream))
pre-build:: debian/stamp-upstreamtmpstuff
debian/stamp-upstreamtmpstuff: debian/stamp-copyright-check
		for file in $(upstreamtmpfiles); do \
			[ ! -e $$file ] || [ -e $$file.upstream ] || mv $$file $$file.upstream; \
		done
		touch $@
clean::
		for file in $(upstreamtmpfiles_); do \
			[ ! -e $$file.upstream ] || mv -f $$file.upstream $$file; \
		done
		rm -f debian/stamp-upstreamtmpstuff

common-build-indep:: debian/docs.stamp
debian/docs.stamp:
		$(MAKE) -C data/doc
		touch $@
clean::
		rm -f debian/docs.stamp

imgstub = data/img/gray/h2-icon
common-build-arch::
	#inkscape -z -e$(imgstub).png -D -w32 -h32 --export-area-snap $(imgstub).svg
		rsvg-convert -w 32 -h 32 -f png -o $(imgstub).png $(imgstub).svg
		pngtopnm -alpha $(imgstub).png > $(imgstub).alpha.pgm
	pngtopnm $(imgstub).png | ppmtoxpm -alphamask= $(imgstub).alpha.pgm > $(imgstub).xpm
		rm -f $(imgstub).png $(imgstub).alpha.pgm
clean::
		rm -f $(imgstub).xpm

# generate manpage based on --help of script itself
# TODO: make below rule work as part of main build
#common-post-build-arch:: debian/hydrogen.1
debian/hydrogen.1: hydrogen
	help2man --name= "simple drum machine/step sequencer" --no-info --output=$@ $(DEB_SRCDIR)/$<
#clean::
#	rm -f debian/hydrogen.1

clean::
		rm -rf CMakeCache.txt CMakeFiles/ try/
		rm -f qt4.pyc version.cpp config.h

binary-install/hydrogen::
		find $(CURDIR)/debian/hydrogen/usr/share/ -type d -empty -delete
		rm -rf $(CURDIR)/debian/hydrogen/usr/lib/
		rm -rf $(CURDIR)/debian/hydrogen/usr/include/

# Needed by upstream build process
CDBS_BUILD_DEPENDS += , cmake
CDBS_BUILD_DEPENDS += , libqt4-dev, libz-dev, pkg-config, libarchive-dev
CDBS_BUILD_DEPENDS += , docbook-utils, poxml, xmlto, libxml2-utils
CDBS_BUILD_DEPENDS += , libasound2-dev [linux-any]
CDBS_BUILD_DEPENDS += , libaudiofile-dev, libjack-dev, liblrdf-dev, libsndfile1-dev (>= 1.0.18), portaudio19-dev, libportmidi-dev

# Needed for our packaging
# TODO: build-depend on help2man when solved using it with normal builds
#CDBS_BUILD_DEPENDS += , librsvg2-bin, netpbm, help2man
CDBS_BUILD_DEPENDS += , librsvg2-bin, netpbm

Builds:

hydrogen
advanced drum machine/step sequencer