debian swirl logo

Back to the packages list morituri

#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2009, 2010, 2011, 2012, 2013 Jonas Smedegaard
# 
# Description: Main Debian packaging script for morituri
#
# 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 3, 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_AUTO_UPDATE_ACLOCAL = 1.11
DEB_AUTO_UPDATE_AUTOMAKE = 1.11
DEB_AUTO_UPDATE_AUTOCONF = 2.68
DEB_BUILDDIR = build
DEB_PYTHON2_MODULE_PACKAGES = morituri
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

pkg = $(DEB_SOURCE_PACKAGE)

DEB_UPSTREAM_URL = http://thomas.apestaart.org/download/$(DEB_UPSTREAM_PACKAGE)
DEB_UPSTREAM_TARBALL_EXTENSION = tar.bz2
DEB_UPSTREAM_TARBALL_MD5 = 0766778054ff9fbb98effd08130c7e98

DEB_MAKE_CHECK_TARGET = check
# relax testing when targeted experimental suite
DEB_MAKE_CHECK_TARGET += $(if $(shell dpkg-parsechangelog | grep -Fx 'Distribution: experimental'),|| true)

# Apparently upstream doesn't always cleanup properly
clean::
		find -name *.pyc -exec rm '{}' ';'
		rm -f build/doc/morituri.ics
		rm -f build/doc/morituri.rss2

# Suppress unneeded build-dependencies
CDBS_BUILD_DEPENDS_class_python-distutils_python = 

# Needed by upstream regression tests
#  * gstreamer-tools due to gst-launch in test_common_encode.py
deps-test = python-epydoc, pychecker, python-twisted-core
deps-test += , python-docutils, gstreamer-tools

# Needed by upstream build and (always/often) at runtime
#  * gstreamer0.10-plugins-good due to profiles flac, wav, wavpack and vorbis
#  * recent python-musicbrainzngs due to get_release_by_discid() fix
#  * gstreamer0.10-tools due to gstreamer version check
deps = python-gst0.10, python-gobject, python-gst0.10
deps += , cdparanoia
deps += , gstreamer0.10-plugins-good (>= 0.10.22)
deps += , python-musicbrainzngs (>= 0.2-1.1~)
deps-recommend = gstreamer0.10-tools

CDBS_BUILD_DEPENDS += , $(deps), $(deps-test), $(deps-recommend)
CDBS_DEPENDS_$(pkg) = $(deps)
CDBS_RECOMMENDS_$(pkg) = $(deps-recommend)

# Needed (always/often/sometimes) at runtime
#  * python-pkg-resources due to morituri/rip/cd.py cdrdao version check
#  * gstreamer0.10-ffmpeg due to profile alac
#  * gstreamer0.10-plugins-ugly due to profiles mp3 and mp3vbr
# TODO: recommend (not suggest) python-pycdio when packaged
# python-gtk2 needed only in apparently unused common/taskgtk
CDBS_DEPENDS_$(pkg) += , python, python-pkg-resources, cdrdao, python-cddb
CDBS_RECOMMENDS_$(pkg) += , gstreamer0.10-ffmpeg, python-xdg
CDBS_SUGGESTS_$(pkg) += , gstreamer0.10-plugins-ugly, python-pycdio, python-gtk2

# TODO: have (defaults for) these provided by CDBS
autoconfpaths = aclocal.m4 configure py-compile
aclocalpaths = install-sh missing
automakedirs = . bin doc etc etc/bash_completion.d m4 misc morituri
moriautomakedirs = common configure extern image program result rip test
automakedirs += $(addprefix morituri/,$(moriautomakedirs))
automakepaths = $(addsuffix /Makefile.in,$(automakedirs))

# put aside autogenerated files during build
DEB_UPSTREAM_CRUFT_MOVE = $(automakepaths) $(aclocalpaths) $(autoconfpaths)

# (re)generate most possible autotools files
# bootstrap autotools files (CDBS by default only update, not create)
DEB_ACLOCAL_ARGS = -Im4 --install --force
DEB_AUTOMAKE_ARGS = --add-missing --copy --foreign --force
DEB_MAKE_CLEAN_TARGET = distclean

# Workaround for configure hints broken wrt. srcdir != builddir
DEB_UPSTREAM_CRUFT_MOVE += morituri/configure/installed.py morituri/configure/uninstalled.py
pre-build::
		ln -f -s -t morituri/configure ../../build/morituri/configure/installed.py ../../build/morituri/configure/uninstalled.py

# Rename musicbrainzngs.py wrapper during build, to match patch 2001
pre-build::
		[ -f morituri/common/ourmusicbrainzngs.py ] || mv morituri/common/musicbrainzngs.py morituri/common/ourmusicbrainzngs.py
makefile-clean::
		[ -f morituri/common/musicbrainzngs.py ] || mv morituri/common/ourmusicbrainzngs.py morituri/common/musicbrainzngs.py

Builds:

morituri
cd ripper aiming for maximum quality