[Debian-iot-packaging] [alljoyn-gateway-1504] 02/03: Import Debian patch 15.04~git20160606-1

Thorsten Alteholz alteholz at moszumanska.debian.org
Sun Dec 25 22:16:08 UTC 2016


This is an automated email from the git hooks/post-receive script.

alteholz pushed a commit to branch master
in repository alljoyn-gateway-1504.

commit 1ee624b02efe7c91c8ccf92fe5a9be7a62329d44
Author: Thorsten Alteholz <debian at alteholz.de>
Date:   Mon Jun 20 21:28:32 2016 +0200

    Import Debian patch 15.04~git20160606-1
---
 debian/README.Debian                           | 16 ++++++
 debian/alljoyn-gateway-1504.init               | 75 ++++++++++++++++++++++++++
 debian/alljoyn-gateway-1504.install            |  2 +
 debian/alljoyn-gateway-1504.postinst           | 13 +++++
 debian/alljoyn-gateway-1504.postrm             | 13 +++++
 debian/changelog                               |  5 ++
 debian/clean                                   |  1 +
 debian/compat                                  |  1 +
 debian/control                                 | 45 ++++++++++++++++
 debian/copyright                               | 19 +++++++
 debian/liballjoyngateway1504.install           |  3 ++
 debian/liballjoyngateway1504.lintian-overrides |  3 ++
 debian/patches/hardening.patch                 | 16 ++++++
 debian/patches/series                          |  4 ++
 debian/patches/soname.patch                    | 27 ++++++++++
 debian/patches/use-global-build_core.patch     | 15 ++++++
 debian/rules                                   | 62 +++++++++++++++++++++
 debian/source/format                           |  1 +
 debian/watch                                   |  5 ++
 19 files changed, 326 insertions(+)

diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..12f9f66
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,16 @@
+Alljoyn for Debian
+
+This is the gateway agent package of Alljoyn.
+
+There are several parts of the Alljoyn framework which are developed by
+different Workgroup. As all workgroups develop with varying speeds,
+several versions of the core library are needed to be able to use all 
+parts of the framework.
+
+At the moment following versions of the gateway agent are needed:
+        15.04 -> not yet (alljoyn-gateway-1504)
+        15.09 -> not yet (alljoyn-gateway-1509)
+        16.04 -> not yet (alljoyn-gateway-1604)
+
+ -- Thorsten Alteholz <debian at alteholz.de>  Tue, 31 May 2016 18:28:32 +0200
+
diff --git a/debian/alljoyn-gateway-1504.init b/debian/alljoyn-gateway-1504.init
new file mode 100644
index 0000000..184ed0b
--- /dev/null
+++ b/debian/alljoyn-gateway-1504.init
@@ -0,0 +1,75 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: alljoyn-gateway-1504
+# Required-Start: $local_fs $network $named $time $syslog
+# Required-Stop: $local_fs $network $named $time $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: AllJoyn Gateway Agent
+# Description: Provides the AllJoyn Gateway Agent service.
+### END INIT INFO
+
+SCRIPT=alljoyn-gwagent
+RUNAS=root
+NAME=alljoyn-gwagent
+PIDFILE=/var/run/$NAME.pid
+LOGFILE=/var/log/$NAME.log
+
+. /lib/lsb/init-functions
+
+start() {
+  if [ -f $PIDFILE ] && kill -0 $(cat $PIDFILE); then
+    echo 'Service already running' >&2
+    return 1
+  fi
+  echo 'Starting service…' >&2
+  local CMD="$SCRIPT &> \"$LOGFILE\" & echo \$!"
+  su -c "$CMD" $RUNAS > "$PIDFILE"
+  echo 'Service started' >&2
+}
+
+stop() {
+  if [ ! -f "$PIDFILE" ] || ! kill -0 $(cat "$PIDFILE"); then
+    echo 'Service not running' >&2
+    return 1
+  fi
+  echo 'Stopping service…' >&2
+  kill -15 $(cat "$PIDFILE") && rm -f "$PIDFILE"
+  echo 'Service stopped' >&2
+}
+
+status() {
+  printf "%-50s" "Checking $NAME..."
+  if [ -f $PIDFILE ]; then
+    PID=$(cat $PIDFILE)
+    if [ -z "$(ps axf | grep ${PID} | grep -v grep)" ]; then
+      printf "%s\n" "The process appears to be dead but pidfile still exists"
+    else
+      echo "Running, the PID is $PID"
+    fi
+  else
+    printf "%s\n" "Service not running"
+  fi
+}
+
+case "$1" in
+  start)
+    start
+    ;;
+  stop)
+    stop
+    ;;
+  status)
+    status
+    ;;
+  force-reload)
+    stop
+    start
+    ;;
+  restart)
+    stop
+    start
+    ;;
+  *)
+    echo "Usage: $0 {start|stop|status|restart|force-reload}"
+esac
diff --git a/debian/alljoyn-gateway-1504.install b/debian/alljoyn-gateway-1504.install
new file mode 100644
index 0000000..85f09e9
--- /dev/null
+++ b/debian/alljoyn-gateway-1504.install
@@ -0,0 +1,2 @@
+build/*/*/*/dist/gatewayMgmtApp/bin/alljoyn-gwagent /usr/bin
+cpp/GatewayMgmtApp/manifest.xsd /usr/lib/alljoyn/opt/alljoyn/gwagent
diff --git a/debian/alljoyn-gateway-1504.postinst b/debian/alljoyn-gateway-1504.postinst
new file mode 100644
index 0000000..2386a9a
--- /dev/null
+++ b/debian/alljoyn-gateway-1504.postinst
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "configure" ]; then
+  # until all issues are resolved, this package needs
+  # a link from /opt to the correct directory
+  ln -s /usr/lib/alljoyn/opt/alljoyn /opt/alljoyn
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/alljoyn-gateway-1504.postrm b/debian/alljoyn-gateway-1504.postrm
new file mode 100644
index 0000000..5984b4e
--- /dev/null
+++ b/debian/alljoyn-gateway-1504.postrm
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "remove" ]; then
+  # until all issues are resolved, this package needs
+  # a link from /opt to the correct directory
+  rm -f /opt/alljoyn
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..26f463a
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+alljoyn-gateway-1504 (15.04~git20160606-1) unstable; urgency=medium
+
+  * Initial release (Closes: #827772)
+
+ -- Thorsten Alteholz <debian at alteholz.de>  Mon, 20 Jun 2016 21:28:32 +0200
diff --git a/debian/clean b/debian/clean
new file mode 100644
index 0000000..4a97dfa
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1 @@
+# You must remove unused comment lines for the released package.
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..41f4b1c
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,45 @@
+Source: alljoyn-gateway-1504
+Section: net
+Priority: extra
+Maintainer: Thorsten Alteholz <debian at alteholz.de>
+Build-Depends: dh-exec (>=0.3)
+               , debhelper (>=9)
+	       , liballjoyn-common-dev-1504
+	       , liballjoyn-dev-1504
+	       , liballjoynservices-dev-1504
+               , libxml2-dev
+               , scons
+               , libssl-dev
+               , libgtest-dev
+Standards-Version: 3.9.8
+Homepage: https://allseenalliance.org/framework
+
+Package: alljoyn-gateway-1504
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: AllJoyn gateway agent for 1504
+ AllJoyn is a collaborative open-source software framework that makes 
+ it easy for developers to write applications that can discover nearby
+ devices, and communicate with each other directly regardless of 
+ brands, categories, transports, and OSes without the need of the cloud. 
+ .
+ The AllJoyn framework is extremely flexible with many features to help 
+ make the vision of the Internet of Things come to life.
+ .
+ This package contains the software for the gateway agent 
+ in version 1504.
+
+Package: liballjoyngateway1504
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: AllJoyn gateway agent for 1504, library package
+ AllJoyn is a collaborative open-source software framework that makes 
+ it easy for developers to write applications that can discover nearby
+ devices, and communicate with each other directly regardless of 
+ brands, categories, transports, and OSes without the need of the cloud. 
+ .
+ The AllJoyn framework is extremely flexible with many features to help 
+ make the vision of the Internet of Things come to life.
+ .
+ This package contains the libraries for the gateway agent 
+ in version 1504.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..967460c
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,19 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: alljoyn
+Source: https://allseenalliance.org/framework
+
+Files:     *
+Copyright: 2003-2016 AllSeen Alliance
+           2000-2001 Aaron D. Gifford
+License:   ISC
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/debian/liballjoyngateway1504.install b/debian/liballjoyngateway1504.install
new file mode 100755
index 0000000..053894f
--- /dev/null
+++ b/debian/liballjoyngateway1504.install
@@ -0,0 +1,3 @@
+#! /usr/bin/dh-exec
+build/*/*/*/dist/gatewayController/lib/liballjoyn_gateway.so.* /usr/lib/${DEB_HOST_MULTIARCH}
+build/*/*/*/dist/gatewayConnector/lib/liballjoyn_gwconnector.so.* /usr/lib/${DEB_HOST_MULTIARCH}
diff --git a/debian/liballjoyngateway1504.lintian-overrides b/debian/liballjoyngateway1504.lintian-overrides
new file mode 100644
index 0000000..74e3f9c
--- /dev/null
+++ b/debian/liballjoyngateway1504.lintian-overrides
@@ -0,0 +1,3 @@
+#the package contains several small libs
+liballjoyngateway1504: package-name-doesnt-match-sonames
+
diff --git a/debian/patches/hardening.patch b/debian/patches/hardening.patch
new file mode 100644
index 0000000..02fec5e
--- /dev/null
+++ b/debian/patches/hardening.patch
@@ -0,0 +1,16 @@
+Author: Thorsten Alteholz <debian at alteholz.de>
+Description: add hardening flags to calm lintian
+Index: alljoyn-gateway-1504/cpp/SConscript
+===================================================================
+--- alljoyn-gateway-1504.orig/cpp/SConscript	2016-06-03 12:24:29.000000000 +0200
++++ alljoyn-gateway-1504/cpp/SConscript	2016-06-07 11:31:53.000000000 +0200
+@@ -20,6 +20,9 @@
+         gateway_env.AppendUnique(LIBS = [ 'stdc++', 'pthread' ])
+     if gateway_env['OS'] == 'linux':
+         gateway_env.AppendUnique(LIBS = [ 'pthread' ])
++        gateway_env.Append(LINKFLAGS = ['-fPIE', '-pie', '-fPIC'])
++        gateway_env.Append(CFLAGS = ['-fPIE', '-fPIC', '-D_FORTIFY_SOURCE=2'])
++        gateway_env.Append(CPPFLAGS = ['-fPIE', '-fPIC', '-D_FORTIFY_SOURCE=2'])
+ 
+ gateway_dirs = [
+     'common',
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..b3defc3
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,4 @@
+#XXX hardening.patch
+use-global-build_core.patch
+soname.patch
+hardening.patch
diff --git a/debian/patches/soname.patch b/debian/patches/soname.patch
new file mode 100644
index 0000000..f674c50
--- /dev/null
+++ b/debian/patches/soname.patch
@@ -0,0 +1,27 @@
+Description: add SONAME to libraries
+Author: Thorsten Alteholz <debian at alteholz.de>
+Index: alljoyn-gateway-1504/cpp/GatewayConnector/src/SConscript
+===================================================================
+--- alljoyn-gateway-1504.orig/cpp/GatewayConnector/src/SConscript	2016-06-03 12:24:29.000000000 +0200
++++ alljoyn-gateway-1504/cpp/GatewayConnector/src/SConscript	2016-06-07 11:01:07.000000000 +0200
+@@ -28,6 +28,6 @@
+ # Shared library
+ if gwcnc_env.get('LIBTYPE', 'static') != 'static':
+     shobjs = gwcnc_env.SharedObject(srcs)
+-    libs.append(gwcnc_env.SharedLibrary('alljoyn_gwconnector', shobjs))
++    libs.append(gwcnc_env.SharedLibrary('alljoyn_gwconnector', shobjs, SHLIBVERSION='1504'))
+ 
+ Return('libs')
+Index: alljoyn-gateway-1504/cpp/GatewayController/src/SConscript
+===================================================================
+--- alljoyn-gateway-1504.orig/cpp/GatewayController/src/SConscript	2016-06-03 12:24:29.000000000 +0200
++++ alljoyn-gateway-1504/cpp/GatewayController/src/SConscript	2016-06-07 11:01:00.000000000 +0200
+@@ -28,7 +28,7 @@
+ # Shared library
+ if gateway_env.get('LIBTYPE', 'static') != 'static':
+     shobjs = gateway_env.SharedObject(srcs)
+-    libs.append(gateway_env.SharedLibrary('alljoyn_gateway', shobjs))
++    libs.append(gateway_env.SharedLibrary('alljoyn_gateway', shobjs, SHLIBVERSION='1504'))
+ 
+ Return('libs')
+ 
diff --git a/debian/patches/use-global-build_core.patch b/debian/patches/use-global-build_core.patch
new file mode 100644
index 0000000..004b4ed
--- /dev/null
+++ b/debian/patches/use-global-build_core.patch
@@ -0,0 +1,15 @@
+Author: Thorsten Alteholz <debian at alteholz.de>
+Description: use gloval scons files
+Index: alljoyn-gateway-1504/SConstruct
+===================================================================
+--- alljoyn-gateway-1504.orig/SConstruct	2016-06-03 12:24:29.000000000 +0200
++++ alljoyn-gateway-1504/SConstruct	2016-06-03 12:50:20.000000000 +0200
+@@ -14,7 +14,7 @@
+ 
+ import os
+ 
+-env = SConscript('../../core/alljoyn/build_core/SConscript')
++env = SConscript('/usr/share/alljoyn/build_core/SConscript')
+ 
+ vars = Variables()
+ vars.Add('BINDINGS', 'Bindings to build (comma separated list): cpp, java', 'cpp,java')
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..a33d824
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,62 @@
+#!/usr/bin/make -f
+# You must remove unused comment lines for the released package.
+#export DH_VERBOSE = 1
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
+export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+export JAVA_HOME=/usr/lib/jvm/default-java
+export CLASSPATH=/usr/share/java/csv.jar:/usr/share/java/debug-disable.jar:/usr/share/java/itext.jar
+export GTEST_DIR=/usr/src/gtest
+
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+HOST_MULTIARCH ?= $(shell gcc -print-multiarch)
+
+CPU=$(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
+# mapping i386 to x86 for Alljoyn
+ifeq ($(CPU),i686) 
+  export CPU = "x86"
+endif
+# we need to check the CPU and do not conflict with
+# the already existing "arm" for cross compiling
+# TODO: check whether this is ok for armel and armhf
+ifeq ($(CPU),arm) 
+  export CPU = "armhf"
+endif
+OS=linux
+
+export VERSION := 15.04
+export SONAME := 1504
+export VARIANT := release
+export SCONS_ARGS := CPU=$(CPU) OS=$(OS) VARIANT=$(VARIANT) V=1 GTEST_DIR=$(GTEST_DIR)
+export BUILD_DIR := $(CURDIR)/build/$(OS)/$(CPU)/$(VARIANT)/dist
+export OBJ_DIR := $(CURDIR)/build/$(OS)/$(CPU)/$(VARIANT)/obj
+export DIST_INCLUDE_DIR := "build/$(OS)/$(CPU)/$(VARIANT)/dist/common/inc"
+export APP_COMMON_DIR := /usr/bin
+
+%:
+	dh $@
+
+override_dh_auto_build:
+	mkdir -p $(DIST_INCLUDE_DIR)
+	cp /usr/include/$(HOST_MULTIARCH)/alljoyn/Status.h $(DIST_INCLUDE_DIR)
+
+	scons BINDINGS=cpp $(SCONS_ARGS) \
+		WS=off BT=off ICE=off 
+	dh_auto_build
+
+override_dh_auto_clean:
+	rm -f .sconsign.dblite
+	rm -rf .sconf_temp
+	touch ./to-be.removed-now.md5
+	find ./* |grep '\.md5'|xargs rm
+	rm -rf build
+	dh_auto_clean
+
+override_dh_installchangelogs:
+	dh_installchangelogs ReleaseNotes.txt
+	dh_installchangelogs 
+
+override_dh_install:
+	dh_install
+#	# improve stuff
+#	chmod 644 debian/alljoyn-services-1504/etc/alljoyn/*.conf
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..30c7d78
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,5 @@
+version=3
+opts="dversionmangle=s/base/alljoyn-services/" \
+https://git.allseenalliance.org/cgit/services/base.git/ /cgit/services/base.git/snapshot/base-(15\.04.*)\.tar\.gz
+
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-iot/alljoyn-gateway-1504.git



More information about the Debian-iot-packaging mailing list