#!/usr/bin/make -f include /usr/share/dpkg/default.mk DEBPKGNAME := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}') INSTALL_SOURCE := $(shell echo $(DEB_SOURCE) | sed -e 's/node\-//g') CMAKE_EXTRA_FLAGS = \ -DCMAKE_INSTALL_PREFIX=/usr/lib export DEB_BUILD_MAINT_OPTIONS = hardening=+all %: dh $@ override_dh_auto_build: dh_auto_build node-gyp rebuild override_dh_auto_configure: # provide a fake shiny-server executable pointing to debian packaged nodejs # See external/node/CMakeLists.txt for details mkdir -p ext/node/bin ln -s /usr/bin/nodejs ext/node/bin/shiny-server dh_auto_configure -- $(CMAKE_EXTRA_FLAGS) ln -s obj-$(DEB_BUILD_GNU_TYPE) build override_dh_auto_test: mocha -R spec override_dh_install: dh_install mkdir -p debian/$(INSTALL_SOURCE)/etc/logrotate.d cp -a config/logrotate debian/$(INSTALL_SOURCE)/etc/logrotate.d/shiny-server find debian/$(INSTALL_SOURCE) -name COPYING -delete find debian/$(INSTALL_SOURCE) -name GIT_VERSION -delete find debian/$(INSTALL_SOURCE) -name build -type l -delete rm -rf debian/$(INSTALL_SOURCE)/usr/lib/shiny-server/config/* rm -rf debian/$(INSTALL_SOURCE)/usr/lib/shiny-server/scripts override_dh_installchangelogs: dh_installchangelogs NEWS override_dh_fixperms: dh_fixperms chmod +x debian/$(INSTALL_SOURCE)/usr/lib/shiny-server/tools/makedocs.js chmod +x debian/$(INSTALL_SOURCE)/usr/lib/shiny-server/lib/main.js find debian/$(INSTALL_SOURCE) -name "*.Rmd" -exec chmod -x \{\} \;