debian swirl logo

Back to the packages list basilisk2

#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2003-2008, 2010, 2012 Jonas Smedegaard 
# Copyright © 2012, Giulio Paci 
# Description: Main Debian packaging script for Basilisk II
#
# 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_SRCDIR = src/Unix
DEB_BUILDDIR = build
DEB_MAKE_FLAVORS = nojit

# add JIT compiler when supported
DEB_MAKE_FLAVORS += $(if $(filter amd64 i386,$(DEB_HOST_ARCH)),jit)

DEB_AUTO_UPDATE_ACLOCAL = 1.11
DEB_ACLOCAL_ARGS = -I m4
DEB_AUTO_UPDATE_AUTOHEADER = 2.68
DEB_AUTO_UPDATE_AUTOCONF = 2.68

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

DEB_UPSTREAM_URL = http://basilisk.cebix.net/downloads
DEB_UPSTREAM_PACKAGE = BasiliskII_src_15012002
DEB_UPSTREAM_TARBALL_VERSION := $(shell perl -e '$$_ = "$(DEB_UPSTREAM_VERSION)"; s/^(.*)\.(\d{4})(\d{2})(\d{2})$$/$$4$$3$$2/; print;')
DEB_UPSTREAM_TARBALL_BASENAME = $(DEB_UPSTREAM_PACKAGE)_$(cdbs_upstream_tarball_version_mangled)
#DEB_UPSTREAM_TARBALL_MD5 =

DEB_CONFIGURE_USER_FLAGS = --disable-rpath --enable-sdl-video --enable-sdl-audio
DEB_CONFIGURE_USER_FLAGS += $(if $(filter debug,$(DEB_BUILD_OPTIONS)),,--without-mon)
DEB_CONFIGURE_FLAGS_jit = --enable-jit-compiler

DEB_MAKE_EXTRA_ARGS = "APP_FLAVOR=$(cdbs_make_curflavor)"
DEB_MAKE_DESTDIRSKEL = $(CURDIR)/debian/tmp-@FLAVOR@

# Suppress excess and seemingly non-fatal warnings
#  * Upstream included -fno-merge-constants but seems unneeded
warning-flags = -Wno-unused-variable -Wno-unused-label -Wno-unused-function -Wno-missing-braces -Wno-parentheses
includedirs = -I$(CURDIR)/$(DEB_SRCDIR)
CFLAGS += $(warning-flags) $(includedirs)
CXXFLAGS += $(warning-flags) $(includedirs)

DEB_INSTALL_DOCS_ALL += TECH
DEB_INSTALL_CHANGELOGS_ALL = debian/ChangeLog.cvs
DEB_INSTALL_MANPAGES_ALL = debian/tmp-nojit/usr/share/man/man1/BasiliskII-nojit.1
# Add jit flavour files when compiled
DEB_INSTALL_MANPAGES_ALL += $(if $(filter jit,$(DEB_MAKE_FLAVORS)),debian/tmp-jit/usr/share/man/man1/BasiliskII-jit.1)
DEB_DH_INSTALL_ARGS = $(if $(filter jit,$(DEB_MAKE_FLAVORS)),debian/tmp-jit/usr/bin/BasiliskII-jit usr/bin)

DEB_INSTALL_EXAMPLES_basilisk2 = $(DEB_SRCDIR)/Linux/* $(DEB_SRCDIR)/tunconfig

# tunconfig will be installed as example file only
binary-post-install/basilisk2::
		rm -f debian/$(cdbs_curpkg)/usr/share/BasiliskII/tunconfig

clean::
	rm -fr $(DEB_MAKE_FLAVORS:%= debian/tmp-%)
		rm -f  src/Unix/aclocal.m4 src/Unix/config.h.in src/Unix/configure

# Needed by upstream build process
CDBS_BUILD_DEPENDS += , libgtk2.0-dev, libesd0-dev, libsdl-dev, libxxf86dga-dev, libxxf86vm-dev

Builds:

basilisk2
68k macintosh emulator