Skip to content

Commit

Permalink
Makefile change (#18)
Browse files Browse the repository at this point in the history
* Fixed makefile, and removed npm-debug.log

* Removed build.sh, and update the Makefile to support Versions

* More updates to the Makefile
  • Loading branch information
neogenix authored and adejanovski committed Nov 16, 2016
1 parent 4c4d96c commit 57f18b5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 41 deletions.
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
# Using mvn:
VERSION := $(shell mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\[')

# Using python:
#VERSION := $(shell python -c "import xml.etree.ElementTree as ET; print(ET.parse(open('pom.xml')).getroot().find('{http://maven.apache.org/POM/4.0.0}version').text)")

package:
mvn package

prepare:
mkdir -p build/usr/share/cassandra-reaper
mkdir -p build/usr/local/bin
mkdir -p build/etc/{spotify,init.d}
mkdir -p build/etc/init.d
mkdir -p build/etc/spotify
cp resource/cassandra-reaper.yaml build/etc/spotify/
cp target/cassandra-reaper-0.3.0-SNAPSHOT.jar build/usr/share/cassandra-reaper/
cp target/cassandra-reaper-$(VERSION).jar build/usr/share/cassandra-reaper/
cp bin/* build/usr/local/bin/
cp debian/reaper.init build/etc/init.d/cassandra-reaper
chmod 755 build/etc/init.d/cassandra-reaper

deb: prepare
rm -f reaper_*.deb
fpm -s dir -t deb -n reaper -v 0.3 --pre-install debian/preinstall.sh -C build .
fpm -s dir -t deb -n reaper -v $(VERSION) --pre-install debian/preinstall.sh -C build .

rpm: prepare
rm -f reaper_*.rpm
fpm -s dir -t rpm -n reaper -v 0.3 --pre-install debian/preinstall.sh -C build .
fpm -s dir -t rpm -n reaper -v $(VERSION) --pre-install debian/preinstall.sh -C build .

all: package deb
all: package deb

clean:
rm -rf reaper_*.deb reaper_*.rpm
13 changes: 0 additions & 13 deletions build.sh

This file was deleted.

23 changes: 0 additions & 23 deletions npm-debug.log

This file was deleted.

0 comments on commit 57f18b5

Please sign in to comment.