From 99914a58a2d5b2638e2c1fdac5ca74a2d247e6fa Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 7 Nov 2018 10:54:01 +0100 Subject: First simple platform-info API implementation Bug-AGL: SPEC-1917 Change-Id: I300155302c9d69c6549ddabc6af53e2ad55eb18d Signed-off-by: Romain Forlot --- conf.d/cmake/config.cmake | 208 +++++++++++++++++++++ conf.d/packaging/deb/agl-service-platform-info.dsc | 18 ++ .../deb/debian.agl-service-platform-info.install | 1 + conf.d/packaging/deb/debian.changelog | 5 + conf.d/packaging/deb/debian.compat | 1 + conf.d/packaging/deb/debian.control | 19 ++ conf.d/packaging/deb/debian.rules | 14 ++ .../packaging/rpm/agl-service-platform-info.spec | 66 +++++++ conf.d/wgt/config.xml.in | 15 ++ 9 files changed, 347 insertions(+) create mode 100644 conf.d/cmake/config.cmake create mode 100644 conf.d/packaging/deb/agl-service-platform-info.dsc create mode 100644 conf.d/packaging/deb/debian.agl-service-platform-info.install create mode 100644 conf.d/packaging/deb/debian.changelog create mode 100644 conf.d/packaging/deb/debian.compat create mode 100644 conf.d/packaging/deb/debian.control create mode 100644 conf.d/packaging/deb/debian.rules create mode 100644 conf.d/packaging/rpm/agl-service-platform-info.spec create mode 100644 conf.d/wgt/config.xml.in (limited to 'conf.d') diff --git a/conf.d/cmake/config.cmake b/conf.d/cmake/config.cmake new file mode 100644 index 0000000..d57b4aa --- /dev/null +++ b/conf.d/cmake/config.cmake @@ -0,0 +1,208 @@ +########################################################################### +# Copyright 2015, 2016, 2018 IoT.bzh +# +# author: Fulup Ar Foll +# +# 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 "Platform-info_binding") +set(PROJECT_VERSION 6.90) +set(API_NAME platform-info) +set(PROJECT_PRETTY_NAME "Platform Information provider binding") +set(PROJECT_DESCRIPTION "A binding meant to provide system, platform, build information for others bindings and apps") +set(PROJECT_URL "https://github.com/iotbzh/agl-service-platform-info") +set(PROJECT_ICON "icon.png") +set(PROJECT_AUTHOR "Forlot, Romain") +set(PROJECT_AUTHOR_MAIL "romain.forlot@iot.bzh") +set(PROJECT_LICENSE "APL2.0") +set(PROJECT_LANGUAGES "C") + +# Which directories inspect to find CMakeLists.txt target files +# set(PROJECT_SRC_DIR_PATTERN "*") + +# Where are stored the project configuration files +# relative to the root project directory +set(PROJECT_CMAKE_CONF_DIR "conf.d") + +# Compilation Mode (DEBUG, RELEASE, COVERAGE or PROFILING) +# ---------------------------------- +#set(BUILD_TYPE "DEBUG") +#set(USE_EFENCE 1) + +# 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>=0.12 + afb-daemon +) + +# You can also consider to include libsystemd +# ----------------------------------- +#list (APPEND PKG_REQUIRED_LIST libsystemd>=222) + +# Prefix path where will be installed the files +# Default: /usr/local (need root permission to write in) +# ------------------------------------------------------ +#set(INSTALL_PREFIX /opt/AGL CACHE PATH "INSTALL PREFIX PATH") + +# 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 +# CACHE STRING "Compilation flags for DEBUG build type.") +#set(COVERAGE_COMPILE_OPTIONS +# -g +# -O0 +# --coverage +# CACHE STRING "Compilation flags for COVERAGE build type.") +#set(RELEASE_COMPILE_OPTIONS +# -O2 +# -pipe +# -D_FORTIFY_SOURCE=2 +# -fstack-protector-strong +# -Wformat -Wformat-security +# -Werror=format-security +# -feliminate-unused-debug-types +# -Wl,-O1 +# -Wl,--hash-style=gnu +# -Wl,--as-needed +# -fstack-protector-strong +# -Wl,-z,relro,-z,now +# CACHE STRING "Compilation flags for RELEASE build type.") + +add_definitions(-DAFB_BINDING_VERSION=3) + +# Location for config.xml.in template file. +# +# If you keep them commented then it will build with a default minimal widget +# template which is very simple and it is highly probable that it will not suit +# to your app. +# ----------------------------------------- +#set(WIDGET_ICON "conf.d/wgt/${PROJECT_ICON}" CACHE PATH "Path to the widget icon") +#set(WIDGET_CONFIG_TEMPLATE "${CMAKE_CURRENT_SOURCE_DIR}/conf.d/wgt/config.xml.in" CACHE PATH "Path to widget config file template (config.xml.in)") +#set(TEST_WIDGET_CONFIG_TEMPLATE "${CMAKE_CURRENT_SOURCE_DIR}/conf.d/wgt/test-config.xml.in" CACHE PATH "Path to the test widget config file template (test-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 "lib/afb-platform-info.so") + +# 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 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 binder security token") +set(AFB_REMPORT "1234" CACHE PATH "Default binder listening port") + +# Print a helper message when every thing is finished +# ---------------------------------------------------- +set(CLOSING_MESSAGE "Typical binding launch: cd ${CMAKE_BINARY_DIR}/package \\&\\& afb-daemon --port=${AFB_REMPORT} --workdir=. --ldpaths=lib --roothttp=htdocs --token=\"${AFB_TOKEN}\" --tracereq=common --verbose") +set(PACKAGE_MESSAGE "Install widget file using in the target : afm-util install ${PROJECT_NAME}.wgt") + +# Optional schema validator about now only XML, LUA and JSON +# are supported +#------------------------------------------------------------ +#set(LUA_CHECKER "luac" "-p" CACHE STRING "LUA compiler") +#set(XML_CHECKER "xmllint" CACHE STRING "XML linter") +#set(JSON_CHECKER "json_verify" CACHE STRING "JSON linter") + +include(CMakeAfbTemplates) diff --git a/conf.d/packaging/deb/agl-service-platform-info.dsc b/conf.d/packaging/deb/agl-service-platform-info.dsc new file mode 100644 index 0000000..0c603de --- /dev/null +++ b/conf.d/packaging/deb/agl-service-platform-info.dsc @@ -0,0 +1,18 @@ +Format: 1.0 +Source: agl-service-os-info +Binary: agl-service-os-info-bin +Architecture: any +Version: 2.0-0 +Maintainer: Iot-Team +Standards-Version: 3.8.2 +Homepage: https://github.com/iotbzh/agl-service-os-info +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-service-os-info_1.0.orig.tar.gz diff --git a/conf.d/packaging/deb/debian.agl-service-platform-info.install b/conf.d/packaging/deb/debian.agl-service-platform-info.install new file mode 100644 index 0000000..6399692 --- /dev/null +++ b/conf.d/packaging/deb/debian.agl-service-platform-info.install @@ -0,0 +1 @@ +/opt/AGL/* diff --git a/conf.d/packaging/deb/debian.changelog b/conf.d/packaging/deb/debian.changelog new file mode 100644 index 0000000..de0a835 --- /dev/null +++ b/conf.d/packaging/deb/debian.changelog @@ -0,0 +1,5 @@ +agl-service-os-info (1.0-0) UNRELEASED; urgency=low + + * init build + + -- Iot-Team Wed, 7 Nov 2018 10:50:38 +0100 diff --git a/conf.d/packaging/deb/debian.compat b/conf.d/packaging/deb/debian.compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/conf.d/packaging/deb/debian.compat @@ -0,0 +1 @@ +9 diff --git a/conf.d/packaging/deb/debian.control b/conf.d/packaging/deb/debian.control new file mode 100644 index 0000000..4eb8b99 --- /dev/null +++ b/conf.d/packaging/deb/debian.control @@ -0,0 +1,19 @@ +Priority: optional +Maintainer: Iot-Team +Source: agl-service-os-info +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/agl-service-os-info + +Package: agl-service-os-info +Section: libs +Architecture: any +Description: Provide an AGL OS information Binding diff --git a/conf.d/packaging/deb/debian.rules b/conf.d/packaging/deb/debian.rules new file mode 100644 index 0000000..5bc5fc2 --- /dev/null +++ b/conf.d/packaging/deb/debian.rules @@ -0,0 +1,14 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + bash /etc/profile.d/AGL-app-framework-binder.sh + dh $@ + +override_dh_auto_configure: + dh_auto_configure -- -DCMAKE_INSTALL_PREFIX=/opt/AGL/afm/applications/ + +override_dh_auto_install: + dh_auto_install --destdir=/usr/src/packages/BUILD/debian/tmp diff --git a/conf.d/packaging/rpm/agl-service-platform-info.spec b/conf.d/packaging/rpm/agl-service-platform-info.spec new file mode 100644 index 0000000..d495571 --- /dev/null +++ b/conf.d/packaging/rpm/agl-service-platform-info.spec @@ -0,0 +1,66 @@ +########################################################################### +# Copyright 2015, 2016, 2017 IoT.bzh +# +# author: Iot-Team +# +# 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/wgt/config.xml.in b/conf.d/wgt/config.xml.in new file mode 100644 index 0000000..9cd3c30 --- /dev/null +++ b/conf.d/wgt/config.xml.in @@ -0,0 +1,15 @@ + + + @PROJECT_NAME@ + + + @PROJECT_DESCRIPTION@ + @PROJECT_AUTHOR@ <@PROJECT_AUTHOR_MAIL@> + @PROJECT_LICENSE@ + + + + + + + -- cgit 1.2.3-korg