Hello all,

I'm in the process of packaging MESS, a derivative from MAME distributed
in source form as an incremental archive.

I started creating a mame_xxx.orig-messpatch.tar.bz2 and having
dh_auto_configure save the source tree before copying the
MESS-specific files, in order to restore it in dh_auto_clean and
finally remove the backup copy.

Unfortunately, this doesn't work: dh_auto_clean is not idempotent
and dpkg-buildpackage fails.

I'm attaching my rules file: can anyone please make some suggestions?

Thanks in advance,
Cesare.

 
#!/usr/bin/make -f

# Building rules for mess source package
# (c) Copyright 2011 Cesare Falco
#
# Licensed under the GNU General Public License, version 2.  See the file
# /usr/share/common-licenses/GPL-2 or <http://www.gnu.org/copyleft/gpl.txt>.

DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)

VER=0.141
MD5SUM=95b3866cc98a2bea789f8b20e6ff7001

# Override relevant make variables in original makefile
DEB_MAME_OPTS = \
    OPT_FLAGS="-D'INI_PATH=\"/etc/mame\"'" \
    FULLNAME=mess \
    TARGET=mess \
    SUBTARGET=mess \
    OSD=sdl \
    CROSS_BUILD_OSD= \
    TARGETOS=unix \
    PREFIX= \
    SUFFIX= \
    DEBUG= \
    PROFILER= \
    NOWERROR= \
    MACOSX_USE_LIBSDL= \
    BUILD_EXPAT= \
    BUILD_ZLIB= \
    SYMBOLS= \
    SYMLEVEL= \
    DUMPSYM= \
    PROFILE= \
    MAP= \
    VERBOSE= \
    OPTIMIZE=3

# Override make variables for specific archs
ifeq ($(DEB_HOST_ARCH),i386)
DEB_MAME_OPTS += \
    ARCHOPTS=-march=pentium2 \
    FORCE_DRC_C_BACKEND= \
    PTR64= \
    BIGENDIAN=
endif

ifeq ($(DEB_HOST_ARCH),amd64)
DEB_MAME_OPTS += \
    ARCHOPTS=-march=athlon64 \
    FORCE_DRC_C_BACKEND= \
    PTR64=1 \
    BIGENDIAN=
endif


%:
	dh $@

override_dh_auto_configure:
	cp -a src src.orig
	cp -a messpatch/src .

override_dh_auto_build:
	$(MAKE) -j3 $(DEB_MAME_OPTS) 
	$(MAKE) -j3 $(DEB_MAME_OPTS) TARGET=mess tools

override_dh_auto_clean:
	$(MAKE) $(DEB_MAME_OPTS) clean
	rm -rf obj src
	mv src.orig src

override_dh_installchangelogs:
	dh_installchangelogs --keep messpatch/docs/messnew.txt

override_dh_install:
	dh_install --exclude=OSX.txt


get-orig-source: mame$(subst .,,$(VER))s.zip
	echo "$(MD5SUM) *mame$(subst .,,$(VER))s.zip" | md5sum -c -
	unzip -q mame$(subst .,,$(VER))s.zip
	mkdir mame-$(VER)
	unzip -d mame-$(VER) mame.zip
	find mame-$(VER) -type f -not -name *.png | xargs sed -i "s/\r$$//"
	tar -cf - mame-$(VER) | bzip2 -9c > mame_$(VER).orig.tar.bz2
	rm -rf mame-$(VER) mame.zip mame$(subst .,,$(VER))s.zip

mame$(subst .,,$(VER))s.zip:
	wget -U ubuntu -P . -O mame$(subst .,,$(VER))s.zip \
        "http://mamedev.org/downloader.php?&file=releases/mame$(subst .,,$(VER))s.zip"
-- 
Ubuntu-motu mailing list
Ubuntu-motu@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-motu

Reply via email to