summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRudolf J Streif <rudolf.streif@gmail.com>2016-02-22 12:38:39 -0800
committerRudolf J Streif <rudolf.streif@gmail.com>2016-02-22 12:38:39 -0800
commit78c0f2638648a4f856a9945d5bbc1d0c7af5f30e (patch)
treeac5c1ebbdbbf2211588f126059dd382bbba136df
parentcb97583d4a105667cc2d2b590f0e6351e94f7d2e (diff)
parentabee27880cb70cbc755a1bba0f5f0721159bfff8 (diff)
downloadrvi_core-78c0f2638648a4f856a9945d5bbc1d0c7af5f30e.tar.gz
Merge branch 'develop' of github.com:rstreif/rvi_core into develop
-rw-r--r--Makefile25
-rw-r--r--raspbian_template/README.Debian10
-rw-r--r--raspbian_template/README.source6
-rw-r--r--raspbian_template/changelog5
-rw-r--r--raspbian_template/compat1
-rw-r--r--raspbian_template/control13
-rw-r--r--raspbian_template/copyright11
-rw-r--r--raspbian_template/docs0
-rwxr-xr-xraspbian_template/rules21
-rwxr-xr-xraspbian_template/rvi.init70
-rw-r--r--raspbian_template/rvi.lintian-overrides3
-rw-r--r--raspbian_template/rvi.postinst45
-rw-r--r--raspbian_template/rvi.postrm40
-rw-r--r--raspbian_template/rvi.service18
-rw-r--r--raspbian_template/source/format1
-rw-r--r--raspbian_template/source/lintian-overrides1
16 files changed, 270 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 1c594cc..72bbb4b 100644
--- a/Makefile
+++ b/Makefile
@@ -71,6 +71,9 @@ ubuntu_clean:
debian_clean:
rm -rf ./debian_build
+raspbian_clean:
+ rm -rf ./raspbian_build
+
rpm_clean:
rm -rf ./rpm/BUILD/* \
./rpm/BUILDROOT/* \
@@ -137,6 +140,28 @@ debian_package: clean debian_clean escript
(cd ./debian_build/rvi-$(VERSION); debuild -uc -us)
+# Create a raspbian package
+raspbian_package: clean raspbian_clean escript
+ install --mode=0755 -d ./raspbian_build
+
+# Pack up all relevant files, and debian/, necessary for a build.
+# Add rvi-$(VERSION) at the beginning of each file so
+# that they get packed up into a correctly named subdirectory
+#
+ tar czf ./raspbian_build/rvi_$(VERSION).orig.tar.gz \
+ --exclude-vcs --transform="s|^|./rvi-$(VERSION)/|" \
+ $(SRC_LIST) \
+ raspbian_template
+ rm -rf raspbian/missing-sources
+# Unpack the created tar file
+ (cd ./raspbian_build; tar xf rvi_$(VERSION).orig.tar.gz)
+# Move the debian template to be the debian package
+ mv ./raspbian_build/rvi-$(VERSION)/raspbian_template ./raspbian_build/rvi-$(VERSION)/debian
+ install -d -m 0755 ./raspbian_build/rvi-$(VERSION)/debian/missing-sources
+# Descend into the unpacked directory and build.
+ (cd ./raspbian_build/rvi-$(VERSION); debuild --prepend-path /usr/local/bin -uc -us)
+
+
rpm: rpmclean rpm_tarball
rpmbuild --define "_topdir $$PWD/rpm" -ba rpm/SPECS/rvi-$(VERSION).spec
diff --git a/raspbian_template/README.Debian b/raspbian_template/README.Debian
new file mode 100644
index 0000000..f80c683
--- /dev/null
+++ b/raspbian_template/README.Debian
@@ -0,0 +1,10 @@
+rvi for Debian
+--------------
+
+Will rely on existing Erlang installation to work.
+
+We will copy out the Erlang VM BEAM files to /opt/rvi and the configuration files to /etc/opt/rvi
+
+/opt/rvi/rvi.sh is the main control program.
+
+ -- Magnus Feuer <mfeuer@jaguarlandrover.com> Fri, 27 Nov 2015 15:34:39 -0800
diff --git a/raspbian_template/README.source b/raspbian_template/README.source
new file mode 100644
index 0000000..9e3c927
--- /dev/null
+++ b/raspbian_template/README.source
@@ -0,0 +1,6 @@
+rvi for Debian
+--------------
+
+
+ -- Magnus Feuer <mfeuer@jaguarlandrover.com> Fri, 27 Nov 2015 15:34:39 -0800
+
diff --git a/raspbian_template/changelog b/raspbian_template/changelog
new file mode 100644
index 0000000..3d774a4
--- /dev/null
+++ b/raspbian_template/changelog
@@ -0,0 +1,5 @@
+rvi (0.5.0-1) jessie; urgency=low
+
+ * Initial release
+
+ -- Magnus Feuer <mfeuer@jaguarlandrover.com> Fri, 27 Nov 2015 15:34:39 -0800
diff --git a/raspbian_template/compat b/raspbian_template/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/raspbian_template/compat
@@ -0,0 +1 @@
+9
diff --git a/raspbian_template/control b/raspbian_template/control
new file mode 100644
index 0000000..0fb7b83
--- /dev/null
+++ b/raspbian_template/control
@@ -0,0 +1,13 @@
+Source: rvi
+Section: net
+Priority: optional
+Maintainer: Magnus Feuer <mfeuer@jaguarlandrover.com>
+Build-Depends: debhelper (>= 9), libbluetooth-dev
+Standards-Version: 3.9.6
+Homepage: https://github.com/PDXostc/rvi_core
+
+Package: rvi
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, bluez, erlang (>= 1:18.2), python-jsonrpclib (>= 0.1.3-1), python (>= 2.7.9-1)
+Description: Remote Vehicle Interaction
+ GENIVI Remote Vehicle Interaction Core
diff --git a/raspbian_template/copyright b/raspbian_template/copyright
new file mode 100644
index 0000000..89597cf
--- /dev/null
+++ b/raspbian_template/copyright
@@ -0,0 +1,11 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: rvi
+Source: http://github.com/PDXostc/rvi_core
+
+Files: *
+Copyright: Copyright 2014,2015,2016 Jaguar Land Rover
+License: MPL-2.0
+ This program is licensed under the terms and conditions of the
+ Mozilla Public License, version 2.0. The full text of the
+ Mozilla Public License is at https://www.mozilla.org/MPL/2.0/
+
diff --git a/raspbian_template/docs b/raspbian_template/docs
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/raspbian_template/docs
diff --git a/raspbian_template/rules b/raspbian_template/rules
new file mode 100755
index 0000000..b6b8c0a
--- /dev/null
+++ b/raspbian_template/rules
@@ -0,0 +1,21 @@
+#!/usr/bin/make -f
+# -*- makefile --*
+
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+%:
+ dh $@
+
+override_dh_auto_install:
+ ./scripts/rvi_install \
+ -s ./debian/rvi \
+ -k priv/keys/insecure_device_key.pem \
+ -r priv/certificates/insecure_root_cert.crt \
+ -d priv/certificates/insecure_device_cert.crt \
+ -c priv/credentials/insecure_credential.jwt \
+ -l ./debian/rvi/var/log/rvi ./debian/rvi/usr/lib/rvi_core
+# Copy out rvi_ctl to /usr/bin
+ install -D -m 0755 ./debian/rvi/usr/lib/rvi_core/rvi_ctl ./debian/rvi/usr/bin/rvi_ctl
+# Install default config
+ install -D -m 0644 ./priv/config/rvi_ubuntu.config ./debian/rvi/etc/rvi/rvi.config
diff --git a/raspbian_template/rvi.init b/raspbian_template/rvi.init
new file mode 100755
index 0000000..9cd4e59
--- /dev/null
+++ b/raspbian_template/rvi.init
@@ -0,0 +1,70 @@
+#!/bin/sh
+#
+# Copyright (C) 2014, Jaguar Land Rover
+#
+# This program is licensed under the terms and conditions of the
+# Mozilla Public License, version 2.0. The full text of the
+# Mozilla Public License is at https://www.mozilla.org/MPL/2.0/
+#
+#
+# Init.d script to start and stop an RVI system installed
+# through an RPM.
+#
+### BEGIN INIT INFO
+# Provides: rvi
+# Required-Start: $network $syslog $remote_fs
+# Required-Stop: $network $syslog $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start/Stop RVI node at boot time
+# Description: Manage Remote Vehicle Interaction Node run state.
+### END INIT INFO
+
+export PATH="/bin/:/usr/bin:/sbin:/usr/sbin"
+export HOME=/usr/lib/rvi_core
+. /lib/lsb/init-functions
+
+set -e
+
+case "$1" in
+ start)
+ log_daemon_msg "Starting Remote Vehicle Interaction Node..." "rvi"
+ if /usr/bin/rvi_ctl -c /etc/rvi/rvi.config start; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
+ ;;
+ stop)
+ log_daemon_msg "Stopping Remote Vehicle Interaction Node..." "rvi"
+ if /usr/bin/rvi_ctl stop; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
+ ;;
+
+ restart)
+ log_daemon_msg "Restarting Remote Vehicle Interaction Node..." "rvi"
+ if /usr/bin/rvi_ctl restart; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
+ ;;
+
+ force-reload)
+ log_daemon_msg "Restarting Remote Vehicle Interaction Node..." "rvi"
+ if /usr/bin/rvi_ctl restart; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
+ ;;
+ *)
+ log_action_msg "Usage: /etc/init.d/rvi {start|stop|restart}"
+ exit 1
+esac
+
+exit 0
+
diff --git a/raspbian_template/rvi.lintian-overrides b/raspbian_template/rvi.lintian-overrides
new file mode 100644
index 0000000..c307106
--- /dev/null
+++ b/raspbian_template/rvi.lintian-overrides
@@ -0,0 +1,3 @@
+executable-not-elf-or-script
+missing-dep-for-interpreter
+binary-without-manpage \ No newline at end of file
diff --git a/raspbian_template/rvi.postinst b/raspbian_template/rvi.postinst
new file mode 100644
index 0000000..10c11fe
--- /dev/null
+++ b/raspbian_template/rvi.postinst
@@ -0,0 +1,45 @@
+#!/bin/sh
+# postinst script for rvi
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <postinst> `abort-remove'
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+# source debconf library
+. /usr/share/debconf/confmodule
+
+case "$1" in
+
+ configure)
+ # Set up our config
+ cat /proc/sys/kernel/random/uuid > /etc/rvi/device_id
+ echo "RVI Device ID set to $(cat /etc/rvi/device_id) in /etc/rvi/device_id"
+ #DEBHELPER#
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ exit 0
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+
+esac
+
+db_stop
+
+exit 0
diff --git a/raspbian_template/rvi.postrm b/raspbian_template/rvi.postrm
new file mode 100644
index 0000000..a0c5d5b
--- /dev/null
+++ b/raspbian_template/rvi.postrm
@@ -0,0 +1,40 @@
+#!/bin/sh
+# postrm script for rvi
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postrm> `remove'
+# * <postrm> `purge'
+# * <old-postrm> `upgrade' <new-version>
+# * <new-postrm> `failed-upgrade' <old-version>
+# * <new-postrm> `abort-install'
+# * <new-postrm> `abort-install' <old-version>
+# * <new-postrm> `abort-upgrade' <old-version>
+# * <disappearer's-postrm> `disappear' <overwriter>
+# <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+# source debconf library
+. /usr/share/debconf/confmodule
+
+case "$1" in
+
+ remove|purge|upgrde|disappear)
+ rm -f /etc/init.d/rvi
+ #DEBHELPER#
+ ;;
+
+ *)
+ exit 0
+ ;;
+
+
+esac
+
+db_stop
+
+exit 0
diff --git a/raspbian_template/rvi.service b/raspbian_template/rvi.service
new file mode 100644
index 0000000..d9ae979
--- /dev/null
+++ b/raspbian_template/rvi.service
@@ -0,0 +1,18 @@
+# systemd(8) setup for Debian
+
+[Unit]
+Description=Remote Vehicle Interaction Service
+Wants=network-online.target
+
+[Service]
+Environment="HOME=/usr/lib/rvi_core"
+Type=forking
+StandardOutput=journal
+StandardError=journal
+ExecStart=/usr/bin/rvi_ctl -c /etc/rvi/rvi.config start
+ExecStop=/usr/bin/rvi_ctl stop
+GuessMainPID=yes
+RemainAfterExit=yes
+
+[Install]
+WantedBy=graphical.target multi-user.target
diff --git a/raspbian_template/source/format b/raspbian_template/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/raspbian_template/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/raspbian_template/source/lintian-overrides b/raspbian_template/source/lintian-overrides
new file mode 100644
index 0000000..463abe9
--- /dev/null
+++ b/raspbian_template/source/lintian-overrides
@@ -0,0 +1 @@
+source-is-missing