This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository mum. See http://git.chorem.org/mum.git commit 220d11035444e4fa9fb1ac749b3c101f53c0b991 Author: Benjamin POUSSIN <poussin@codelutin.com> Date: Fri Jul 10 19:51:19 2015 +0200 - add bower directory creation during packaging creation - add Makefile to create .rpm and .deb easily --- Makefile | 7 +++++++ debian/control | 2 +- debian/rules | 15 +++++---------- redhat/mum.spec | 3 +++ scripts/mum-install-bower.sh | 13 +++++++++++++ scripts/mum-install-venv.sh | 8 +------- 6 files changed, 30 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7cc34a8 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +VERSION=0.1-1 + +deb: + dpkg-buildpackage -us -uc + +rpm: + rpm -ba redhat/mum.spec diff --git a/debian/control b/debian/control index 8517190..979bab9 100644 --- a/debian/control +++ b/debian/control @@ -10,6 +10,6 @@ Homepage: http://www.chorem.org/projects/mum/ Package: mum Architecture: all -Depends: ${shlibs:Depends}, ${misc:Depends}, python, python2.7-dev, nmap, iputils-ping +Depends: ${misc:Depends}, python, python2.7-dev, nmap, iputils-ping Description: Machines Under Monitoring Simple monitoring through a web interface. \ No newline at end of file diff --git a/debian/rules b/debian/rules index 02db10e..2765e00 100755 --- a/debian/rules +++ b/debian/rules @@ -43,15 +43,7 @@ clean : rm -f build-stamp dh_clean -$(DEST_APP)/bower_components: - mkdir -p $(DEST_APP) - cd $(DEST_APP) - npm install bower - node_modules/bower/bin/bower install $(CURDIR)/bower.json - rm -rf $(DEST_APP)/node_modules - rm -rf $(DEST_APP)/bower_components/jquery - -install : build clean $(app) $(DEST_APP)/bower_components $(static) $(views) $(scripts) $(mum_conf) $(mum_sudoers) $(readme) $(requirements) $(license) +install : build clean $(app) $(static) $(views) $(scripts) $(mum_conf) $(mum_sudoers) $(readme) $(requirements) $(license) dh_testdir dh_testroot dh_clean -k @@ -66,12 +58,15 @@ install : build clean $(app) $(DEST_APP)/bower_components $(static) $(views) $(s mkdir -p $(DEST_DOC) mkdir -p $(DEST_LOGS) + $(scripts)/mum-install-bower.sh $(CURDIR)/bower.json $(DEST_APP) + rm -rf $(DEST_APP)/bower_components/jquery + cp -R $(app) $(DEST_APP) cp -R $(static) $(DEST_APP) cp -R $(views) $(DEST_APP) cp -R $(scripts) $(DEST_APP) cp $(mum_conf) $(DEST_CONF)/mum - cp $(mum_sudoers) $$(DEST_CONF)/sudoers.d + cp $(mum_sudoers) $(DEST_CONF)/sudoers.d/mum cp $(readme) $(DEST_APP) cp $(license) $(DEST_DOC) cp $(requirements) $(DEST_APP) diff --git a/redhat/mum.spec b/redhat/mum.spec index 7f52c78..b2efed9 100644 --- a/redhat/mum.spec +++ b/redhat/mum.spec @@ -37,6 +37,9 @@ mkdir -p %{buildroot}/%{DEST_VAR}/keys mkdir -p %{buildroot}/%{DEST_LOG} mkdir -p %{buildroot}/%{DEST_BIN} +scripts/mum-install-bower.sh bower.json %{buildroot}/%{DEST_APP} +rm -rf %{buildroot}/%{DEST_APP}/bower_components/jquery + #cd %{_topdir} cp -R app %{buildroot}/%{DEST_APP} cp -R bower_components %{buildroot}/%{DEST_APP} diff --git a/scripts/mum-install-bower.sh b/scripts/mum-install-bower.sh new file mode 100755 index 0000000..ae2a926 --- /dev/null +++ b/scripts/mum-install-bower.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +BOWER_CONF=$(readlink -m $1) +TARGET_DIR=$2 + +if [ -d $MUM_DIR/bower_components ]; then + ln -s $MUM_DIR/bower_components $TARGET_DIR +else + cd $TARGET_DIR + npm install --prefix=$TARGET_DIR bower + node_modules/bower/bin/bower --quiet --allow-root install $BOWER_CONF + rm -fr node_modules +fi diff --git a/scripts/mum-install-venv.sh b/scripts/mum-install-venv.sh index 30ad3b8..0fb2c56 100755 --- a/scripts/mum-install-venv.sh +++ b/scripts/mum-install-venv.sh @@ -25,13 +25,7 @@ sed -i 's/}}/]]/g' $VENV_DIR/lib/python*/site-packages/bottle.py echo "Mum - Installing javascript library ..." -if [ -d $MUM_DIR/bower_components ]; then - ln -s $MUM_DIR/bower_components $VENV_DIR -else - cd $VENV_DIR - npm install bower - node_modules/bower/bin/bower install $MUM_DIR/bower.json -fi +$SCRIPT_DIR/mum-install-bower.sh $MUM_DIR/bower.json $VENV_DIR # # create all other necessary link -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.