aboutsummaryrefslogtreecommitdiffstats
path: root/conf.d
diff options
context:
space:
mode:
Diffstat (limited to 'conf.d')
-rw-r--r--conf.d/config.cmake114
-rw-r--r--conf.d/openapi-schema.json764
-rw-r--r--conf.d/packaging/rpm-.spec43
-rw-r--r--conf.d/packaging/rpm-unicens-agent.spec43
-rw-r--r--conf.d/templates/cmake/common.cmake382
-rw-r--r--conf.d/templates/cmake/export.map1
-rw-r--r--conf.d/templates/gdb/gdb-on-target.in13
-rw-r--r--conf.d/templates/rpm/rpm-config.spec.in43
-rw-r--r--conf.d/templates/ssh/start-on-target.in25
-rw-r--r--conf.d/wgt/config.xml.in11
-rw-r--r--conf.d/wgt/icon.png.inbin0 -> 13273 bytes
11 files changed, 1439 insertions, 0 deletions
diff --git a/conf.d/config.cmake b/conf.d/config.cmake
new file mode 100644
index 0000000..c4d9cf6
--- /dev/null
+++ b/conf.d/config.cmake
@@ -0,0 +1,114 @@
+###########################################################################
+# 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.
+###########################################################################
+
+# Project Info
+# ------------------
+set(PROJECT_NAME unicens-agent)
+set(PROJECT_VERSION "0.1")
+set(PROJECT_PRETTY_NAME "Unicens Agent")
+set(PROJECT_DESCRIPTION "Expose MicroChip UnicensV2 through AGL AppFw")
+set(PROJECT_URL "https://github.com/iotbzh/unicens-agent")
+set(PROJECT_ICON "icon.png")
+set(PROJECT_AUTHOR "Fulup, Ar Foll")
+set(PROJECT_AUTHOR_MAIL "fulup@iot.bzh")
+set(PROJECT_LICENCE "Apache-V2")
+set(PROJECT_LANGUAGES,"C")
+
+# Compilation Mode (DEBUG, RELEASE)
+# ----------------------------------
+set(CMAKE_BUILD_TYPE "DEBUG")
+
+# Compiler selection if needed. Overload the detected compiler.
+# -----------------------------------------------
+set (gcc_minimal_version 4.9)
+#set(CMAKE_C_COMPILER "gcc")
+#set(CMAKE_CXX_COMPILER "g++")
+
+# PKG_CONFIG required packages
+# -----------------------------
+set (PKG_REQUIRED_LIST
+ libsystemd>=222
+ libmicrohttpd>=0.9.54
+ afb-daemon
+ json-c
+ mxml
+)
+
+# LANG Specific compile flags set for all build types
+set(CMAKE_C_FLAGS "")
+set(CMAKE_CXX_FLAGS "")
+
+# Define CONTROL_CDEV_NAME should match MOST driver values
+# ---------------------------------------------------------
+ add_compile_options(-DCONTROL_CDEV_TX="/dev/inic-usb-ctx")
+ add_compile_options(-DCONTROL_CDEV_RX="/dev/inic-usb-crx")
+
+# Print a helper message when every thing is finished
+# ----------------------------------------------------
+set(CLOSING_MESSAGE "Test with: afb-daemon --ldpaths=. --port=1234 --workdir=.. --roothttp=./htdocs --tracereq=common --token='' --verbose")
+
+# (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 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 widget prefix generation
+# ------------------------------------------------
+# set(WIDGET_PREFIX DestinationPath)
+
+# Optional Widget entry point file.
+# ---------------------------------------------------------
+# This is the file that will be executed, loaded,...
+# at launch time by the application framework
+
+# set(WIDGET_ENTRY_POINT EntryPoint_Path)
+
+# Optional Widget Mimetype specification
+# --------------------------------------------------
+# Choose between :
+# - application/x-executable
+# - application/vnd.agl.url
+# - application/vnd.agl.service
+# - application/vnd.agl.native
+# - text/vnd.qt.qml
+# - application/vnd.agl.qml
+# - application/vnd.agl.qml.hybrid
+# - application/vnd.agl.html.hybrid
+#
+# set(WIDGET_TYPE MimeType)
+
+# Optional force binding Linking flag
+# ------------------------------------
+# set(BINDINGS_LINK_FLAG LinkOptions )
diff --git a/conf.d/openapi-schema.json b/conf.d/openapi-schema.json
new file mode 100644
index 0000000..6629c7c
--- /dev/null
+++ b/conf.d/openapi-schema.json
@@ -0,0 +1,764 @@
+{
+ "title": "A JSON Schema for OpenApi 3.0 API.",
+ "id": "http://www.openapis.org/v3/schema.json#",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "required": [
+ "openapi",
+ "info",
+ "paths"
+ ],
+ "additionalProperties": false,
+ "patternProperties": {
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "openapi": {
+ "type": "string",
+ "enum": [
+ "3.0.0"
+ ],
+ "description": "Specifies the OpenAPI Specification version being used. It can be used by tooling Specifications and clients to interpret the version. The structure shall be major.minor.patch, where patch versions must be compatible with the existing major.minor tooling. Typically patch versions will be introduced to address errors in the documentation, and tooling should typically be compatible with the corresponding major.minor (3.0.*). Patch versions will correspond to patches of this document."
+ },
+ "info": {
+ "$ref": "#/definitions/info"
+ },
+ "servers": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/server"
+ },
+ "uniqueItems": true
+ },
+ "paths": {
+ "$ref": "#/definitions/paths"
+ },
+ "components": {
+ "$ref": "#/definitions/components"
+ },
+ "security": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/securityRequirement"
+ },
+ "uniqueItems": true
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/tag"
+ },
+ "uniqueItems": true
+ },
+ "externalDocs": {
+ "$ref": "#/definitions/externalDocs"
+ }
+ },
+ "definitions": {
+ "vendorExtension": {
+ "description": "Any property starting with x- is valid.",
+ "additionalProperties": true,
+ "additionalItems": true
+ },
+ "contact": {
+ "type": "object",
+ "description": "Contact information for the exposed API.",
+ "additionalProperties": false,
+ "patternProperties": {
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The identifying name of the contact person/organization."
+ },
+ "url": {
+ "type": "string",
+ "description": "The URL pointing to the contact information. MUST be in the format of a URL."
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact person/organization. Must be in the format of an email address."
+ }
+ }
+ },
+ "license": {
+ "type": "object",
+ "description": "License information for the exposed API.",
+ "required": [ "name" ],
+ "additionalProperties": false,
+ "patternProperties": {
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The license name used for the API."
+ },
+ "url": {
+ "type": "string",
+ "description": "A URL to the license used for the API. MUST be in the format of a URL."
+ }
+ }
+ },
+ "info": {
+ "type": "object",
+ "description": "The object provides metadata about the API. The metadata can be used by the clients if needed, and can be presented in the OpenApi-UI for convenience.",
+ "required": [
+ "title",
+ "version"
+ ],
+ "additionalProperties": false,
+ "patternProperties": {
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "title": {
+ "type": "string",
+ "description": "The title of the application."
+ },
+ "description": {
+ "type": "string",
+ "description": "A short description of the application. CommonMark syntax can be used for rich text representation."
+ },
+ "termsOfService": {
+ "type": "string",
+ "description": "A URL to the Terms of Service for the API."
+ },
+ "contact": {
+ "$ref": "#/definitions/contact"
+ },
+ "license": {
+ "$ref": "#/definitions/license"
+ },
+ "version": {
+ "type": "string",
+ "description": "Provides the version of the application API (not to be confused with the specification version)."
+ }
+ }
+ },
+ "server": {
+ "type": "object",
+ "description": "An object representing a Server.",
+ "additionalProperties": false,
+ "patternProperties": {
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "A absolute URL to the target host. This URL supports template variables and may be relative, to indicate that the host location is relative to the location where the OpenAPI Specification is being served. Templates are optional and specified by the Host Template Parameter syntax. Template substitutions will be made when a variable is named in {brackets}."
+ },
+ "description": {
+ "type": "string",
+ "description": "An optional string describing the host designated by the URL."
+ },
+ "variables": {
+ "$ref": "#/definitions/serverVariables"
+ }
+ }
+ },
+ "paths": {
+ "type": "object",
+ "description": "Holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the Server Object in order to construct the full URL. The Paths MAY be empty, due to ACL constraints.",
+ "patternProperties": {
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ },
+ "^/": {
+ "$ref": "#/definitions/pathItem"
+ }
+ },
+ "additionalProperties": false
+ },
+ "pathItem": {
+ "type": "object",
+ "description": "Describes the operations available on a single path. A Path Item MAY be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.",
+ "properties": {
+ "$ref": {
+ "type": "string",
+ "description": "Allows for an external definition of this path item. The referenced structure MUST be in the format of a Path Item Object. If there are conflicts between the referenced definition and this Path Item's definition, the behavior is undefined."
+ },
+ "summary": {
+ "type": "string",
+ "description": "An optional, string summary, intended to apply to all operations in this path."
+ },
+ "description": {
+ "type": "string",
+ "description": "An optional, string description, intended to apply to all operations in this path. CommonMark syntax can be used for rich text representation."
+ },
+ "get": {
+ "$ref": "#/definitions/operation"
+ },
+ "put": {
+ "$ref": "#/definitions/operation"
+ },
+ "post": {
+ "$ref": "#/definitions/operation"
+ },
+ "delete": {
+ "$ref": "#/definitions/operation"
+ },
+ "options": {
+ "$ref": "#/definitions/operation"
+ },
+ "head": {
+ "$ref": "#/definitions/operation"
+ },
+ "patch": {
+ "$ref": "#/definitions/operation"
+ },
+ "trace": {
+ "$ref": "#/definitions/operation"
+ },
+ "servers": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/server"
+ }
+ },
+ "parameters": {
+ "type": "array",
+ "items": {
+ "oneOf": [
+ { "$ref": "#/definitions/parameter" },
+ { "$ref": "#/definitions/reference" }
+ ]
+ }
+ }
+ },
+ "patternProperties": {
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "additionalProperties": false
+ },
+ "operation": {
+ "type": "object",
+ "description": "Describes a single API operation on a path.",
+ "required": [ "responses" ],
+ "properties": {
+ "tags": {
+ "type": "array",
+ "items": [
+ { "type": "string" }
+ ],
+ "description": "A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier."
+ },
+ "summary": {
+ "type": "string",
+ "description": "A short summary of what the operation does. For maximum readability in editing or documentation generation tools, this field SHOULD be less than 120 characters."
+ },
+ "description": {
+ "type": "string",
+ "description": "A verbose explanation of the operation behavior. CommonMark syntax can be used for rich text representation."
+ },
+ "externalDocs": {
+ "$ref": "#/definitions/externalDocs"
+ },
+ "operationId": {
+ "type": "string",
+ "description": "Unique string used to identify the operation. The id MUST be unique among all operations described in the API. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is recommended to follow common programming naming conventions."
+ },
+ "parameters": {
+ "type": "array",
+ "items": {
+ "oneOf": [
+ { "$ref": "#/definitions/parameter" },
+ { "$ref": "#/definitions/reference" }
+ ]
+ },
+ "description": "A list of parameters that are applicable for this operation. If a parameter is already defined at the Path Item, the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's components/parameters."
+ },
+ "requestBody": {
+ "oneOf": [
+ { "$ref": "#/definitions/requestBody" },
+ { "$ref": "#/definitions/reference" }
+ ],
+ "description": "The request body applicable for this operation. The requestBody is only supported in HTTP methods where the HTTP 1.1 specification has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody SHALL be ignored by consumers."
+ },
+ "responses": {
+ "$ref": "#/definitions/responses",
+ "description": "Required. The list of possible responses as they are returned from executing this operation."
+ },
+ "callbacks": {
+ "$ref": "#/definitions/callbacks",
+ "description": "The list of possible callbacks as they are returned from executing this operation."
+ },
+ "deprecated": {
+ "type": "boolean",
+ "description": "Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is false."
+ },
+ "security": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/securityRequirement"
+ }
+ },
+ "servers": {
+ "$ref": "#/definitions/server"
+ }
+ },
+ "patternProperties": {
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "additionalProperties": false
+ },
+ "parameter": {
+ "type": "object",
+ "description": "Describes a single operation parameter.",
+ "required": [ "name", "in" ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": ""
+ },
+ "in": {
+ "type": "string",
+ "enum": [ "query", "header", "path", "cookie" ],
+ "description": "The location of the parameter."
+ },
+ "description": {
+ "type": "string",
+ "description": "A brief description of the parameter. This could contain examples of use. CommonMark syntax can be used for rich text representation."
+ },
+ "required": {
+ "type": "boolean",
+ "description": "Determines whether this parameter is mandatory. If the parameter location is \"path\", this property is required and its value MUST be true. Otherwise, the property MAY be included and its default value is false.",
+ "default": "false"
+ },
+ "deprecated": {
+ "type": "boolean",
+ "description": "Specifies that a parameter is deprecated and SHOULD be transitioned out of usage."
+ },
+ "allowEmptyValue": {
+ "type": "boolean",
+ "description": "Sets the ability to pass empty-valued parameters. This is valid only for query parameters and allows sending a parameter with an empty value. Default value is false. If style is used, if behavior is n/a, the value of allowEmptyValue SHALL be ignored."
+ },
+ "schema": {
+ "anyOf": [
+ { "$ref": "#/definitions/schema" },
+ { "$ref": "#/definitions/reference" }
+ ]
+ }
+ },
+ "patternProperties": {
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "additionalProperties": false
+ },
+ "reference": {
+ "type": "object",
+ "description": "A simple object to allow referencing other components in the specification, internally and externally",
+ "required": [ "$ref" ],
+ "properties": {
+ "$ref": {
+ "type": "string",
+ "description": "The reference string"
+ }
+ }
+ },
+ "responses": {
+ "type": "object",
+ "description": "A container for the expected responses of an operation. The container maps a HTTP response code to the expected response.",
+ "patternProperties": {
+ "^([0-9]{3})$|^(default)$": {
+ "$ref": "#/definitions/responseValue"
+ },
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "additionalProperties": false
+ },
+ "responseValue": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/response"
+ },
+ {
+ "$ref": "#/definitions/reference"
+ }
+ ]
+ },
+ "response": {
+ "type": "object",
+ "description": "Describes a single response from an API Operation, including design-time, static links to operations based on the response.",
+ "required": [ "description" ],
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "A short description of the response. CommonMark syntax can be used for rich text representation."
+ },
+ "headers": {
+ "$ref": "#/definitions/headers"
+ },
+ "content": {
+ "$ref": "#/definitions/content"
+ },
+ "links": {
+ "$ref": "#/definitions/links"
+ }
+ },
+ "patternProperties": {
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "additionalProperties": false
+ },
+ "requestBody": {
+ "type": "object",
+ "required": [ "content" ],
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "A brief description of the request body. This could contain examples of use. CommonMark syntax can be used for rich text representation."
+ },
+ "content": {
+ "$ref": "#/definitions/content",
+ "description": "The content of the request body."
+ },
+ "required": {
+ "type": "boolean",
+ "description": "Determines if the request body is required in the request. Defaults to false.",
+ "default": "false"
+ }
+ },
+ "patternProperties": {
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "additionalProperties": false
+ },
+ "callbacks": {
+ "type": "object",
+ "description": "A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Callback Object that describes a request that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.",
+ "patternProperties": {
+ ".*": {
+ "anyOf": [
+ { "$ref": "#/definitions/callback" },
+ { "$ref": "#/definitions/reference" }
+ ]
+ },
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "additionalProperties": false
+ },
+ "callback": {
+ "type": "object",
+ "description": "A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.",
+ "patternProperties": {
+ ".*": {
+ "$ref": "#/definitions/pathItem"
+ },
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "additionalProperties": false
+ },
+ "headers": {
+ "type": "object",
+ "patternProperties": {
+ ".*": {
+ "anyOf": [
+ { "$ref": "#/definitions/header" },
+ { "$ref": "#/definitions/reference" }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "header": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "A brief description of the parameter. This could contain examples of use. CommonMark syntax can be used for rich text representation."
+ },
+ "required": {
+ "type": "boolean",
+ "description": "Determines whether this parameter is mandatory. If the parameter location is \"path\", this property is required and its value MUST be true. Otherwise, the property MAY be included and its default value is false.",
+ "default": "false"
+ },
+ "deprecated": {
+ "type": "boolean",
+ "description": "Specifies that a parameter is deprecated and SHOULD be transitioned out of usage."
+ },
+ "allowEmptyValue": {
+ "type": "boolean",
+ "description": "Sets the ability to pass empty-valued parameters. This is valid only for query parameters and allows sending a parameter with an empty value. Default value is false. If style is used, if behavior is n/a, the value of allowEmptyValue SHALL be ignored."
+ }
+ },
+ "patternProperties": {
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "additionalProperties": false
+ },
+ "components": {
+ "type": "object",
+ "description": "Holds a set of reusable objects for different aspects of the OAS. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.",
+ "patternProperties": {
+ "^[a-zA-Z0-9.\\-_]+$": {
+ "oneOf": [
+ { "$ref": "#/definitions/definitions" },
+ { "$ref": "#/definitions/responsesDefinitions" },
+ { "$ref": "#/definitions/parametersDefinitions" },
+ { "$ref": "#/definitions/requestBodyDefinitions" },
+ { "$ref": "#/definitions/responseHeadersDefinitions" },
+ { "$ref": "#/definitions/securityDefinitions" },
+ { "$ref": "#/definitions/linkDefinitions" },
+ { "$ref": "#/definitions/callbackDefinitions" }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "securityRequirement": {},
+ "tag": {
+ "type": "object",
+ "description": "Allows adding meta data to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag used there.",
+ "required": [ "name" ],
+ "additionalProperties": false,
+ "patternProperties": {
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the tag."
+ },
+ "description": {
+ "type": "string",
+ "description": "A short description for the tag. CommonMark syntax can be used for rich text representation."
+ },
+ "externalDocs": {
+ "$ref": "#/definitions/externalDocs"
+ }
+ }
+ },
+ "externalDocs": {
+ "type": "object",
+ "description": "Allows referencing an external resource for extended documentation.",
+ "required": [ "url" ],
+ "additionalProperties": false,
+ "patternProperties": {
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "A short description of the target documentation. CommonMark syntax can be used for rich text representation."
+ },
+ "url": {
+ "type": "string",
+ "description": "The URL for the target documentation. Value MUST be in the format of a URL."
+ }
+ }
+ },
+ "serverVariables": {
+ "type": "object",
+ "description": "",
+ "patternProperties": {
+ "^X-": {
+ "$ref": "#/definitions/vendorExtension"
+ },
+ "": {
+ "$ref": "#/definitions/serverVariable"
+ }
+ },
+ "additionalProperties": false
+ },
+ "serverVariable": {
+ "type": "object",
+ "description": "An object representing a Host URL template",
+ "additionalProperties": false,
+ "required": [ "default" ],
+ "properties": {
+ "enums": {
+ "description": "An enumeration of primitive type values to be used if the substitution options are from a limited set.",
+ "type": "string"
+ },
+ "default": {
+ "description": "The default value to use for substitution if an alternate value is not specified, and will be sent if an alternative value is not supplied.",
+ "type": "string"
+ },
+ "description": {
+ "type": "string",
+ "description": "An optional description for the template parameter."
+ }
+ }
+ },
+ "content": {
+ "type": "object",
+ "description": "Describes a set of supported media types. A Content Object can be used in Request Body Object, Parameter Objects, Header Objects, and Response Objects.",
+ "patternProperties": {
+ ".*": {
+
+ }
+ }
+ },
+ "definitions": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/schema"
+ },
+ "description": "An object to hold schemas for data types that can be consumed and produced by operations. These data types can be primitives, arrays or models."
+ },
+ "schema": {
+ "type": "object",
+ "description": "A deterministic version of a JSON Schema object.",
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "$ref": {
+ "type": "string"
+ },
+ "format": {
+ "type": "string"
+ },
+ "title": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/title"
+ },
+ "description": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/description"
+ },
+ "default": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/default"
+ },
+ "multipleOf": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf"
+ },
+ "maximum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum"
+ },
+ "exclusiveMaximum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"
+ },
+ "minimum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum"
+ },
+ "exclusiveMinimum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"
+ },
+ "maxLength": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
+ },
+ "minLength": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
+ },
+ "pattern": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern"
+ },
+ "maxItems": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
+ },
+ "minItems": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
+ },
+ "uniqueItems": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems"
+ },
+ "maxProperties": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
+ },
+ "minProperties": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
+ },
+ "required": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray"
+ },
+ "enum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/enum"
+ },
+ "additionalProperties": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/schema"
+ },
+ {
+ "type": "boolean"
+ }
+ ],
+ "default": {}
+ },
+ "type": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/type"
+ },
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/schema"
+ },
+ {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "$ref": "#/definitions/schema"
+ }
+ }
+ ],
+ "default": {}
+ },
+ "allOf": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "$ref": "#/definitions/schema"
+ }
+ },
+ "properties": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/schema"
+ },
+ "default": {}
+ },
+ "discriminator": {
+ "type": "string"
+ },
+ "readOnly": {
+ "type": "boolean",
+ "default": false
+ },
+ "xml": {
+ "$ref": "#/definitions/xml"
+ },
+ "externalDocs": {
+ "$ref": "#/definitions/externalDocs"
+ },
+ "example": {}
+ },
+ "additionalProperties": false
+ }
+ }
+}
+
diff --git a/conf.d/packaging/rpm-.spec b/conf.d/packaging/rpm-.spec
new file mode 100644
index 0000000..ba61b40
--- /dev/null
+++ b/conf.d/packaging/rpm-.spec
@@ -0,0 +1,43 @@
+###########################################################################
+# 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: GPV2
+Summary: Expose MicroChip UnicensV2 through AGL AppFw
+Url: https://github.com/iotbzh/unicens-agent
+
+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)
+
+BuildRoot:/home/fulup/Workspace/AGL-AppFW/unicens2rc-afb/build
+
+%description
+Expose MicroChip UnicensV2 through AGL AppFw
+
+%prep
+
+%build
+(mkdir -p build; cd build; cmake ..; make)
+
+%install
+(cd build; make populate DESTDIR=%{buildroot})
+
diff --git a/conf.d/packaging/rpm-unicens-agent.spec b/conf.d/packaging/rpm-unicens-agent.spec
new file mode 100644
index 0000000..3942fbc
--- /dev/null
+++ b/conf.d/packaging/rpm-unicens-agent.spec
@@ -0,0 +1,43 @@
+###########################################################################
+# 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
+
+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)
+
+BuildRoot:/home/fulup/Workspace/AGL-AppFW/unicens2-binding/build
+
+%description
+Expose MicroChip UnicensV2 through AGL AppFw
+
+%prep
+
+%build
+(mkdir -p build; cd build; cmake ..; make)
+
+%install
+(cd build; make populate DESTDIR=%{buildroot})
+
diff --git a/conf.d/templates/cmake/common.cmake b/conf.d/templates/cmake/common.cmake
new file mode 100644
index 0000000..25a665d
--- /dev/null
+++ b/conf.d/templates/cmake/common.cmake
@@ -0,0 +1,382 @@
+###########################################################################
+# Copyright 2015, 2016, 2017 IoT.bzh
+#
+# author: Fulup Ar Foll <fulup@iot.bzh>
+# contrib: Romain Forlot <romain.forlot@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.
+###########################################################################
+
+
+#--------------------------------------------------------------------------
+# WARNING:
+# Do not change this cmake template
+# Customise your preferences in "./etc/config.cmake"
+#--------------------------------------------------------------------------
+
+
+# Generic useful macro
+# -----------------------
+macro(PROJECT_TARGET_ADD TARGET_NAME)
+ set_property(GLOBAL APPEND PROPERTY PROJECT_TARGETS ${TARGET_NAME})
+ set(TARGET_NAME ${TARGET_NAME})
+endmacro(PROJECT_TARGET_ADD)
+
+macro(PROJECT_PKGDEP_ADD PKG_NAME)
+ set_property(GLOBAL APPEND PROPERTY PROJECT_PKG_DEPS ${PKG_NAME})
+endmacro(PROJECT_PKGDEP_ADD)
+
+# Check GCC minimal version version
+if (gcc_minimal_version)
+ message ("-- Check gcc_minimal_version (found gcc version ${CMAKE_C_COMPILER_VERSION}) (found g++ version ${CMAKE_CXX_COMPILER_VERSION})")
+if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${gcc_minimal_version} OR CMAKE_C_COMPILER_VERSION VERSION_LESS ${gcc_minimal_version})
+ message(FATAL_ERROR "**** FATAL: Require at least gcc-${gcc_minimal_version} please set CMAKE_C[XX]_COMPILER")
+endif()
+endif(gcc_minimal_version)
+
+macro(defstr name value)
+ add_definitions(-D${name}=${value})
+endmacro(defstr)
+
+
+
+# Pre-packaging
+macro(project_targets_populate)
+
+ # Default Widget default directory
+ set(PACKAGE_BINDIR ${PROJECT_PKG_DIR}/bin)
+ set(PACKAGE_ETCDIR ${PROJECT_PKG_DIR}/etc)
+ set(PACKAGE_LIBDIR ${PROJECT_PKG_DIR}/lib)
+ set(PACKAGE_HTTPDIR ${PROJECT_PKG_DIR}/htdocs)
+ set(PACKAGE_DATADIR ${PROJECT_PKG_DIR}/data)
+
+ add_custom_target(populate)
+ get_property(PROJECT_TARGETS GLOBAL PROPERTY PROJECT_TARGETS)
+ foreach(TARGET ${PROJECT_TARGETS})
+ get_target_property(T ${TARGET} LABELS)
+ if(T)
+ # Declaration of a custom command that will populate widget tree with the target
+ set(POPULATE_PACKAGE_TARGET "populate_${TARGET}")
+
+ get_target_property(P ${TARGET} PREFIX)
+ get_target_property(BD ${TARGET} BINARY_DIR)
+ get_target_property(OUT ${TARGET} OUTPUT_NAME)
+
+ if(P MATCHES "NOTFOUND$")
+ if (${T} STREQUAL "BINDING")
+ set(P "lib")
+ else()
+ set(P "")
+ endif()
+ endif()
+
+ if(${T} STREQUAL "BINDING")
+ add_custom_command(OUTPUT ${PACKAGE_LIBDIR}/${P}${TARGET}.so
+ DEPENDS ${TARGET}
+ COMMAND mkdir -p ${PACKAGE_LIBDIR}
+ COMMAND cp ${BD}/${P}${OUT}.so ${PACKAGE_LIBDIR}
+ )
+ add_custom_target(${POPULATE_PACKAGE_TARGET} DEPENDS ${PACKAGE_LIBDIR}/${P}${TARGET}.so)
+ add_dependencies(populate ${POPULATE_PACKAGE_TARGET})
+ elseif(${T} STREQUAL "EXECUTABLE")
+ add_custom_command(OUTPUT ${PACKAGE_BINDIR}/${P}${TARGET}
+ DEPENDS ${TARGET}
+ COMMAND mkdir -p ${PACKAGE_BINDIR}
+ COMMAND cp ${BD}/${P}${OUT} ${PACKAGE_BINDIR}
+ )
+ add_custom_target(${POPULATE_PACKAGE_TARGET} DEPENDS ${PACKAGE_BINDIR}/${P}${TARGET})
+ add_dependencies(populate ${POPULATE_PACKAGE_TARGET})
+ elseif(${T} STREQUAL "HTDOCS")
+ add_custom_target(${POPULATE_PACKAGE_TARGET}
+ DEPENDS ${PACKAGE_HTTPDIR}/${TARGET}-xx
+ )
+ add_custom_command(
+ OUTPUT ${PACKAGE_HTTPDIR}/${TARGET}-xx
+ DEPENDS ${TARGET}
+ COMMAND mkdir -p ${PACKAGE_HTTPDIR}
+ COMMAND touch ${PACKAGE_HTTPDIR}
+ COMMAND cp -r ${BD}/${P}${OUT}/* ${PACKAGE_HTTPDIR}/.
+ )
+ add_dependencies(populate ${POPULATE_PACKAGE_TARGET})
+ elseif(${T} STREQUAL "DATA")
+ add_custom_target(${POPULATE_PACKAGE_TARGET}
+ DEPENDS ${PACKAGE_DATADIR}/${TARGET}-xx
+ )
+
+ add_custom_command(
+ OUTPUT ${PACKAGE_DATADIR}/${TARGET}-xx
+ DEPENDS ${TARGET}
+ COMMAND mkdir -p ${PACKAGE_DATADIR}
+ COMMAND touch ${PACKAGE_DATADIR}
+ COMMAND cp -r ${BD}/${P}${OUT}/* ${PACKAGE_DATADIR}/.
+ )
+ add_dependencies(populate ${POPULATE_PACKAGE_TARGET})
+ endif(${T} STREQUAL "BINDING")
+ elseif(${CMAKE_BUILD_TYPE} MATCHES "[Dd][Ee][Bb][Uu][Gg]")
+ MESSAGE(".. Warning: ${TARGET} ignored when packaging.")
+ endif()
+ endforeach()
+endmacro(project_targets_populate)
+
+macro(remote_targets_populate)
+ if (DEFINED ENV{RSYNC_TARGET})
+ set (RSYNC_TARGET $ENV{RSYNC_TARGET})
+ endif()
+ if (DEFINED ENV{RSYNC_PREFIX})
+ set (RSYNC_PREFIX $ENV{RSYNC_PREFIX})
+ endif()
+
+ set(
+ REMOTE_LAUNCH "Test on target with: ${CMAKE_CURRENT_BINARY_DIR}/target/start-on-${RSYNC_TARGET}.sh"
+ CACHE STRING "Command to start ${PROJECT_NAME} on remote target ${RSYNC_TARGET}"
+ )
+
+ if(NOT RSYNC_TARGET OR NOT RSYNC_PREFIX)
+ message (".. Warning: RSYNC_TARGET RSYNC_PREFIX not defined 'make remote-target-populate' not instanciated")
+ add_custom_target(remote-target-populate
+ COMMENT "*** Fatal: RSYNC_TARGET RSYNC_PREFIX required with 'make remote-target-populate'"
+ COMMAND exit -1
+ )
+ else()
+
+ configure_file(${SSH_TEMPLATE_DIR}/start-on-target.in ${CMAKE_CURRENT_BINARY_DIR}/target/start-on-${RSYNC_TARGET}.sh)
+ configure_file(${GDB_TEMPLATE_DIR}/gdb-on-target.in ${CMAKE_CURRENT_BINARY_DIR}/target/gdb-on-${RSYNC_TARGET}.ini)
+
+ add_custom_target(remote-target-populate
+ DEPENDS populate
+ COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/target/start-on-${RSYNC_TARGET}.sh
+ COMMAND rsync --archive --delete ${PROJECT_PKG_DIR}/ ${RSYNC_TARGET}:${RSYNC_PREFIX}/${PROJECT_NAME}
+ COMMENT "${REMOTE_LAUNCH}"
+ )
+ endif()
+endmacro(remote_targets_populate)
+
+
+macro(wgt_package_build)
+ if(NOT EXISTS ${WGT_TEMPLATE_DIR}/config.xml.in OR NOT EXISTS ${WGT_TEMPLATE_DIR}/${PROJECT_ICON}.in)
+ MESSAGE(FATAL_ERROR "Missing mandatory files: you need config.xml.in and ${PROJECT_ICON}.in files in ${WGT_TEMPLATE_DIR} folder.")
+ endif()
+
+ # Build widget spec file from template only once (Fulup good idea or should depend on time ????)
+ if(NOT EXISTS ${PROJECT_PKG_DIR}/config.xml.in OR NOT EXISTS ${PROJECT_PKG_DIR}/${PROJECT_ICON}.in)
+ configure_file(${WGT_TEMPLATE_DIR}/config.xml.in ${PROJECT_PKG_DIR}/config.xml)
+ file(COPY ${WGT_TEMPLATE_DIR}/${PROJECT_ICON}.in DESTINATION ${PROJECT_PKG_DIR}/${PROJECT_ICON})
+ endif(NOT EXISTS ${PROJECT_PKG_DIR}/config.xml.in OR NOT EXISTS ${PROJECT_PKG_DIR}/${PROJECT_ICON}.in)
+
+ # Fulup ??? copy any extra file in wgt/etc into populate package before building the widget
+ file(GLOB PROJECT_CONF_FILES "${WGT_TEMPLATE_DIR}/etc/*")
+ if(${PROJECT_CONF_FILES})
+ file(COPY "${WGT_TEMPLATE_DIR}/etc/*" DESTINATION ${PROJECT_PKG_DIR}/etc/)
+ endif(${PROJECT_CONF_FILES})
+
+ add_custom_command(OUTPUT ${PROJECT_NAME}.wgt
+ DEPENDS ${PROJECT_TARGETS}
+ COMMAND wgtpkg-pack -f -o ${PROJECT_NAME}.wgt ${PROJECT_PKG_DIR}
+ )
+
+ add_custom_target(widget DEPENDS ${PROJECT_NAME}.wgt)
+ add_dependencies(widget populate)
+ set(ADDITIONAL_MAKE_CLEAN_FILES, "${PROJECT_NAME}.wgt")
+
+ if(PACKAGE_MESSAGE)
+ add_custom_command(TARGET widget
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --cyan "++ ${PACKAGE_MESSAGE}")
+ endif()
+endmacro(wgt_package_build)
+
+macro(rpm_package_build)
+ if(NOT EXISTS ${RPM_TEMPLATE_DIR}/rpm-config.spec.in)
+ MESSAGE(FATAL_ERROR "Missing mandatory files: you needconfig.rpm.in in ${RPM_TEMPLATE_DIR} folder.")
+ endif()
+
+ # extract PROJECT_PKG_DEPS and replace ; by , for RPM spec file
+ get_property(PROJECT_PKG_DEPS GLOBAL PROPERTY PROJECT_PKG_DEPS)
+ foreach (PKFCONF ${PROJECT_PKG_DEPS})
+ set(RPM_PKG_DEPS "${RPM_PKG_DEPS}, pkgconfig(${PKFCONF})")
+ endforeach()
+
+ # build rpm spec file from template
+ configure_file(${RPM_TEMPLATE_DIR}/rpm-config.spec.in ${SPEC_DIR}/rpm-${PROJECT_NAME}.spec)
+
+ add_custom_command(OUTPUT ${PROJECT_NAME}.rpm
+ DEPENDS ${PROJECT_TARGETS}
+ COMMAND rpmbuild -ba ${SPEC_DIR}/rpm-${PROJECT_NAME}.spec
+ )
+
+ add_custom_target(rpm DEPENDS ${PROJECT_NAME}.rpm)
+ add_dependencies(rpm populate)
+ set(ADDITIONAL_MAKE_CLEAN_FILES, "${PROJECT_NAME}.rpm")
+
+ if(PACKAGE_MESSAGE)
+ add_custom_command(TARGET rpm
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --cyan "++ ${PACKAGE_MESSAGE}")
+ endif()
+endmacro(rpm_package_build)
+
+macro(project_package_build)
+
+ if(EXISTS ${RPM_TEMPLATE_DIR})
+ rpm_package_build()
+ endif()
+
+ if(EXISTS ${WGT_TEMPLATE_DIR})
+ wgt_package_build()
+ endif()
+
+ if(EXISTS ${DEB_TEMPLATE_DIR})
+ deb_package_build()
+ endif()
+
+endmacro(project_package_build)
+
+
+macro(project_subdirs_add)
+ set (ARGSLIST ${ARGN}) # ${ARGN} is special and should be copied
+ list(LENGTH ARGSLIST ARGSNUM)
+ if(${ARGSNUM} GREATER 0)
+ file(GLOB filelist "${ARGV0}")
+ else()
+ file(GLOB filelist "*")
+ endif()
+
+ foreach(filename ${filelist})
+ if(EXISTS "${filename}/CMakeLists.txt")
+ add_subdirectory(${filename})
+ endif(EXISTS "${filename}/CMakeLists.txt")
+ endforeach()
+endmacro(project_subdirs_add)
+
+set(CMAKE_BUILD_TYPE Debug CACHE STRING "the type of build")
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+set(CMP0048 1)
+
+# Include project configuration
+# ------------------------------
+project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES ${PROJECT_LANGUAGES})
+set(PROJECT_PKG_DIR "pkgout" CACHE PATH "Subpath to packages")
+set(PROJECT_LIB_DIR "libs" CACHE PATH "Subpath to libraries")
+set(PROJECT_RESOURCES "data" CACHE PATH "Subpath to data")
+
+set(AFB_TOKEN "" CACHE PATH "Default AFB_TOKEN")
+set(AFB_REMPORT "1234" CACHE PATH "Default AFB_TOKEN")
+
+INCLUDE(FindPkgConfig)
+INCLUDE(CheckIncludeFiles)
+INCLUDE(CheckLibraryExists)
+INCLUDE(GNUInstallDirs)
+
+# Default compilation options
+############################################################################
+link_libraries(-Wl,--as-needed -Wl,--gc-sections)
+add_compile_options(-Wall -Wextra -Wconversion)
+add_compile_options(-Wno-unused-parameter) # frankly not using a parameter does it care?
+add_compile_options(-Wno-sign-compare -Wno-sign-conversion)
+add_compile_options(-Werror=maybe-uninitialized)
+add_compile_options(-Werror=implicit-function-declaration)
+add_compile_options(-ffunction-sections -fdata-sections)
+add_compile_options(-fPIC)
+add_compile_options(-g)
+
+set(CMAKE_C_FLAGS_PROFILING "-g -O2 -pg -Wp,-U_FORTIFY_SOURCE" CACHE STRING "Flags for profiling")
+set(CMAKE_C_FLAGS_DEBUG "-g -O2 -ggdb -Wp,-U_FORTIFY_SOURCE" CACHE STRING "Flags for debugging")
+set(CMAKE_C_FLAGS_RELEASE "-O2" CACHE STRING "Flags for releasing")
+set(CMAKE_C_FLAGS_CCOV "-g -O2 --coverage" CACHE STRING "Flags for coverage test")
+
+set(CMAKE_CXX_FLAGS_PROFILING "-g -O0 -pg -Wp,-U_FORTIFY_SOURCE")
+set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
+set(CMAKE_CXX_FLAGS_RELEASE "-g -O2")
+set(CMAKE_CXX_FLAGS_CCOV "-g -O2 --coverage")
+
+# Env variable overload default
+if(DEFINED ENV{INSTALL_PREFIX})
+ set (INSTALL_PREFIX $ENV{INSTALL_PREFIX})
+else()
+ set(INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/Install" CACHE PATH "The path where to install")
+endif()
+set(CMAKE_INSTALL_PREFIX ${INSTALL_PREFIX} CACHE STRING "Installation Prefix" FORCE)
+
+# (BUG!!!) as PKG_CONFIG_PATH does not work [should be en env variable]
+set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON CACHE BOOLEAN "Flag for using prefix path")
+
+# Loop on required package and add options
+foreach (PKG_CONFIG ${PKG_REQUIRED_LIST})
+ PKG_CHECK_MODULES(${PKG_CONFIG} REQUIRED ${PKG_CONFIG})
+
+ INCLUDE_DIRECTORIES(${${PKG_CONFIG}_INCLUDE_DIRS})
+ list (APPEND link_libraries ${${PKG_CONFIG}_LIBRARIES})
+ add_compile_options (${${PKG_CONFIG}_CFLAGS})
+
+ PROJECT_PKGDEP_ADD(${PKG_CONFIG})
+endforeach(PKG_CONFIG)
+
+# Optional LibEfence Malloc debug library
+IF(CMAKE_BUILD_TYPE MATCHES DEBUG)
+CHECK_LIBRARY_EXISTS(efence malloc "" HAVE_LIBEFENCE)
+IF(HAVE_LIBEFENCE)
+ MESSAGE(STATUS "Linking with ElectricFence for debugging purposes...")
+ SET(libefence_LIBRARIES "-lefence")
+ list (APPEND link_libraries ${libefence_LIBRARIES})
+ENDIF(HAVE_LIBEFENCE)
+ENDIF(CMAKE_BUILD_TYPE MATCHES DEBUG)
+
+# set default include directories
+INCLUDE_DIRECTORIES(${EXTRA_INCLUDE_DIRS})
+
+# If no install dir try to guess some smart default
+if(BINDINGS_INSTALL_PREFIX)
+ set(BINDINGS_INSTALL_DIR ${BINDINGS_INSTALL_PREFIX}/${PROJECT_NAME})
+else()
+ set(BINDINGS_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME})
+endif()
+
+# Define a default widget directory
+set (PKG_TEMPLATE_PREFIX ${CMAKE_SOURCE_DIR}/conf.d/templates CACHE PATH "Default Package Templates Directory")
+set(SSH_TEMPLATE_DIR ${PKG_TEMPLATE_PREFIX}/ssh)
+set(GDB_TEMPLATE_DIR ${PKG_TEMPLATE_PREFIX}/gdb)
+set(WGT_TEMPLATE_DIR ${PKG_TEMPLATE_PREFIX}/wgt)
+set(RPM_TEMPLATE_DIR ${PKG_TEMPLATE_PREFIX}/rpm)
+set(DEB_TEMPLATE_DIR ${PKG_TEMPLATE_PREFIX}/deb)
+set(SPEC_DIR ${CMAKE_SOURCE_DIR}/conf.d/packaging)
+
+
+# Default Linkflag
+if(NOT BINDINGS_LINK_FLAG)
+ set(BINDINGS_LINK_FLAG "-Wl,--version-script=${PKG_TEMPLATE_PREFIX}/cmake/export.map")
+endif()
+
+# Add a dummy target to enable global dependency order
+# -----------------------------------------------------
+if(EXTRA_DEPENDENCIES_ORDER)
+ set(DEPENDENCIES_TARGET ${PROJECT_NAME}_extra_dependencies)
+ add_custom_target(${DEPENDENCIES_TARGET} ALL
+ DEPENDS ${EXTRA_DEPENDENCY_ORDER}
+ )
+endif()
+
+# Print developer helper message when build is done
+# -------------------------------------------------------
+macro(project_closing_msg)
+ get_property(PROJECT_TARGETS GLOBAL PROPERTY PROJECT_TARGETS)
+ if(CLOSING_MESSAGE AND PROJECT_TARGETS)
+ add_custom_target(${PROJECT_NAME}_build_done ALL
+ COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --cyan "++ ${CLOSING_MESSAGE}"
+ )
+ add_dependencies(${PROJECT_NAME}_build_done
+ ${DEPENDENCIES_TARGET} ${PROJECT_TARGETS})
+ endif()
+endmacro()
+
+# Add RSYSTARGET
+remote_targets_populate() \ No newline at end of file
diff --git a/conf.d/templates/cmake/export.map b/conf.d/templates/cmake/export.map
new file mode 100644
index 0000000..ee2f413
--- /dev/null
+++ b/conf.d/templates/cmake/export.map
@@ -0,0 +1 @@
+{ global: afbBindingV*; local: *; };
diff --git a/conf.d/templates/gdb/gdb-on-target.in b/conf.d/templates/gdb/gdb-on-target.in
new file mode 100644
index 0000000..360c860
--- /dev/null
+++ b/conf.d/templates/gdb/gdb-on-target.in
@@ -0,0 +1,13 @@
+# gdb-remote.init file for IDE
+# Object: allow to use standard gdb to remote debug a target
+# Usage: remote-target-populate update script under ./build directory
+# Author: Fulup Ar Foll (IoT.bzh)
+# Reference: https://blog.flameeyes.eu/2010/02/remote-debugging-with-gdb-part-2-gdb/
+
+# Start gdbserver on target and connect through SSH link
+target remote | ssh @RSYNC_TARGET@ gdbserver - afb-daemon --port=@AFB_REMPORT@ --workdir=@RSYNC_PREFIX@/@PROJECT_NAME@ --roothttp=./htdocs --ldpath=./lib --verbose --token=@AFB_TOKEN@
+
+# Replace run by continue (gdb use 'run' when gdbserver wants 'continue')
+define run
+continue
+end \ No newline at end of file
diff --git a/conf.d/templates/rpm/rpm-config.spec.in b/conf.d/templates/rpm/rpm-config.spec.in
new file mode 100644
index 0000000..dce9c22
--- /dev/null
+++ b/conf.d/templates/rpm/rpm-config.spec.in
@@ -0,0 +1,43 @@
+###########################################################################
+# 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: @PROJECT_NAME@
+Version: @PROJECT_VERSION@
+Release: 1
+License: @PROJECT_LICENCE@
+Summary: @PROJECT_DESCRIPTION@
+Url: @PROJECT_URL@
+
+Provides: @PROJECT_NAME@
+Prefix: /opt/@PROJECT_NAME@
+BuildRequires: pkg-config @RPM_PKG_DEPS@
+
+BuildRoot:@CMAKE_CURRENT_BINARY_DIR@
+
+%description
+@PROJECT_DESCRIPTION@
+
+%prep
+
+%build
+(mkdir -p build; cd build; cmake ..; make)
+
+%install
+(cd build; make populate DESTDIR=%{buildroot})
+
diff --git a/conf.d/templates/ssh/start-on-target.in b/conf.d/templates/ssh/start-on-target.in
new file mode 100644
index 0000000..d5389f0
--- /dev/null
+++ b/conf.d/templates/ssh/start-on-target.in
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# File: start-on-target.sh
+# Author: Fulup Ar Foll @ IoT.bzh
+# Object: Forward signal (SIGTERM) to remote process
+# Created on 24-May-2017, 09:23:37
+# Usage: remote-target-populate update script under ./build directory
+
+# Do not change manually use 'make remote-target-populate'
+export RSYNC_TARGET=@RSYNC_TARGET@
+export PROJECT_NAME=@PROJECT_NAME@
+export RSYNC_PREFIX=@RSYNC_PREFIX@/@PROJECT_NAME@
+export AFB_REMPORT=@AFB_REMPORT@
+export AFB_TOKEN=@AFB_TOKEN@
+
+exec ssh -o "StrictHostKeyChecking no" -tt $RSYNC_TARGET << EOF
+ afb-daemon --workdir=$RSYNC_PREFIX --port=$AFB_REMPORT --roothttp=./htdocs --ldpath=./lib --verbose --token=$AFB_TOKEN &
+ PID_DAEMON=\$!
+
+ trap "kill -15 \$PID_DAEMON" INT QUIT TERM EXIT
+
+ # wait for daemon to finish
+ wait \$PID_DAEMON
+ exit
+EOF
diff --git a/conf.d/wgt/config.xml.in b/conf.d/wgt/config.xml.in
new file mode 100644
index 0000000..fab0b9d
--- /dev/null
+++ b/conf.d/wgt/config.xml.in
@@ -0,0 +1,11 @@
+<?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="icon.png"/>
+ <content src="lib/@PROJECT_NAME@" type="application/vnd.agl.service"/>
+ <description>@PROJECT_DESCRIPTION@</description>
+ <author>@PROJECT_AUTHOR@ &lt;@PROJECT_AUTHOR_MAIL@&gt;</author>
+ <license>APL 2.0</license>
+</widget>
+
+
diff --git a/conf.d/wgt/icon.png.in b/conf.d/wgt/icon.png.in
new file mode 100644
index 0000000..3aeb6f0
--- /dev/null
+++ b/conf.d/wgt/icon.png.in
Binary files differ