diff options
Diffstat (limited to 'conf.d')
-rw-r--r-- | conf.d/cmake/config.cmake | 183 | ||||
-rw-r--r-- | conf.d/packaging/agl-helloworld-service.dsc | 18 | ||||
-rw-r--r-- | conf.d/packaging/agl-helloworld-service.spec | 66 | ||||
-rw-r--r-- | conf.d/packaging/debian.agl-helloworld-service.install | 2 | ||||
-rw-r--r-- | conf.d/packaging/debian.changelog | 5 | ||||
-rw-r--r-- | conf.d/packaging/debian.compat | 1 | ||||
-rw-r--r-- | conf.d/packaging/debian.control | 19 | ||||
-rw-r--r-- | conf.d/packaging/debian.rules | 87 | ||||
-rw-r--r-- | conf.d/wgt/config.xml.in | 15 |
9 files changed, 396 insertions, 0 deletions
diff --git a/conf.d/cmake/config.cmake b/conf.d/cmake/config.cmake new file mode 100644 index 0000000..44690c5 --- /dev/null +++ b/conf.d/cmake/config.cmake @@ -0,0 +1,183 @@ +########################################################################### +# Copyright 2015-2019 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. +########################################################################### + +# Project Info +# ------------------ +set(PROJECT_NAME agl-service-helloworld) +set(PROJECT_VERSION "1.0") +set(PROJECT_PRETTY_NAME "Helloworld for AGL") +set(PROJECT_DESCRIPTION "Provide an AGL Helloworld Binding") +set(PROJECT_URL "https://gerrit.automotivelinux.org/gerrit/admin/repos/apps/agl-service-helloworld") +set(PROJECT_ICON "icon.png") +set(PROJECT_AUTHOR "Iot-Team") +set(PROJECT_AUTHOR_MAIL "frederic.marec@iot.bzh") +set(PROJECT_LICENSE "APL2.0") +set(PROJECT_LANGUAGES,"C") +set(API_NAME "helloworld") + +# Where are stored default templates files from submodule or subtree app-templates in your project tree +# relative to the root project directory +set(PROJECT_CMAKE_CONF_DIR "conf.d/cmake") + +# Where are stored your external libraries for your project. This is 3rd party library that you don't maintain +# but used and must be built and linked. +# set(PROJECT_LIBDIR "libs") + +# Where are stored data for your application. Pictures, static resources must be placed in that folder. +# set(PROJECT_RESOURCES "data") + +# Which directories inspect to find CMakeLists.txt target files +# set(PROJECT_SRC_DIR_PATTERN "*") + +# Compilation Mode (DEBUG, RELEASE) +# ---------------------------------- +set(BUILD_TYPE "RELEASE") + +# Kernel selection if needed. You can choose between a +# mandatory version to impose a minimal version. +# Or check Kernel minimal version and just print a Warning +# about missing features and define a preprocessor variable +# to be used as preprocessor condition in code to disable +# incompatibles features. Preprocessor define is named +# KERNEL_MINIMAL_VERSION_OK. +# +# NOTE*** FOR NOW IT CHECKS KERNEL Yocto environment and +# Yocto SDK Kernel version. +# ----------------------------------------------- +#set (kernel_mandatory_version 4.8) +#set (kernel_minimal_version 4.8) + +# Compiler selection if needed. Impose a minimal version. +# ----------------------------------------------- +set (gcc_minimal_version 4.9) + +# PKG_CONFIG required packages +# ----------------------------- +set (PKG_REQUIRED_LIST + json-c + afb-daemon +) + + +# Print a helper message when every thing is finished +# ---------------------------------------------------- +if(IS_DIRECTORY $ENV{HOME}/opt/afb-monitoring) +set(MONITORING_ALIAS "--alias=/monitoring:$ENV{HOME}/opt/afb-monitoring") +endif() +set(CLOSING_MESSAGE "Debug from afb-daemon --port=1234 ${MONITORING_ALIAS} --ldpaths=package --workdir=. --roothttp=../htdocs --token= --verbose ") +set(PACKAGE_MESSAGE "Install widget file using in the target : afm-util install ${PROJECT_NAME}.wgt") + +# Customize link option +# ----------------------------- +#list(APPEND link_libraries -an-option) + +# Compilation options definition +# Use CMake generator expressions to specify only for a specific language +# Values are prefilled with default options that is currently used. +# Either separate options with ";", or each options must be quoted separately +# DO NOT PUT ALL OPTION QUOTED AT ONCE , COMPILATION COULD FAILED ! +# ---------------------------------------------------------------------------- +#set(COMPILE_OPTIONS "-Wall" "-Wextra" "-Wconversion" "-Wno-unused-parameter" "-Wno-sign-compare" "-Wno-sign-conversion" "-Werror=maybe-uninitialized" "-Werror=implicit-function-declaration" "-ffunction-sections" "-fdata-sections" "-fPIC" CACHE STRING "Compilation flags") +#set(C_COMPILE_OPTIONS "" CACHE STRING "Compilation flags for C language.") +#set(CXX_COMPILE_OPTIONS "" CACHE STRING "Compilation flags for C++ language.") +#set(PROFILING_COMPILE_OPTIONS "-g" "-O0" "-pg" "-Wp,-U_FORTIFY_SOURCE" CACHE STRING "Compilation flags for PROFILING build type.") +#set(DEBUG_COMPILE_OPTIONS "-g" "-ggdb" "-Wp,-U_FORTIFY_SOURCE" CACHE STRING "Compilation flags for DEBUG build type.") +#set(CCOV_COMPILE_OPTIONS "-g" "-O2" "--coverage" CACHE STRING "Compilation flags for CCOV build type.") +#set(RELEASE_COMPILE_OPTIONS "-g" "-O2" CACHE STRING "Compilation flags for RELEASE build type.") + +# Print a helper message when every thing is finished +# ---------------------------------------------------- +#set(CLOSING_MESSAGE "") +#set(PACKAGE_MESSAGE "Install widget file using in the target : afm-util install ${PROJECT_NAME}.wgt") + +# (BUG!!!) as PKG_CONFIG_PATH does not work [should be an env variable] +# --------------------------------------------------------------------- +set(INSTALL_PREFIX $ENV{HOME}/opt) +set(CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}/lib64/pkgconfig ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) +set(LD_LIBRARY_PATH ${CMAKE_INSTALL_PREFIX}/lib64 ${CMAKE_INSTALL_PREFIX}/lib) + +# Optional location for config.xml.in +# ----------------------------------- +set(WIDGET_ICON ${PROJECT_APP_TEMPLATES_DIR}/wgt/${PROJECT_ICON}) +set(WIDGET_CONFIG_TEMPLATE ${CMAKE_SOURCE_DIR}/conf.d/wgt/config.xml.in CACHE PATH "Path to widget config file template (config.xml.in)") + +# Mandatory widget Mimetype specification of the main unit +# -------------------------------------------------------------------------- +# Choose between : +#- text/html : HTML application, +# content.src designates the home page of the application +# +#- application/vnd.agl.native : AGL compatible native, +# content.src designates the relative path of the binary. +# +# - application/vnd.agl.service: AGL service, content.src is not used. +# +#- ***application/x-executable***: Native application, +# content.src designates the relative path of the binary. +# For such application, only security setup is made. +# +set(WIDGET_TYPE application/vnd.agl.service) + +# Mandatory Widget entry point file of the main unit +# -------------------------------------------------------------- +# This is the file that will be executed, loaded, +# at launch time by the application framework. +# +set(WIDGET_ENTRY_POINT config.xml) + +# Optional dependencies order +# --------------------------- +#set(EXTRA_DEPENDENCIES_ORDER) + +# Optional Extra global include path +# ----------------------------------- +#set(EXTRA_INCLUDE_DIRS) + +# Optional extra libraries +# ------------------------- +#set(EXTRA_LINK_LIBRARIES) + +# Optional force binding installation +# ------------------------------------ +# set(BINDINGS_INSTALL_PREFIX PrefixPath ) + +# Optional force binding Linking flag +# ------------------------------------ +# set(BINDINGS_LINK_FLAG LinkOptions ) + +# Optional force package prefix generation, like widget +# ----------------------------------------------------- +# set(PKG_PREFIX DestinationPath) + +# Optional Application Framework security token +# and port use for remote debugging. +#------------------------------------------------------------ +#set(AFB_TOKEN "" CACHE PATH "Default AFB_TOKEN") +#set(AFB_REMPORT "1234" CACHE PATH "Default AFB_TOKEN") + +# Optional schema validator about now only XML, LUA and JSON +# are supported +#------------------------------------------------------------ +#set(LUA_CHECKER "luac" CACHE STRING "LUA compiler") +#set(XML_CHECKER "xmllint" CACHE STRING "XML linter") +#set(JSON_CHECKER "json_verify" CACHE STRING "JSON linter") + +# This include is mandatory and MUST happens at the end +# of this file, else you expose you to unexpected behavior +# ----------------------------------------------------------- +include(CMakeAfbTemplates) diff --git a/conf.d/packaging/agl-helloworld-service.dsc b/conf.d/packaging/agl-helloworld-service.dsc new file mode 100644 index 0000000..d883851 --- /dev/null +++ b/conf.d/packaging/agl-helloworld-service.dsc @@ -0,0 +1,18 @@ +Format: 1.0 +Source: agl-helloworld-service +Binary: agl-helloworld-service-bin +Architecture: any +Version: 2.0-0 +Maintainer: Iot-Team <secretaria@iot.bzh> +Standards-Version: 3.8.2 +Homepage: https://github.com/iotbzh/helloworld-service +Build-Depends: debhelper (>= 5), + pkg-config, + cmake, + gcc, + g++, + libjson-c-dev , + libsystemd-dev (>= 222), + agl-app-framework-binder-dev , + agl-libmicrohttpd-dev (>= 0.9.55) +Debtransform-Tar: agl-helloworld-service_1.0.orig.tar.gz diff --git a/conf.d/packaging/agl-helloworld-service.spec b/conf.d/packaging/agl-helloworld-service.spec new file mode 100644 index 0000000..d495571 --- /dev/null +++ b/conf.d/packaging/agl-helloworld-service.spec @@ -0,0 +1,66 @@ +########################################################################### +# Copyright 2015, 2016, 2017 IoT.bzh +# +# author: Iot-Team <secretaria@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: agl-helloworld-service +Version: 1.0 +Release: 1 +Group: AGL +License: APL2.0 +Summary: Provide an AGL Helloworld Binding +Url: https://github.com/iotbzh/helloworld-service +Source0: %{name}_%{version}.orig.tar.gz + +BuildRequires: cmake +BuildRequires: gcc gcc-c++ +BuildRequires: pkgconfig(json-c) +BuildRequires: pkgconfig(libsystemd) >= 222 +BuildRequires: pkgconfig(afb-daemon) +BuildRequires: pkgconfig(libmicrohttpd) >= 0.9.55 + + +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%define _prefix /opt/AGL/helloworld-service +%define __cmake cmake + +%description +Provide an AGL Helloworld Binding + +%prep +%setup -q + +%build +%cmake -DCMAKE_INSTALL_PREFIX:PATH=%{_libdir} +make %{?_smp_mflags} + +%install +CURDIR=$(pwd) +[ -d build ] && cd build +make populate +mkdir -p %{?buildroot}%{_prefix} +cp -r package/* %{?buildroot}%{_prefix} + +cd $CURDIR +find %{?buildroot}%{_prefix} -type d -exec echo "%dir {}" \;>> pkg_file +find %{?buildroot}%{_prefix} -type f -exec echo "{}" \;>> pkg_file +sed -i 's@%{?buildroot}@@g' pkg_file + + +%files -f pkg_file +%defattr(-,root,root) diff --git a/conf.d/packaging/debian.agl-helloworld-service.install b/conf.d/packaging/debian.agl-helloworld-service.install new file mode 100644 index 0000000..5858efd --- /dev/null +++ b/conf.d/packaging/debian.agl-helloworld-service.install @@ -0,0 +1,2 @@ +/opt/AGL/* +/etc/profile.d/* diff --git a/conf.d/packaging/debian.changelog b/conf.d/packaging/debian.changelog new file mode 100644 index 0000000..d668686 --- /dev/null +++ b/conf.d/packaging/debian.changelog @@ -0,0 +1,5 @@ +agl-helloworld-service (1.0-0) UNRELEASED; urgency=low + + * init build + + -- Iot-Team <secretaria@iot.bzh> Mon, 25 Dec 2007 10:50:38 +0100 diff --git a/conf.d/packaging/debian.compat b/conf.d/packaging/debian.compat new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/conf.d/packaging/debian.compat @@ -0,0 +1 @@ +8 diff --git a/conf.d/packaging/debian.control b/conf.d/packaging/debian.control new file mode 100644 index 0000000..31461d6 --- /dev/null +++ b/conf.d/packaging/debian.control @@ -0,0 +1,19 @@ +Priority: optional +Maintainer: Iot-Team <secretaria@iot.bzh> +Source: agl-helloworld-service +Build-Depends: debhelper (>= 5), + pkg-config, + cmake, + gcc, + g++, + libjson-c-dev , + libsystemd-dev (>= 222), + agl-app-framework-binder-dev , + agl-libmicrohttpd-dev (>= 0.9.55) +Standards-Version: 3.8.2 +Homepage: https://github.com/iotbzh/helloworld-service + +Package: agl-helloworld-service +Section: libs +Architecture: any +Description: Provide an AGL Helloworld Binding diff --git a/conf.d/packaging/debian.rules b/conf.d/packaging/debian.rules new file mode 100644 index 0000000..fd8a335 --- /dev/null +++ b/conf.d/packaging/debian.rules @@ -0,0 +1,87 @@ +#!/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 ../ -DCMAKE_INSTALL_PREFIX:PATH=/opt/AGL/helloworld-service -DCMAKE_INSTALL_LIBDIR:PATH=lib/$(DEB_HOST_MULTIARCH);$(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 + mkdir -p debian/tmp/opt/AGL/helloworld-service;cd build;make populate;cp -r package/* ../debian/tmp/opt/AGL/helloworld-service/ + mkdir -p debian/tmp/etc/profile.d + echo '#---------- AGL helloworld-service options Start ---------" ' > debian/tmp/etc/profile.d/AGL_helloworld-service.sh + echo '# Object: AGL cmake option for binder/bindings' >> debian/tmp/etc/profile.d/AGL_helloworld-service.sh + echo 'export LD_LIBRARY_PATH=/opt/AGL/helloworld-service/lib/$(DEB_HOST_MULTIARCH):$$LD_LIBRARY_PATH' >> debian/tmp/etc/profile.d/AGL_helloworld-service.sh + echo 'export LIBRARY_PATH=/opt/AGL/helloworld-service/lib/$(DEB_HOST_MULTIARCH):$$LIBRARY_PATH' >> debian/tmp/etc/profile.d/AGL_helloworld-service.sh + echo 'export PATH=/opt/AGL/helloworld-service/bin:$$PATH' >> debian/tmp/etc/profile.d/AGL_helloworld-service.sh + echo '#---------- AGL options End ---------' >> debian/tmp/etc/profile.d/AGL_helloworld-service.sh + # 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 --dpkg-shlibdeps-params=--ignore-missing-info + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install diff --git a/conf.d/wgt/config.xml.in b/conf.d/wgt/config.xml.in new file mode 100644 index 0000000..fc31b9b --- /dev/null +++ b/conf.d/wgt/config.xml.in @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<widget xmlns="http://www.w3.org/ns/widgets" id="@PROJECT_NAME@" version="@PROJECT_VERSION@"> + <name>@PROJECT_NAME@</name> + <icon src="@PROJECT_ICON@"/> + <content src="@WIDGET_ENTRY_POINT@" type="@WIDGET_TYPE@"/> + <description>@PROJECT_DESCRIPTION@</description> + <author>@PROJECT_AUTHOR@ <@PROJECT_AUTHOR_MAIL@></author> + <license>@PROJECT_LICENSE@</license> + <feature name="urn:AGL:widget:provided-api"> + <param name="helloworld" value="ws" /> + </feature> + <feature name="urn:AGL:widget:required-api"> + <param name="lib/afb-helloworld-skeleton.so" value="local" /> + </feature> +</widget> |