File debian.rules of Package midgard-data

#! /usr/bin/make -f

#export DH_VERBOSE=1
export DH_COMPAT=4
export DH_OPTIONS

DEB_BUILD_ARCH   ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)

CONFIGURE_FLAGS=--with-apxs=/usr/bin/apxs2 

switch-arch:
	sed -e 's/Architecture: NOTSET/Architecture: ${DEB_BUILD_ARCH}/g' debian/control > control.dummy
	mv control.dummy debian/control

build: build-stamp
build-stamp: configure-stamp
	dh_testdir
	$(MAKE)
	touch $@

configure: configure-stamp
configure-stamp:
	dh_testdir
	./configure ${CONFIGURE_FLAGS}
	chmod 0644 midgard/datagard/*
	chmod 0755 midgard/datagard/datagard
	touch $@

clean:
	rm -rf build.stamp configure-stamp
	rm -rf debian/tmp	
	rm -rf debian/midgard
	rm -rf debian/midgard-data

install: DH_OPTIONS=
install: build
	dh_testdir
	dh_testroot
	dh_installdirs
	$(MAKE) install \
		INSTALL='/usr/bin/install -c -o root -g root' \
		DESTDIR=`pwd`/debian/tmp	
	dh_movefiles 
	
binary-indep: 
	DH_OPTIONS=-i

binary-arch: install
	DH_OPTIONS=-a
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_installdebconf
	dh_installman -a -p midgard-data man/repligard.1
	dh_installman -a -p midgard-data man/datagard.1	
	dh_strip
	dh_compress
	dh_fixperms
	dh_install
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary:	switch-arch binary-indep binary-arch
.PHONY: switch-arch binary binary-arch binary-indep install configure build clean
openSUSE Build Service is sponsored by