TC_NAME=u3r include ./basic6.include include ./db.include DEEGREE_WAR=./drm-admin_2011-10-14.zip TMPDIR := $(shell mktemp -d) # This is just for testing without "rpmbuild" ifndef RPM_BUILD_ROOT RPM_BUILD_ROOT=/tmp/specbuildroot endif install: install -d $(RPM_BUILD_ROOT)$(TC_TARGET)/webapps/$(TC_NAME) install -d $(RPM_BUILD_ROOT)/usr/share/doc/$(TC_NAME) unzip $(DEEGREE_WAR) -d $(RPM_BUILD_ROOT)$(TC_TARGET)/webapps/$(TC_NAME) cp integration/WEB-INF/conf/security/security.xml $(RPM_BUILD_ROOT)$(TC_TARGET)/webapps/$(TC_NAME)/WEB-INF/conf/security/security.xml # copy and configure security.xml sed "s|@DATABASE_HOST@|$(DATABASE_HOST)|" integration/WEB-INF/conf/security/security.xml > $(RPM_BUILD_ROOT)$(TC_TARGET)/webapps/$(TC_NAME)/WEB-INF/conf/security/security.xml ;\ sed -i "s|@DATABASE_PORT@|$(DATABASE_PORT)|" $(RPM_BUILD_ROOT)$(TC_TARGET)/webapps/$(TC_NAME)/WEB-INF/conf/security/security.xml ;\ sed -i "s|@DATABASE@|$(DATABASE)|" $(RPM_BUILD_ROOT)$(TC_TARGET)/webapps/$(TC_NAME)/WEB-INF/conf/security/security.xml ;\ sed -i "s|@DATABASE_USER@|$(DATABASE_USER)|" $(RPM_BUILD_ROOT)$(TC_TARGET)/webapps/$(TC_NAME)/WEB-INF/conf/security/security.xml ;\ rpmsource: mkdir -p SOURCES mkdir $(TMPDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE) cp -ar * $(TMPDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE) find $(TMPDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE) -type d -name .svn | xargs rm -rf tar -C $(TMPDIR) --exclude SOURCES --exclude logs -czf SOURCES/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE).tar.gz $(PACKAGE_NAME)-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)/ rm -rf $(TMPDIR) rpmbuild: mkdir logs rpmbuild -ba u3r.spec --target i586 2>&1 | tee logs/rpmbuild.log staging-clean: rm -rf {logs,SOURCES} rm -rf $(RPM_BUILD_ROOT)