2015-01-31 21:24:58 +01:00
|
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
# -*- makefile -*-
|
|
|
|
|
|
|
|
|
|
# Uncomment this to turn on verbose mode.
|
|
|
|
|
#export DH_VERBOSE=1
|
|
|
|
|
|
2015-08-31 12:17:55 +02:00
|
|
|
|
# Get package version
|
|
|
|
|
# dpkg-parsechangelog > 1.17 could use dpkg-parsechangelog --show-field Version
|
|
|
|
|
DEBVERS := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
|
|
|
|
|
|
2015-11-03 14:40:29 +01:00
|
|
|
|
# Define temporary debian directory
|
|
|
|
|
TMPDIR = $$(pwd)/debian/yunohost-admin
|
|
|
|
|
|
2015-01-31 21:24:58 +01:00
|
|
|
|
%:
|
|
|
|
|
dh $@
|
2015-08-31 12:17:55 +02:00
|
|
|
|
|
2015-11-03 14:40:29 +01:00
|
|
|
|
override_dh_auto_install:
|
2015-08-31 12:17:55 +02:00
|
|
|
|
# Replace VERSION with current package version to prevent web browser
|
|
|
|
|
# to serve old css/js files
|
2015-09-02 10:23:23 +02:00
|
|
|
|
sed -i 's/VERSION/$(DEBVERS)/g' src/index.html
|
2015-11-03 14:40:29 +01:00
|
|
|
|
|
2016-03-04 18:28:20 +01:00
|
|
|
|
# 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)"
|
2016-03-16 15:48:15 +01:00
|
|
|
|
cd src ; npm --progress false --loglevel warn --color false --unsafe-perm install
|
2016-03-04 22:33:11 +01:00
|
|
|
|
cd src ; node_modules/bower/bin/bower install --allow-root
|
|
|
|
|
cd src ; node_modules/gulp/bin/gulp.js build
|
2016-03-04 18:28:20 +01:00
|
|
|
|
|
|
|
|
|
override_dh_clean:
|
|
|
|
|
dh_clean
|
|
|
|
|
rm -rf src/node_modules
|
|
|
|
|
rm -rf src/bower_components
|
|
|
|
|
rm -rf src/dist
|
|
|
|
|
|