PREFIX = /usr/local/share
MAJOR = 0
MINOR = 9
REVISION = 1
VER = $(MAJOR).$(MINOR).$(REVISION)

DEST = $(PREFIX)/rec10

install:
	if ! [ -d $(PREFIX)/rec10 ]; then mkdir -p $(PREFIX)/rec10 ;fi
	cp ./*.py $(DEST)/
	cp ./*.xml $(DEST)/
	echo -e "#!/bin/sh\nexport LANG=\"ja_JP.UTF-8\" && python2.6 ${DEST}/rec10d.py" > ./rec10
	install -m755 ./rec10 $(DEST)/
	ln $(DEST)/rec10 /usr/local/bin
	chmod 755 /usr/local/bin/rec10
	if ! [ -f /etc/rec10.conf ]; then cp ./rec10.conf /etc/rec10.conf;fi
	if ! [ -d /tmp/rec10 ]; then mkdir -p /tmp/rec10 ;fi
	chmod 777 /tmp/rec10
uninstall:
	rm -rf $(DEST)
	rm -rf /tmp/rec10
	rm -f /usr/local/bin/rec10
