yunohost-admin/debian/rules
Jérôme Lebleu 67caf00f28 [fix] Run npm/gulp at build in Debian rules
The assets building - e.g. npm and bower installation followed by build task -
must be done in the build sequence instead of the install one. The main reason
is logic, we are building something. The second one - which we "fixed" by
adding extra arguments to npm and bower - is due to the user who runs those
sequences: *build* uses a non-privileged one while *install* uses root. It
resulted in npm and bower complaining about using the root user.

Since 03e979f, bower installation is integrated to npm postinstall, that's
why this issue reappears. This commit also removes the useless `bower install`
command.
2016-07-23 22:16:47 +02:00

31 lines
777 B
Makefile
Executable file
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# Get package version
# dpkg-parsechangelog > 1.17 could use dpkg-parsechangelog --show-field Version
DEBVERS := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
# Define temporary debian directory
TMPDIR = $$(pwd)/debian/yunohost-admin
%:
dh $@
override_dh_auto_build:
# Replace VERSION with current package version to prevent web browser
# to serve old css/js files
sed -i 's/VERSION/$(DEBVERS)/g' src/index.html
# Run npm/bower/gulp
cd src ; npm --progress false --loglevel warn --color false install
cd src ; 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