From 6d8a3ad7ba14ed0da94da4c28984a12fd1651772 Mon Sep 17 00:00:00 2001 From: Julien Malik Date: Fri, 4 Mar 2016 18:28:20 +0100 Subject: [PATCH] [enh] run npm, bower and gulp at build time. make sure it starts from a clean env --- debian/rules | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/debian/rules b/debian/rules index 4115af8d..9322796c 100755 --- a/debian/rules +++ b/debian/rules @@ -19,7 +19,17 @@ override_dh_auto_install: # to serve old css/js files sed -i 's/VERSION/$(DEBVERS)/g' src/index.html - # Install source files and set permissions - mkdir -p $(TMPDIR)/usr/share/yunohost - cp -r src $(TMPDIR)/usr/share/yunohost/admin - chown -R www-data $(TMPDIR)/usr/share/yunohost/admin + # Run npm/bower/gulp + # For some unknown reason, the postinstall scripts in package.json cannot be run, and triggers this error : + # "npm WARN cannot run in wd yunohost-admin@ bower install && gulp build (wd=/build/path)" + cd src ; \ + env npm_config_progress=false npm install ; \ + node_modules/bower/bin/bower install --allow-root ; \ + node_modules/gulp/bin/gulp.js build + +override_dh_clean: + dh_clean + rm -rf src/node_modules + rm -rf src/bower_components + rm -rf src/dist +