summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMagnus Feuer <mfeuer@jaguarlandrover.com>2015-12-14 16:47:25 -0800
committerMagnus Feuer <mfeuer@jaguarlandrover.com>2015-12-14 16:47:25 -0800
commit8d8d38105b654ee46b9857de0003ef787bc8584e (patch)
tree99e58e68294e04300ba3a1924f7f3d07cb17fe3e /Makefile
parent475ae65e54c58d8e1c51a6f7256c6f670a583668 (diff)
downloadrvi_core-8d8d38105b654ee46b9857de0003ef787bc8584e.tar.gz
First stab at 0.5.0 ubuntu build
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile54
1 files changed, 47 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 64ad34c..8075809 100644
--- a/Makefile
+++ b/Makefile
@@ -12,9 +12,30 @@
.PHONY: all deps compile clean rpm rpmclean test xref ci escript
+
SCRIPTS=scripts/setup_gen \
scripts/author
+SRC_LIST=BUILD.md \
+ CONFIGURE.md \
+ doc \
+ LICENSE \
+ Makefile \
+ README.md \
+ rebar \
+ rebar.config \
+ rel \
+ RELEASE.md \
+ scripts/setup_gen \
+ scripts/rvi.service \
+ scripts/rvi_ctl \
+ scripts/rvi_install.sh \
+ python/*.py \
+ components \
+ ebin \
+ src \
+ TODO
+
VERSION=0.5.0
all: deps compile escript
@@ -30,6 +51,7 @@ escript: compile ${SCRIPTS}
recomp:
./rebar compile skip_deps=true
+
scripts/setup_gen: deps/setup/setup_gen
cp deps/setup/setup_gen scripts/
@@ -42,7 +64,10 @@ components/authorize/author:
clean: rpmclean
./rebar clean
-rpmclean:
+ubuntu_clean:
+ rm -rf ./ubuntu_build
+
+rpm_clean:
rm -rf ./rpm/BUILD/* \
./rpm/BUILDROOT/* \
./rpm/RPMS/* \
@@ -64,15 +89,30 @@ rpm_tarball: rpmclean clean
RELEASE.md rpm scripts/setup_gen scripts/rvi \
scripts/rvi.service scripts/rvi.sh \
components priv/config/rvi_sample.config scripts/rvi_instball.sh src \
- TODO
- mv /tmp/rvi-$(VERSION).tgz ./rpm/SOURCES/
-
-rpm: rpm_tarball
+# Create an ubuntu 14.04 tarball
+ubuntu_package: clean ubuntu_clean
+ install --mode=0755 -d ./ubuntu_build
+# Pack up all relevant files, and debian/, necessary for a build.
+# Add rvi-$(VERSION) at the beginning of each file so
+# that theu get packed up into a correctly named subdirectory
+#
+ tar czf ./ubuntu_build/rvi_$(VERSION).orig.tar.gz \
+ --exclude-vcs --transform="s|^|./rvi-$(VERSION)/|" \
+ $(SRC_LIST) \
+ debian \
+ rvi_ubuntu.config \
+ scripts/rvi.init.ubuntu
+# Unpack the created tar file
+ (cd ./ubuntu_build; tar xf rvi_$(VERSION).orig.tar.gz)
+# Descend into the unpacked directory and build.
+ (cd ./ubuntu_build/rvi-$(VERSION); debuild -uc -us)
+
+rpm: rpmclean rpm_tarball
rpmbuild --define "_topdir $$PWD/rpm" -ba rpm/SPECS/rvi-$(VERSION).spec
-install: # deps compile
- ./scripts/rvi_install.sh $(DESTDIR)/opt/rvi
+install: deps compile
+ ./scripts/rvi_install.sh $(DESTDIR)/opt/rvi $(DESTDIR)/opt/rvi $(DESTDIR)/var/opt/log/rvi
install --mode=0755 -d $(DESTDIR)/etc/opt/rvi/
install --mode=0644 priv/config/rvi_sample.config $(DESTDIR)/etc/opt/rvi/rvi_sample.config
install --mode=0644 priv/config/rvi_common.config $(DESTDIR)/opt/rvi/rvi_core/rvi_common.config