RC=2
TEST_PATH=/tmp/ig
MANUAL_NAME=MANUAL_INTEGRADE_RC${RC}
DEPLOYER_PACK=deployer-0.${RC}.tar.gz
IG_PACK=integrade-0.4RC${RC}.tar.gz 
RELEASE_PACK=ig-with-deployer-0.4RC${RC}.tar.gz

pack: clean
	./deployer clean
	tar czvf ${DEPLOYER_PACK}  --exclude .svn --exclude experiments ../deployer/
	tar czvf ${IG_PACK} --exclude .svn --exclude mobile --exclude .cvsignore ../integrade/	
	cp README MANUAL_INTEGRADE_RC${RC}
	tar czvf ${RELEASE_PACK} ${DEPLOYER_PACK} ${IG_PACK} ${MANUAL_NAME} 
	du -h ${RELEASE_PACK} ${DEPLOYER_PACK} ${IG_PACK} ${MANUAL_NAME} 
	
clean:
	rm -Rf ${DEPLOYER_PACK} ${IG_PACK} ${TEST_PATH} ${MANUAL_NAME}
		
test: pack
	mkdir ${TEST_PATH}
	mv ${DEPLOYER_PACK} ${IG_PACK} ${TEST_PATH}
	cd ${TEST_PATH} && tar zxvf ${DEPLOYER_PACK} && tar zxvf ${IG_PACK}
	cd ${TEST_PATH}/deployer && ./deployer clean && ./deployer uninstall && ./deployer all
