#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

install/glusterfs-server::
	mv debian/tmp/etc/glusterfs/glusterfs.vol.sample \
		debian/tmp/etc/glusterfs/glusterfs.vol
	mv debian/tmp/etc/glusterfs/glusterfsd.vol.sample \
		debian/tmp/etc/glusterfs/glusterfsd.vol
	mv debian/tmp/usr/sbin/glusterfsd \
		debian/tmp/usr/sbin/glusterfs

install/libglusterfs0::
	for f in debian/tmp/usr/lib/glusterfs/*/xlator/debug/trace.so; do \
		debug_path=`echo "$$f" | sed -e 's|debian/tmp|debian/glusterfs-dbg/usr/lib/debug|'`; \
		install -d "`dirname $$debug_path`"; \
		objcopy --only-keep-debug "$$f" "$$debug_path"; \
	done
	strip --remove-section=.comment --remove-section=.note --strip-unneeded \
		debian/tmp/usr/lib/glusterfs/*/xlator/debug/trace.so
	strip --remove-section=.comment --remove-section=.note --strip-unneeded \
		debian/tmp/usr/lib/glusterfs/*/xlator/debug/error-gen.so.0.0.0
	strip --remove-section=.comment debian/tmp/usr/lib/glusterfs/*/xlator/debug/io-stats.so.0.0.0

clean::
	dh $@

get-orig-source::
	uscan --force-download --verbose
