summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2017-06-07 15:19:51 +0200
committerGitHub <noreply@github.com>2017-06-07 15:19:51 +0200
commit714eb879caedcc32674b26fdc7583a6fcfeb4f85 (patch)
treee58fa59771825187d1030be6b2adeb30ac3890f9
parent456b7d066103dba85bc1bcf3cba36d1974aae277 (diff)
parentfbc5ea2207be7c8f3200de6c14ee8729c723c2fb (diff)
Merge pull request #2 from ronan22/master
add packaging
-rw-r--r--README.md17
-rw-r--r--conf.d/.gitignore1
-rw-r--r--conf.d/config.cmake8
-rw-r--r--conf.d/packaging/unicens-agent.spec (renamed from conf.d/packaging/rpm-unicens-agent.spec)19
-rw-r--r--conf.d/templates/cmake/common.cmake7
-rw-r--r--conf.d/templates/rpm/rpm-config.spec.in19
-rw-r--r--packaging/debian.changelog5
-rw-r--r--packaging/debian.compat1
-rw-r--r--packaging/debian.control27
-rw-r--r--packaging/debian.rules80
-rw-r--r--packaging/debian.unicens-agent-bin.install1
-rw-r--r--packaging/unicens-agent.spec54
-rw-r--r--packaging/unicens2-binding.dsc25
-rw-r--r--ucs2-afb/ucs_apihat.h2
-rw-r--r--ucs2-afb/ucs_binding.h2
-rw-r--r--ucs2-interface/ucs-xml/UcsXml.c2
16 files changed, 246 insertions, 24 deletions
diff --git a/README.md b/README.md
index f1cd7b5..2610ed9 100644
--- a/README.md
+++ b/README.md
@@ -16,10 +16,10 @@ AFB_daemon dependency on Standard Linux Distributions
libopenssl-devel libgcrypt-devel libgnutls-devel (optional but requested by libmicrohttpd for https)
OpenSuse >=42.2
- zypper in gcc5 gdb gcc5-c++ git make ElectricFence systemd-devel libopenssl-devel libuuid-devel alsa-devel libgcrypt-devel libgnutls-devel libjson-c-devel file-devel
+ zypper in gcc5 gdb gcc5-c++ git cmake make ElectricFence systemd-devel libopenssl-devel libuuid-devel alsa-devel libgcrypt-devel libgnutls-devel libjson-c-devel file-devel mxml-devel
Ubuntu >= 16.4 libuuid-devel
- apt-get install cmake git electric-fence libsystemd-dev libssl-dev uuid-dev libasound2-dev libgcrypt20-dev libgnutls-dev libgnutls-dev libjson-c-dev libmagic-dev
+ apt-get install cmake git electric-fence libsystemd-dev libssl-dev uuid-dev libasound2-dev libgcrypt20-dev libgnutls-dev libgnutls-dev libjson-c-dev libmagic-dev libmxml-dev
libmicrohttpd>=0.9.54 (as today OpenSuse-42.2 or Ubuntu-.16.4 ship older versions)
afb-daemon from AGL Gerrit git clone https://gerrit.automotivelinux.org/gerrit/src/app-framework-binder
@@ -53,7 +53,7 @@ AFB_daemon dependency on Standard Linux Distributions
git clone https://gerrit.automotivelinux.org/gerrit/src/app-framework-binder
# Warning: previous GCC options should be set before initial cmake (clean Build/*)
- cd app-framework-binder; mkdir build; cd build
+ cd app-framework-binder; mkdir -p build; cd build
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ..
make
make install
@@ -64,7 +64,7 @@ AFB_daemon dependency on Standard Linux Distributions
```
source ~/.bashrc # or any other file where your have place your compilation preferences
- mkdir build
+ mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ..
make
@@ -75,6 +75,15 @@ AFB_daemon dependency on Standard Linux Distributions
firefox http://localhost:1234
```
+# Archive
+
+```
+VERSION=0.1
+GIT_TAG=master
+PKG_NAME=unicens-agent
+git archive --format=tar.gz --prefix=${PKG_NAME}-${VERSION}/ ${GIT_TAG} -o ${PKG_NAME}_${VERSION}.orig.tar.gz
+```
+
# Local Source Debug with GDB
Warning: technically AGL bindings are shared libraries loaded thought 'dlopen'. GDB supports source debug of dynamically
diff --git a/conf.d/.gitignore b/conf.d/.gitignore
new file mode 100644
index 0000000..335ec95
--- /dev/null
+++ b/conf.d/.gitignore
@@ -0,0 +1 @@
+*.tar.gz
diff --git a/conf.d/config.cmake b/conf.d/config.cmake
index 2c5cb12..3e1f637 100644
--- a/conf.d/config.cmake
+++ b/conf.d/config.cmake
@@ -42,11 +42,11 @@ set (gcc_minimal_version 4.9)
# PKG_CONFIG required packages
# -----------------------------
set (PKG_REQUIRED_LIST
- libsystemd>=222
- libmicrohttpd>=0.9.54
+ libsystemd
+ libmicrohttpd
afb-daemon
- json-c
- mxml
+ json-c
+ mxml
)
# LANG Specific compile flags set for all build types
diff --git a/conf.d/packaging/rpm-unicens-agent.spec b/conf.d/packaging/unicens-agent.spec
index 3942fbc..09a1fae 100644
--- a/conf.d/packaging/rpm-unicens-agent.spec
+++ b/conf.d/packaging/unicens-agent.spec
@@ -23,21 +23,30 @@ Release: 1
License: Apache-V2
Summary: Expose MicroChip UnicensV2 through AGL AppFw
Url: https://github.com/iotbzh/unicens-agent
+Source0: %{name}_%{version}.orig.tar.gz
-Provides: unicens-agent
Prefix: /opt/unicens-agent
-BuildRequires: pkg-config , pkgconfig(libsystemd>=222), pkgconfig(libmicrohttpd>=0.9.54), pkgconfig(afb-daemon), pkgconfig(json-c), pkgconfig(mxml)
+BuildRequires: cmake
+BuildRequires: gcc gcc-c++
+BuildRequires: , pkgconfig(libsystemd), pkgconfig(libmicrohttpd), pkgconfig(afb-daemon), pkgconfig(json-c), pkgconfig(mxml)
-BuildRoot:/home/fulup/Workspace/AGL-AppFW/unicens2-binding/build
+BuildRoot:%{_tmppath}/%{name}-%{version}-build
%description
Expose MicroChip UnicensV2 through AGL AppFw
%prep
+%setup -q
%build
-(mkdir -p build; cd build; cmake ..; make)
+%cmake -DBINDINGS_INSTALL_PREFIX:PATH=%{_libdir}
+%__make %{?_smp_mflags}
%install
-(cd build; make populate DESTDIR=%{buildroot})
+[ -d build ] && cd build
+%make_install
+%files
+%defattr(-,root,root)
+%dir %{_prefix}/*
+%{_prefix}/*/*
diff --git a/conf.d/templates/cmake/common.cmake b/conf.d/templates/cmake/common.cmake
index 25a665d..b46e809 100644
--- a/conf.d/templates/cmake/common.cmake
+++ b/conf.d/templates/cmake/common.cmake
@@ -207,11 +207,12 @@ macro(rpm_package_build)
endforeach()
# build rpm spec file from template
- configure_file(${RPM_TEMPLATE_DIR}/rpm-config.spec.in ${SPEC_DIR}/rpm-${PROJECT_NAME}.spec)
+ configure_file(${RPM_TEMPLATE_DIR}/rpm-config.spec.in ${SPEC_DIR}/${PROJECT_NAME}.spec)
add_custom_command(OUTPUT ${PROJECT_NAME}.rpm
DEPENDS ${PROJECT_TARGETS}
- COMMAND rpmbuild -ba ${SPEC_DIR}/rpm-${PROJECT_NAME}.spec
+ COMMAND git --git-dir=${CMAKE_CURRENT_SOURCE_DIR}/.git archive --format=tar.gz --prefix=${PROJECT_NAME}-${PROJECT_VERSION}/ HEAD -o ${SPEC_DIR}/${PROJECT_NAME}_${PROJECT_VERSION}.orig.tar.gz
+ COMMAND rpmbuild --define=\"%_sourcedir ${SPEC_DIR}\" -ba ${SPEC_DIR}/${PROJECT_NAME}.spec
)
add_custom_target(rpm DEPENDS ${PROJECT_NAME}.rpm)
@@ -379,4 +380,4 @@ macro(project_closing_msg)
endmacro()
# Add RSYSTARGET
-remote_targets_populate() \ No newline at end of file
+remote_targets_populate()
diff --git a/conf.d/templates/rpm/rpm-config.spec.in b/conf.d/templates/rpm/rpm-config.spec.in
index dce9c22..950c9d2 100644
--- a/conf.d/templates/rpm/rpm-config.spec.in
+++ b/conf.d/templates/rpm/rpm-config.spec.in
@@ -23,21 +23,30 @@ Release: 1
License: @PROJECT_LICENCE@
Summary: @PROJECT_DESCRIPTION@
Url: @PROJECT_URL@
+Source0: %{name}_%{version}.orig.tar.gz
-Provides: @PROJECT_NAME@
Prefix: /opt/@PROJECT_NAME@
-BuildRequires: pkg-config @RPM_PKG_DEPS@
+BuildRequires: cmake
+BuildRequires: gcc gcc-c++
+BuildRequires: @RPM_PKG_DEPS@
-BuildRoot:@CMAKE_CURRENT_BINARY_DIR@
+BuildRoot:%{_tmppath}/%{name}-%{version}-build
%description
@PROJECT_DESCRIPTION@
%prep
+%setup -q
%build
-(mkdir -p build; cd build; cmake ..; make)
+%cmake -DBINDINGS_INSTALL_PREFIX:PATH=%{_libdir}
+%__make %{?_smp_mflags}
%install
-(cd build; make populate DESTDIR=%{buildroot})
+[ -d build ] && cd build
+%make_install
+%files
+%defattr(-,root,root)
+%dir %{_prefix}/*
+%{_prefix}/*/*
diff --git a/packaging/debian.changelog b/packaging/debian.changelog
new file mode 100644
index 0000000..50bfd63
--- /dev/null
+++ b/packaging/debian.changelog
@@ -0,0 +1,5 @@
+unicens2-binding (0.1-0) unstable; urgency=low
+
+ * init build
+
+ -- Ronan Le Martret <ronan.lemartret@iot.bzh> Mon, 25 Dec 2007 10:50:38 +0100
diff --git a/packaging/debian.compat b/packaging/debian.compat
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/packaging/debian.compat
@@ -0,0 +1 @@
+8
diff --git a/packaging/debian.control b/packaging/debian.control
new file mode 100644
index 0000000..5e52b16
--- /dev/null
+++ b/packaging/debian.control
@@ -0,0 +1,27 @@
+Priority: optional
+Maintainer: Ronan Le Martret <ronan.lemartret@iot.bzh>
+Source: unicens2-binding
+Build-Depends: debhelper (>= 5),
+ libmicrohttpd-dev ,
+ cmake,
+ libsystemd-dev,
+ libssl-dev,
+ gcc,
+ g++,
+ libjson-c-dev,
+ electric-fence,
+ uuid-dev,
+ libasound2-dev,
+ libgcrypt20-dev,
+ libmagic-dev,
+ libmxml-dev,
+ app-framework-binder-bin,
+ app-framework-binder-dev
+Standards-Version: 3.8.2
+Homepage: https://github.com/iotbzh/unicens-agent
+
+Package: unicens2-binding
+Section: libs
+Architecture: any
+Depends: electric-fence
+Description: unicens2-binding
diff --git a/packaging/debian.rules b/packaging/debian.rules
new file mode 100644
index 0000000..a8a7ba9
--- /dev/null
+++ b/packaging/debian.rules
@@ -0,0 +1,80 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+else
+ CFLAGS += -O2
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+ INSTALL_PROGRAM += -s
+endif
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ #
+ touch configure-stamp
+
+build: build-stamp
+build-stamp: configure-stamp
+ dh_testdir
+ mkdir -p build
+ cd build;cmake ../ -DBINDINGS_INSTALL_PREFIX:PATH=/usr/lib;$(MAKE)
+ #
+ touch build-stamp
+
+clean:
+ #dh_testdir
+ dh_testroot
+ rm -f configure-stamp build-stamp
+ [ ! -f Makefile ] || $(MAKE) distclean
+ #dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_prep
+ dh_installdirs
+ # Add here commands to install the package into debian/tmp
+ cd build;make install DESTDIR=/usr/src/packages/BUILD/debian/tmp
+ # Move all files in their corresponding package
+ dh_install --list-missing -s --sourcedir=debian/tmp
+ # empty dependency_libs in .la files
+ #sed -i "/dependency_libs/ s/'.*'/''/" `find debian/ -name '*.la'`
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+ dh_installman
+ dh_link
+ #dh_strip
+ dh_compress
+ dh_fixperms
+ dh_makeshlibs -V
+ #dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
diff --git a/packaging/debian.unicens-agent-bin.install b/packaging/debian.unicens-agent-bin.install
new file mode 100644
index 0000000..0f6fe5c
--- /dev/null
+++ b/packaging/debian.unicens-agent-bin.install
@@ -0,0 +1 @@
+/usr/lib/unicens-agent/afb-ucs2.so
diff --git a/packaging/unicens-agent.spec b/packaging/unicens-agent.spec
new file mode 100644
index 0000000..fa0f5a0
--- /dev/null
+++ b/packaging/unicens-agent.spec
@@ -0,0 +1,54 @@
+###########################################################################
+# Copyright 2015, 2016, 2017 IoT.bzh
+#
+# author: Fulup Ar Foll <fulup@iot.bzh>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###########################################################################
+
+
+Name: unicens-agent
+Version: 0.1
+Release: 1
+License: Apache-V2
+Summary: Expose MicroChip UnicensV2 through AGL AppFw
+Url: https://github.com/iotbzh/unicens-agent
+Source0: %{name}_%{version}.orig.tar.gz
+
+Prefix: /opt/unicens-agent
+BuildRequires: cmake
+BuildRequires: gcc gcc-c++
+BuildRequires: pkgconfig(libsystemd) >= 222,
+BuildRequires: pkgconfig(libmicrohttpd) >= 0.9.54
+BuildRequires: pkgconfig(afb-daemon), pkgconfig(json-c), pkgconfig(mxml)
+
+BuildRoot:%{_tmppath}/%{name}-%{version}-build
+
+%description
+Expose MicroChip UnicensV2 through AGL AppFw
+
+%prep
+%setup -q
+
+%build
+%cmake -DBINDINGS_INSTALL_PREFIX:PATH=%{_libdir}
+%__make %{?_smp_mflags}
+
+%install
+[ -d build ] && cd build
+%make_install
+
+%files
+%defattr(-,root,root)
+%dir %{_libdir}/unicens-agent
+%{_libdir}/unicens-agent/afb-ucs2.so
diff --git a/packaging/unicens2-binding.dsc b/packaging/unicens2-binding.dsc
new file mode 100644
index 0000000..16f31ee
--- /dev/null
+++ b/packaging/unicens2-binding.dsc
@@ -0,0 +1,25 @@
+Format: 0.1
+Source: unicens-agent
+Binary: unicens-agent-bin
+Architecture: any
+Version: 2.0-0
+Maintainer: Ronan Le Martret <ronan.lemartret@iot.bzh>
+Standards-Version: 3.8.2
+Homepage: https://github.com/iotbzh/unicens-agent
+Build-Depends: debhelper (>= 5),
+ libmicrohttpd-dev ,
+ cmake,
+ libsystemd-dev,
+ libssl-dev,
+ gcc,
+ g++,
+ libjson-c-dev,
+ electric-fence,
+ uuid-dev,
+ libasound2-dev,
+ libgcrypt20-dev,
+ libmagic-dev,
+ libmxml-dev,
+ app-framework-binder-bin,
+ app-framework-binder-dev
+Debtransform-Tar: unicens-agent_0.1.orig.tar.gz
diff --git a/ucs2-afb/ucs_apihat.h b/ucs2-afb/ucs_apihat.h
index 8926344..c0f8042 100644
--- a/ucs2-afb/ucs_apihat.h
+++ b/ucs2-afb/ucs_apihat.h
@@ -25,7 +25,7 @@
#include <json-c/json.h>
#include <afb/afb-binding.h>
-#include <afb/afb-service-itf.h>
+#include <afb/afb-service-v2.h>
#include "ucs_interface.h"
diff --git a/ucs2-afb/ucs_binding.h b/ucs2-afb/ucs_binding.h
index 5b74730..3d18260 100644
--- a/ucs2-afb/ucs_binding.h
+++ b/ucs2-afb/ucs_binding.h
@@ -25,7 +25,7 @@
#include <json-c/json.h>
#include <afb/afb-binding.h>
-#include <afb/afb-service-itf.h>
+#include <afb/afb-service-v2.h>
#include "ucs_interface.h"
diff --git a/ucs2-interface/ucs-xml/UcsXml.c b/ucs2-interface/ucs-xml/UcsXml.c
index cd7c477..9a7a6fc 100644
--- a/ucs2-interface/ucs-xml/UcsXml.c
+++ b/ucs2-interface/ucs-xml/UcsXml.c
@@ -211,7 +211,7 @@ static ParseResult_t ParseRoutes(UcsXmlVal_t *v, PrivateData_t *vp);
UcsXmlVal_t *UcsXml_Parse(const char *xmlString)
{
- UcsXmlVal_t *v;
+ UcsXmlVal_t *v = NULL;
ParseResult_t result = Parse_Success;
mxml_node_t *tree = mxmlLoadString(NULL, xmlString, MXML_NO_CALLBACK);
if (!tree)