#!/usr/bin/make -f

BUILD_ROOT = $(CURDIR)/debian/tmp
VERSION = 3.1.1

%:
	dh $@

override_dh_auto_install:
	mkdir -p $(BUILD_ROOT)/opt
	unzip -qd $(BUILD_ROOT)/opt torquebox-dist-$(VERSION)-bin.zip
	mv $(BUILD_ROOT)/opt/torquebox-$(VERSION) $(BUILD_ROOT)/opt/razor-torquebox

	mkdir -p $(BUILD_ROOT)/etc/razor
	cp razor-torquebox.sh $(BUILD_ROOT)/etc/razor

	# Move the home directory out into a more FHS-compliant location
	mkdir -p $(BUILD_ROOT)/var/lib
	mv $(BUILD_ROOT)/opt/razor-torquebox/jboss/standalone $(BUILD_ROOT)/var/lib/razor-torquebox
	ln -s /var/lib/razor-torquebox $(BUILD_ROOT)/opt/razor-torquebox/jboss/standalone

# Arch specific binaries shipped with this are already all taken care of, and
# we don't need either shared lib deps generated, or them stripped, for
# sending this content to the world.
override_dh_shlibdeps:
override_dh_strip:
