From e1ef035594fc80baaf5cd571ab4d04023309a906 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Thu, 10 Aug 2017 18:25:48 +0200 Subject: Extending pluggable arch for templates Idea is to be able to use custom templates from home dir and system dir Change-Id: I74b48458f3dcc26b49f8144e042c213691028167 Signed-off-by: Romain Forlot --- autobuild/agl/autobuild.in | 60 ------------ autobuild/linux/autobuild.in | 62 ------------ cmake/CMakeLists.txt.sample | 21 ---- cmake/cmake.d/01-variables.cmake | 9 +- cmake/cmake.d/02-macros.cmake | 22 ++--- cmake/cmake.d/03-extra_targets.cmake | 40 ++++---- cmake/config.cmake.sample | 167 -------------------------------- deb/deb-config.dsc.in | 15 --- deb/deb-config.install.in | 2 - deb/debian.changelog.in | 5 - deb/debian.compat.in | 1 - deb/debian.control.in | 16 --- deb/debian.rules.in | 87 ----------------- gdb/gdb-native-target.ini.in | 35 ------- rpm/rpm-config.spec.in | 62 ------------ samples.d/CMakeLists.txt.sample | 21 ++++ samples.d/config.cmake.sample | 167 ++++++++++++++++++++++++++++++++ samples.d/config.xml.in.sample | 142 +++++++++++++++++++++++++++ samples.d/xds-config.env.sample | 10 ++ ssh/start-on-target.sh.in | 25 ----- template.d/autobuild/agl/autobuild.in | 60 ++++++++++++ template.d/autobuild/linux/autobuild.in | 62 ++++++++++++ template.d/config.xml.in | 9 ++ template.d/deb-config.dsc.in | 15 +++ template.d/deb-config.install.in | 2 + template.d/debian.changelog.in | 5 + template.d/debian.compat.in | 1 + template.d/debian.control.in | 16 +++ template.d/debian.rules.in | 87 +++++++++++++++++ template.d/gdb-native-target.ini.in | 35 +++++++ template.d/install-wgt-on-target.sh.in | 19 ++++ template.d/rpm-config.spec.in | 62 ++++++++++++ template.d/start-on-target.sh.in | 25 +++++ wgt/config.xml.in | 9 -- wgt/config.xml.in.sample | 142 --------------------------- wgt/install-wgt-on-target.sh.in | 19 ---- xds/xds-config.env.sample | 10 -- 37 files changed, 772 insertions(+), 775 deletions(-) delete mode 100755 autobuild/agl/autobuild.in delete mode 100755 autobuild/linux/autobuild.in delete mode 100644 cmake/CMakeLists.txt.sample delete mode 100644 cmake/config.cmake.sample delete mode 100644 deb/deb-config.dsc.in delete mode 100644 deb/deb-config.install.in delete mode 100644 deb/debian.changelog.in delete mode 100644 deb/debian.compat.in delete mode 100644 deb/debian.control.in delete mode 100644 deb/debian.rules.in delete mode 100644 gdb/gdb-native-target.ini.in delete mode 100644 rpm/rpm-config.spec.in create mode 100644 samples.d/CMakeLists.txt.sample create mode 100644 samples.d/config.cmake.sample create mode 100644 samples.d/config.xml.in.sample create mode 100644 samples.d/xds-config.env.sample delete mode 100755 ssh/start-on-target.sh.in create mode 100755 template.d/autobuild/agl/autobuild.in create mode 100755 template.d/autobuild/linux/autobuild.in create mode 100644 template.d/config.xml.in create mode 100644 template.d/deb-config.dsc.in create mode 100644 template.d/deb-config.install.in create mode 100644 template.d/debian.changelog.in create mode 100644 template.d/debian.compat.in create mode 100644 template.d/debian.control.in create mode 100644 template.d/debian.rules.in create mode 100644 template.d/gdb-native-target.ini.in create mode 100755 template.d/install-wgt-on-target.sh.in create mode 100644 template.d/rpm-config.spec.in create mode 100755 template.d/start-on-target.sh.in delete mode 100644 wgt/config.xml.in delete mode 100644 wgt/config.xml.in.sample delete mode 100755 wgt/install-wgt-on-target.sh.in delete mode 100644 xds/xds-config.env.sample diff --git a/autobuild/agl/autobuild.in b/autobuild/agl/autobuild.in deleted file mode 100755 index 759f6be..0000000 --- a/autobuild/agl/autobuild.in +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/make -f -# Copyright (C) 2015, 2016 "IoT.bzh" -# Author "Romain Forlot" -# -# 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. - -THISFILE := $(lastword $(MAKEFILE_LIST)) -BUILD_DIR := $(abspath $(dir $(THISFILE)/../../../../..)/build) -DEST := ${BUILD_DIR}/target - -.PHONY: all clean distclean configure build package help - -all: help - -help: - @echo "List of targets available:" - @echo "" - @echo "- all" - @echo "- clean" - @echo "- distclean" - @echo "- configure" - @echo "- build" - @echo "- package" - @echo "" - @echo "Usage: ./conf.d/autobuild/agl/autobuild package DEST=${HOME}/opt" - @echo "Don't use your build dir as DEST as wgt file is generated at this location" - -clean: - @([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} clean) || echo Nothing to clean - -distclean: - @rm -rf ${BUILD_DIR} - -configure: ${BUILD_DIR}/Makefile - -build: configure - @cmake --build ${BUILD_DIR} ${BUILD_ARGS} --target all - -package: build - @mkdir -p ${BUILD_DIR}/$@/bin - @mkdir -p ${BUILD_DIR}/$@/etc - @mkdir -p ${BUILD_DIR}/$@/lib - @mkdir -p ${BUILD_DIR}/$@/htdocs - @mkdir -p ${BUILD_DIR}/$@/data - @cmake --build ${BUILD_DIR} --target widget - @mkdir -p ${DEST} && cp ${BUILD_DIR}/*wgt ${DEST} - -${BUILD_DIR}/Makefile: - @[ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR} - @[ -f ${BUILD_DIR}/Makefile ] || (cd ${BUILD_DIR} && cmake ${CONFIGURE_ARGS} ..) diff --git a/autobuild/linux/autobuild.in b/autobuild/linux/autobuild.in deleted file mode 100755 index ed39429..0000000 --- a/autobuild/linux/autobuild.in +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/make -f -# Copyright (C) 2015, 2016 "IoT.bzh" -# Author "Romain Forlot" -# -# 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. - -THISFILE := $(lastword $(MAKEFILE_LIST)) -BUILD_DIR := $(abspath $(dir $(THISFILE)/../../../../..)/build) -DEST := ${BUILD_DIR}/target - -.PHONY: all clean distclean configure build package help - -all: help - -help: - @echo "List of targets available:" - @echo "" - @echo "- all" - @echo "- clean" - @echo "- distclean" - @echo "- configure" - @echo "- build" - @echo "- package" - @echo "" - @echo "Usage: ./conf.d/autobuild/agl/autobuild package DEST=${HOME}/opt" - @echo "Don't use your build dir as DEST as wgt file is generated at this location" - -clean: - @([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} clean) || echo Nothing to clean - -distclean: - @rm -rf ${BUILD_DIR} - -configure: ${BUILD_DIR}/Makefile - -build: configure - @cmake --build ${BUILD_DIR} ${BUILD_ARGS} --target all - -package: build - @mkdir -p ${BUILD_DIR}/$@/bin - @mkdir -p ${BUILD_DIR}/$@/etc - @mkdir -p ${BUILD_DIR}/$@/lib - @mkdir -p ${BUILD_DIR}/$@/htdocs - @mkdir -p ${BUILD_DIR}/$@/data - @cmake --build ${BUILD_DIR} --target packaging - @cmake --build ${BUILD_DIR} --target widget - @mkdir -p ${DEST} && cp ${BUILD_DIR}/*wgt ${DEST} - - -${BUILD_DIR}/Makefile: - @[ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR} - @[ -f ${BUILD_DIR}/Makefile ] || (cd ${BUILD_DIR} && cmake ${CONFIGURE_ARGS} ..) diff --git a/cmake/CMakeLists.txt.sample b/cmake/CMakeLists.txt.sample deleted file mode 100644 index b485097..0000000 --- a/cmake/CMakeLists.txt.sample +++ /dev/null @@ -1,21 +0,0 @@ -########################################################################### -# Copyright 2015, 2016, 2017 IoT.bzh -# -# author: Romain Forlot -# -# 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. -########################################################################### - -CMAKE_MINIMUM_REQUIRED(VERSION 3.3) - -include(${CMAKE_CURRENT_SOURCE_DIR}/conf.d/cmake/config.cmake) diff --git a/cmake/cmake.d/01-variables.cmake b/cmake/cmake.d/01-variables.cmake index 5118b57..867a723 100644 --- a/cmake/cmake.d/01-variables.cmake +++ b/cmake/cmake.d/01-variables.cmake @@ -116,14 +116,11 @@ endif() # Paths to templates files set (PKG_TEMPLATE_PREFIX ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR} CACHE PATH "Default Package Templates Directory") -set(SSH_TEMPLATE_DIR "${PKG_TEMPLATE_PREFIX}/ssh" CACHE PATH "Subpath to a directory where are stored needed files to launch on remote target to debuging purposes") -set(GDB_TEMPLATE_DIR "${PKG_TEMPLATE_PREFIX}/gdb" CACHE PATH "Subpath to a directory where are stored needed files to launch debuging server on a remote target. Use gdbserver.") -set(WGT_TEMPLATE_DIR "${PKG_TEMPLATE_PREFIX}/wgt" CACHE PATH "Subpath to a directory where are stored needed files to build widget") +set(TEMPLATE_DIR "${PKG_TEMPLATE_PREFIX}/cmake/template.d" CACHE PATH "Subpath to a directory where are stored needed files to launch on remote target to debuging purposes") + if(NOT WIDGET_CONFIG_TEMPLATE) - set(WIDGET_CONFIG_TEMPLATE ${WGT_TEMPLATE_DIR}/config.xml.in CACHE PATH "Path to widget config file template (config.xml.in)") + set(WIDGET_CONFIG_TEMPLATE ${TEMPLATE_DIR}/config.xml.in CACHE PATH "Path to widget config file template (config.xml.in)") endif() -set(RPM_TEMPLATE_DIR "${PKG_TEMPLATE_PREFIX}/rpm" CACHE PATH "Subpath to a directory where are stored needed files to build rpm package") -set(DEB_TEMPLATE_DIR "${PKG_TEMPLATE_PREFIX}/deb" CACHE PATH "Subpath to a directory where are stored needed files to build deb package") string(REGEX REPLACE "^(.*)/.*$" "\\1" ENTRY_POINT "${PKG_TEMPLATE_PREFIX}") set(PROJECT_PKG_ENTRY_POINT ${ENTRY_POINT}/packaging CACHE PATH "Where package build files, like rpm.spec file or config.xml, are write.") diff --git a/cmake/cmake.d/02-macros.cmake b/cmake/cmake.d/02-macros.cmake index e116d2e..3787817 100644 --- a/cmake/cmake.d/02-macros.cmake +++ b/cmake/cmake.d/02-macros.cmake @@ -185,8 +185,8 @@ macro(remote_targets_populate) endif() endif() - configure_files_in_dir(${SSH_TEMPLATE_DIR}) - configure_files_in_dir(${GDB_TEMPLATE_DIR}) + configure_files_in_dir(${TEMPLATE_DIR}) + configure_files_in_dir(${TEMPLATE_DIR}) add_custom_target(remote-target-populate COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/target/*.sh @@ -201,8 +201,8 @@ macro(wgt_package_build) if(NOT EXISTS ${WIDGET_CONFIG_TEMPLATE}) MESSAGE(FATAL_ERROR "${Red}WARNING ! Missing mandatory files to build widget file.\nYou need a config.xml template: please specify WIDGET_CONFIG_TEMPLATE correctly.${ColourReset}") endif() - if(NOT EXISTS ${WGT_TEMPLATE_DIR}/icon-default.png) - MESSAGE(FATAL_ERROR "${Red}WARNING ! Missing mandatory files to build widget file.\nYou need ${PROJECT_ICON} file in ${WGT_TEMPLATE_DIR} folder.${ColourReset}") + if(NOT EXISTS ${TEMPLATE_DIR}/icon-default.png) + MESSAGE(FATAL_ERROR "${Red}WARNING ! Missing mandatory files to build widget file.\nYou need ${PROJECT_ICON} file in ${TEMPLATE_DIR} folder.${ColourReset}") endif() if(NOT WIDGET_TYPE) MESSAGE(FATAL_ERROR "WIDGET_TYPE must be set in your config.cmake.\neg.: set(WIDGET_TYPE application/vnd.agl.service)") @@ -214,15 +214,15 @@ macro(wgt_package_build) add_custom_command(OUTPUT ${PROJECT_PKG_BUILD_DIR}/config.xml COMMAND ${CMAKE_COMMAND} -DINFILE=${WIDGET_CONFIG_TEMPLATE} -DOUTFILE=${PROJECT_PKG_BUILD_DIR}/config.xml -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake - COMMAND cp ${WGT_TEMPLATE_DIR}/icon-default.png ${PROJECT_PKG_BUILD_DIR}/${PROJECT_ICON} + COMMAND cp ${TEMPLATE_DIR}/icon-default.png ${PROJECT_PKG_BUILD_DIR}/${PROJECT_ICON} ) add_custom_target(packaging_wgt DEPENDS ${PROJECT_PKG_BUILD_DIR}/config.xml) # Fulup ??? copy any extra file in wgt/etc into populate package before building the widget - file(GLOB PROJECT_CONF_FILES "${WGT_TEMPLATE_DIR}/etc/*") + file(GLOB PROJECT_CONF_FILES "${TEMPLATE_DIR}/etc/*") if(${PROJECT_CONF_FILES}) - file(COPY "${WGT_TEMPLATE_DIR}/etc/*" DESTINATION ${PROJECT_PKG_BUILD_DIR}/etc/) + file(COPY "${TEMPLATE_DIR}/etc/*" DESTINATION ${PROJECT_PKG_BUILD_DIR}/etc/) endif(${PROJECT_CONF_FILES}) add_custom_command(OUTPUT ${PROJECT_NAME}.wgt @@ -241,7 +241,7 @@ macro(wgt_package_build) COMMAND exit -1 ) else() - configure_files_in_dir(${WGT_TEMPLATE_DIR}) + configure_files_in_dir(${TEMPLATE_DIR}) add_custom_target(widget-target-install DEPENDS widget COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/target/install-wgt-on-${RSYNC_TARGET}.sh @@ -279,15 +279,15 @@ macro(deb_package_build) endmacro(deb_package_build) macro(project_package_build) - if(EXISTS ${RPM_TEMPLATE_DIR}) + if(EXISTS ${TEMPLATE_DIR}) rpm_package_build() endif() - if(EXISTS ${WGT_TEMPLATE_DIR}) + if(EXISTS ${TEMPLATE_DIR}) wgt_package_build() endif() - if(EXISTS ${DEB_TEMPLATE_DIR}) + if(EXISTS ${TEMPLATE_DIR}) deb_package_build() endif() endmacro(project_package_build) diff --git a/cmake/cmake.d/03-extra_targets.cmake b/cmake/cmake.d/03-extra_targets.cmake index 61f5adb..2c635db 100644 --- a/cmake/cmake.d/03-extra_targets.cmake +++ b/cmake/cmake.d/03-extra_targets.cmake @@ -93,8 +93,8 @@ foreach (PKG_CONFIG ${PKG_REQUIRED_LIST}) endif() endforeach() -if(NOT EXISTS ${RPM_TEMPLATE_DIR}/rpm-config.spec.in) - MESSAGE(FATAL_ERROR "${Red}Missing mandatory files: you need rpm-config.spec.in in ${RPM_TEMPLATE_DIR} folder.${ColourReset}") +if(NOT EXISTS ${TEMPLATE_DIR}/rpm-config.spec.in) + MESSAGE(FATAL_ERROR "${Red}Missing mandatory files: you need rpm-config.spec.in in ${TEMPLATE_DIR} folder.${ColourReset}") endif() # Because the tool "dpkg" is used on the packages db to find the @@ -102,25 +102,25 @@ endif() # to test the OS release package type # Only doable within a native environment not under SDK if(OSRELEASE MATCHES "debian" AND NOT DEFINED ENV{SDKTARGETSYSROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE) - add_custom_target(packaging_deb DEPENDS ${DEB_TEMPLATE_DIR}/debian.compat.in - ${DEB_TEMPLATE_DIR}/debian.changelog.in - ${DEB_TEMPLATE_DIR}/deb-config.dsc.in - ${DEB_TEMPLATE_DIR}/deb-config.install.in - ${DEB_TEMPLATE_DIR}/debian.control.in - ${DEB_TEMPLATE_DIR}/debian.rules.in - COMMAND ${CMAKE_COMMAND} -DINFILE=${DEB_TEMPLATE_DIR}/debian.compat.in -DOUTFILE=${PACKAGING_DEB_OUTPUT_COMPAT} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake - COMMAND ${CMAKE_COMMAND} -DINFILE=${DEB_TEMPLATE_DIR}/debian.changelog.in -DOUTFILE=${PACKAGING_DEB_OUTPUT_CHANGELOG} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake - COMMAND ${CMAKE_COMMAND} -DINFILE=${DEB_TEMPLATE_DIR}/deb-config.dsc.in -DOUTFILE=${PACKAGING_DEB_OUTPUT_DSC} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake - COMMAND ${CMAKE_COMMAND} -DINFILE=${DEB_TEMPLATE_DIR}/deb-config.install.in -DOUTFILE=${PACKAGING_DEB_OUTPUT_INSTALL} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake - COMMAND ${CMAKE_COMMAND} -DINFILE=${DEB_TEMPLATE_DIR}/debian.control.in -DOUTFILE=${PACKAGING_DEB_OUTPUT_CONTROL} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake - COMMAND ${CMAKE_COMMAND} -DINFILE=${DEB_TEMPLATE_DIR}/debian.rules.in -DOUTFILE=${PACKAGING_DEB_OUTPUT_RULES} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake + add_custom_target(packaging_deb DEPENDS ${TEMPLATE_DIR}/debian.compat.in + ${TEMPLATE_DIR}/debian.changelog.in + ${TEMPLATE_DIR}/deb-config.dsc.in + ${TEMPLATE_DIR}/deb-config.install.in + ${TEMPLATE_DIR}/debian.control.in + ${TEMPLATE_DIR}/debian.rules.in + COMMAND ${CMAKE_COMMAND} -DINFILE=${TEMPLATE_DIR}/debian.compat.in -DOUTFILE=${PACKAGING_DEB_OUTPUT_COMPAT} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake + COMMAND ${CMAKE_COMMAND} -DINFILE=${TEMPLATE_DIR}/debian.changelog.in -DOUTFILE=${PACKAGING_DEB_OUTPUT_CHANGELOG} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake + COMMAND ${CMAKE_COMMAND} -DINFILE=${TEMPLATE_DIR}/deb-config.dsc.in -DOUTFILE=${PACKAGING_DEB_OUTPUT_DSC} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake + COMMAND ${CMAKE_COMMAND} -DINFILE=${TEMPLATE_DIR}/deb-config.install.in -DOUTFILE=${PACKAGING_DEB_OUTPUT_INSTALL} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake + COMMAND ${CMAKE_COMMAND} -DINFILE=${TEMPLATE_DIR}/debian.control.in -DOUTFILE=${PACKAGING_DEB_OUTPUT_CONTROL} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake + COMMAND ${CMAKE_COMMAND} -DINFILE=${TEMPLATE_DIR}/debian.rules.in -DOUTFILE=${PACKAGING_DEB_OUTPUT_RULES} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake ) endif() add_custom_target(packaging) set(PACKAGING_SPEC_OUTPUT ${PROJECT_PKG_ENTRY_POINT}/${NPKG_PROJECT_NAME}.spec) -add_custom_target(packaging_rpm DEPENDS ${RPM_TEMPLATE_DIR}/rpm-config.spec.in - COMMAND ${CMAKE_COMMAND} -DINFILE=${RPM_TEMPLATE_DIR}/rpm-config.spec.in -DOUTFILE=${PACKAGING_SPEC_OUTPUT} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake +add_custom_target(packaging_rpm DEPENDS ${TEMPLATE_DIR}/rpm-config.spec.in + COMMAND ${CMAKE_COMMAND} -DINFILE=${TEMPLATE_DIR}/rpm-config.spec.in -DOUTFILE=${PACKAGING_SPEC_OUTPUT} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake ) add_dependencies(packaging packaging_rpm) if(TARGET packaging_wgt) @@ -152,8 +152,8 @@ endforeach() # Autobuild target # ---------------------------------------------------------------------------- -add_custom_target(autobuild ALL DEPENDS ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/autobuild/agl/autobuild.in - ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/autobuild/linux/autobuild.in - COMMAND ${CMAKE_COMMAND} -DINFILE=${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/autobuild/agl/autobuild.in -DOUTFILE=${PROJECT_TEMPLATE_AGL_AUTOBUILD_DIR}/autobuild -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake - COMMAND ${CMAKE_COMMAND} -DINFILE=${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/autobuild/agl/autobuild.in -DOUTFILE=${PROJECT_TEMPLATE_LINUX_AUTOBUILD_DIR}/autobuild -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake +add_custom_target(autobuild ALL DEPENDS ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/template.d/autobuild/agl/autobuild.in + ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/template.d/autobuild/linux/autobuild.in + COMMAND ${CMAKE_COMMAND} -DINFILE=${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/template.d/autobuild/agl/autobuild.in -DOUTFILE=${PROJECT_TEMPLATE_AGL_AUTOBUILD_DIR}/autobuild -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake + COMMAND ${CMAKE_COMMAND} -DINFILE=${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/template.d/autobuild/agl/autobuild.in -DOUTFILE=${PROJECT_TEMPLATE_LINUX_AUTOBUILD_DIR}/autobuild -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake ) diff --git a/cmake/config.cmake.sample b/cmake/config.cmake.sample deleted file mode 100644 index f5ac42a..0000000 --- a/cmake/config.cmake.sample +++ /dev/null @@ -1,167 +0,0 @@ -########################################################################### -# Copyright 2015, 2016, 2017 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 example) -set(PROJECT_VERSION "0.0") -set(PROJECT_PRETTY_NAME "Example") -set(PROJECT_DESCRIPTION "AGL application example") -set(PROJECT_URL "https://gerrit.automotivelinux.org/gerrit/apps/app-templates") -set(PROJECT_ICON "icon.png") -set(PROJECT_AUTHOR "Last Name, First Name") -set(PROJECT_AUTHOR_MAIL "example.man@bigouden.bzh") -set(PROJECT_LICENSE "APL2.0") -set(PROJECT_LANGUAGES,"C") - -# Where are stored default templates files from submodule or subtree app-templates in your project tree -# relative to the root project directory -set(PROJECT_APP_TEMPLATES_DIR "conf.d/app-templates") - -# 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(CMAKE_BUILD_TYPE "DEBUG") - -# 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 - libsystemd>=222 - afb-daemon - libmicrohttpd>=0.9.55 -) - -# 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(CMAKE_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_CONFIG_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/conf.d/wgt/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 MimeType_Not_Set) - -# 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 EntryPoint_Path_Not_Set) - -# 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") - -# This include is mandatory and MUST happens at the end -# of this file, else you expose you to unexpected behavior -# ----------------------------------------------------------- -include(${PROJECT_APP_TEMPLATES_DIR}/cmake/common.cmake) diff --git a/deb/deb-config.dsc.in b/deb/deb-config.dsc.in deleted file mode 100644 index 28a4835..0000000 --- a/deb/deb-config.dsc.in +++ /dev/null @@ -1,15 +0,0 @@ -Format: @PROJECT_VERSION@ -Source: @NPKG_PROJECT_NAME@ -Binary: @NPKG_PROJECT_NAME@-bin -Architecture: any -Version: 2.0-0 -Maintainer: @PROJECT_AUTHOR@ <@PROJECT_AUTHOR_MAIL@> -Standards-Version: 3.8.2 -Homepage: @PROJECT_URL@ -Build-Depends: debhelper (>= 5), - pkg-config, - cmake, - gcc, - g++, -@DEB_PKG_DEPS@ -Debtransform-Tar: @NPKG_PROJECT_NAME@_@PROJECT_VERSION@.orig.tar.gz diff --git a/deb/deb-config.install.in b/deb/deb-config.install.in deleted file mode 100644 index 5858efd..0000000 --- a/deb/deb-config.install.in +++ /dev/null @@ -1,2 +0,0 @@ -/opt/AGL/* -/etc/profile.d/* diff --git a/deb/debian.changelog.in b/deb/debian.changelog.in deleted file mode 100644 index f72c717..0000000 --- a/deb/debian.changelog.in +++ /dev/null @@ -1,5 +0,0 @@ -@NPKG_PROJECT_NAME@ (@PROJECT_VERSION@-0) UNRELEASED; urgency=low - - * init build - - -- @PROJECT_AUTHOR@ <@PROJECT_AUTHOR_MAIL@> Mon, 25 Dec 2007 10:50:38 +0100 diff --git a/deb/debian.compat.in b/deb/debian.compat.in deleted file mode 100644 index 45a4fb7..0000000 --- a/deb/debian.compat.in +++ /dev/null @@ -1 +0,0 @@ -8 diff --git a/deb/debian.control.in b/deb/debian.control.in deleted file mode 100644 index ea4ad8a..0000000 --- a/deb/debian.control.in +++ /dev/null @@ -1,16 +0,0 @@ -Priority: optional -Maintainer: @PROJECT_AUTHOR@ <@PROJECT_AUTHOR_MAIL@> -Source: @NPKG_PROJECT_NAME@ -Build-Depends: debhelper (>= 5), - pkg-config, - cmake, - gcc, - g++, -@DEB_PKG_DEPS@ -Standards-Version: 3.8.2 -Homepage: @PROJECT_URL@ - -Package: @NPKG_PROJECT_NAME@ -Section: libs -Architecture: any -Description: @PROJECT_DESCRIPTION@ diff --git a/deb/debian.rules.in b/deb/debian.rules.in deleted file mode 100644 index 6bb2825..0000000 --- a/deb/debian.rules.in +++ /dev/null @@ -1,87 +0,0 @@ -#!/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/@PROJECT_NAME@ -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/@PROJECT_NAME@;cd build;make populate;cp -r package/* ../debian/tmp/opt/AGL/@PROJECT_NAME@/ - mkdir -p debian/tmp/etc/profile.d - echo '#---------- AGL @PROJECT_NAME@ options Start ---------" ' > debian/tmp/etc/profile.d/AGL_@PROJECT_NAME@.sh - echo '# Object: AGL cmake option for binder/bindings' >> debian/tmp/etc/profile.d/AGL_@PROJECT_NAME@.sh - echo 'export LD_LIBRARY_PATH=/opt/AGL/@PROJECT_NAME@/lib/$(DEB_HOST_MULTIARCH):$$LD_LIBRARY_PATH' >> debian/tmp/etc/profile.d/AGL_@PROJECT_NAME@.sh - echo 'export LIBRARY_PATH=/opt/AGL/@PROJECT_NAME@/lib/$(DEB_HOST_MULTIARCH):$$LIBRARY_PATH' >> debian/tmp/etc/profile.d/AGL_@PROJECT_NAME@.sh - echo 'export PATH=/opt/AGL/@PROJECT_NAME@/bin:$$PATH' >> debian/tmp/etc/profile.d/AGL_@PROJECT_NAME@.sh - echo '#---------- AGL options End ---------' >> debian/tmp/etc/profile.d/AGL_@PROJECT_NAME@.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/gdb/gdb-native-target.ini.in b/gdb/gdb-native-target.ini.in deleted file mode 100644 index 1ba6bdb..0000000 --- a/gdb/gdb-native-target.ini.in +++ /dev/null @@ -1,35 +0,0 @@ -# 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/ -# -# Warning: In remote native mode netbeans impose debug-command to point on a local instance of afb-daemon binary - -# Fulup Hoops: --ldpath should be absolute as solib-search-path refuse to work as documented - -# Start gdbserver on target and connect through SSH link WARNING: -target remote | ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null @RSYNC_TARGET@ gdbserver - afb-daemon --port=@AFB_REMPORT@ --workdir=$HOME/@RSYNC_PREFIX@/@PROJECT_NAME@ --roothttp=htdocs --ldpaths=$HOME/@RSYNC_PREFIX@/@PROJECT_NAME@/lib --verbose --token=@AFB_TOKEN@ - -# Disable auto answer no on questions and to set breakpoint -set confirm off - -# Disable auto load of libraries to improved perf -set auto-solib-add off - -# Define path for project libraries -set solib-search-path ${PROJECT_PKG_BUILD_DIR} - -# Replace run by continue (gdb use 'run' when gdbserver wants 'continue') -define run -continue -end - -# Manually load project libraries when loaded by afb-daemon -tbreak @GDB_INITIAL_BREAK@ -commands -sharedlibrary @RSYNC_PREFIX@/@PROJECT_NAME@ -continue -end - - diff --git a/rpm/rpm-config.spec.in b/rpm/rpm-config.spec.in deleted file mode 100644 index 8b3d442..0000000 --- a/rpm/rpm-config.spec.in +++ /dev/null @@ -1,62 +0,0 @@ -########################################################################### -# Copyright 2015, 2016, 2017 IoT.bzh -# -# author: @PROJECT_AUTHOR@ <@PROJECT_AUTHOR_MAIL@> -# -# 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: @NPKG_PROJECT_NAME@ -Version: @PROJECT_VERSION@ -Release: 1 -Group: AGL -License: @PROJECT_LICENSE@ -Summary: @PROJECT_DESCRIPTION@ -Url: @PROJECT_URL@ -Source0: %{name}_%{version}.orig.tar.gz - -BuildRequires: cmake -BuildRequires: gcc gcc-c++ -@RPM_PKG_DEPS@ - -BuildRoot: %{_tmppath}/%{name}-%{version}-build - -%define _prefix /opt/AGL/@PROJECT_NAME@ -%define __cmake cmake - -%description -@PROJECT_DESCRIPTION@ - -%prep -%setup -q - -%build -%cmake -DBINDINGS_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/samples.d/CMakeLists.txt.sample b/samples.d/CMakeLists.txt.sample new file mode 100644 index 0000000..b485097 --- /dev/null +++ b/samples.d/CMakeLists.txt.sample @@ -0,0 +1,21 @@ +########################################################################### +# Copyright 2015, 2016, 2017 IoT.bzh +# +# author: Romain Forlot +# +# 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. +########################################################################### + +CMAKE_MINIMUM_REQUIRED(VERSION 3.3) + +include(${CMAKE_CURRENT_SOURCE_DIR}/conf.d/cmake/config.cmake) diff --git a/samples.d/config.cmake.sample b/samples.d/config.cmake.sample new file mode 100644 index 0000000..f5ac42a --- /dev/null +++ b/samples.d/config.cmake.sample @@ -0,0 +1,167 @@ +########################################################################### +# Copyright 2015, 2016, 2017 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 example) +set(PROJECT_VERSION "0.0") +set(PROJECT_PRETTY_NAME "Example") +set(PROJECT_DESCRIPTION "AGL application example") +set(PROJECT_URL "https://gerrit.automotivelinux.org/gerrit/apps/app-templates") +set(PROJECT_ICON "icon.png") +set(PROJECT_AUTHOR "Last Name, First Name") +set(PROJECT_AUTHOR_MAIL "example.man@bigouden.bzh") +set(PROJECT_LICENSE "APL2.0") +set(PROJECT_LANGUAGES,"C") + +# Where are stored default templates files from submodule or subtree app-templates in your project tree +# relative to the root project directory +set(PROJECT_APP_TEMPLATES_DIR "conf.d/app-templates") + +# 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(CMAKE_BUILD_TYPE "DEBUG") + +# 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 + libsystemd>=222 + afb-daemon + libmicrohttpd>=0.9.55 +) + +# 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(CMAKE_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_CONFIG_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/conf.d/wgt/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 MimeType_Not_Set) + +# 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 EntryPoint_Path_Not_Set) + +# 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") + +# This include is mandatory and MUST happens at the end +# of this file, else you expose you to unexpected behavior +# ----------------------------------------------------------- +include(${PROJECT_APP_TEMPLATES_DIR}/cmake/common.cmake) diff --git a/samples.d/config.xml.in.sample b/samples.d/config.xml.in.sample new file mode 100644 index 0000000..b93f3d9 --- /dev/null +++ b/samples.d/config.xml.in.sample @@ -0,0 +1,142 @@ + + + @PROJECT_NAME@ + + + @PROJECT_DESCRIPTION@ + @PROJECT_AUTHOR@ <@PROJECT_AUTHOR_MAIL@> + @PROJECT_LICENSE@ + + + + + + + + + diff --git a/samples.d/xds-config.env.sample b/samples.d/xds-config.env.sample new file mode 100644 index 0000000..a4c51b1 --- /dev/null +++ b/samples.d/xds-config.env.sample @@ -0,0 +1,10 @@ +XDS_PROJECT_ID=W2EAQBA-HQI75XA_unicens2-binding +XDS_SDK_ID=poky-agl_aarch64_3.99.1+snapshot +XDS_SERVER_URL=localhost:8000 + +DOCKER_TARGET=docker-sdk + +RSYNC_TARGET=root@192.168.168.11 +RSYNC_PREFIX=./opt +PROJECT_DIR=/home/seb/tmp/unicens2-binding + diff --git a/ssh/start-on-target.sh.in b/ssh/start-on-target.sh.in deleted file mode 100755 index 9e3a60d..0000000 --- a/ssh/start-on-target.sh.in +++ /dev/null @@ -1,25 +0,0 @@ -#!/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 -o UserKnownHostsFile=/dev/null -tt $RSYNC_TARGET << EOF - afb-daemon --workdir=$RSYNC_PREFIX --port=$AFB_REMPORT --roothttp=./htdocs --ldpath=./lib --verbose --token=$AFB_TOKEN & - PID_DAEMON=\$! - - trap "echo REMOTE-SIGNAL TRAP; kill -15 \$PID_DAEMON" INT QUIT TERM EXIT - - # wait for daemon to finish - wait \$PID_DAEMON - exit -EOF diff --git a/template.d/autobuild/agl/autobuild.in b/template.d/autobuild/agl/autobuild.in new file mode 100755 index 0000000..759f6be --- /dev/null +++ b/template.d/autobuild/agl/autobuild.in @@ -0,0 +1,60 @@ +#!/usr/bin/make -f +# Copyright (C) 2015, 2016 "IoT.bzh" +# Author "Romain Forlot" +# +# 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. + +THISFILE := $(lastword $(MAKEFILE_LIST)) +BUILD_DIR := $(abspath $(dir $(THISFILE)/../../../../..)/build) +DEST := ${BUILD_DIR}/target + +.PHONY: all clean distclean configure build package help + +all: help + +help: + @echo "List of targets available:" + @echo "" + @echo "- all" + @echo "- clean" + @echo "- distclean" + @echo "- configure" + @echo "- build" + @echo "- package" + @echo "" + @echo "Usage: ./conf.d/autobuild/agl/autobuild package DEST=${HOME}/opt" + @echo "Don't use your build dir as DEST as wgt file is generated at this location" + +clean: + @([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} clean) || echo Nothing to clean + +distclean: + @rm -rf ${BUILD_DIR} + +configure: ${BUILD_DIR}/Makefile + +build: configure + @cmake --build ${BUILD_DIR} ${BUILD_ARGS} --target all + +package: build + @mkdir -p ${BUILD_DIR}/$@/bin + @mkdir -p ${BUILD_DIR}/$@/etc + @mkdir -p ${BUILD_DIR}/$@/lib + @mkdir -p ${BUILD_DIR}/$@/htdocs + @mkdir -p ${BUILD_DIR}/$@/data + @cmake --build ${BUILD_DIR} --target widget + @mkdir -p ${DEST} && cp ${BUILD_DIR}/*wgt ${DEST} + +${BUILD_DIR}/Makefile: + @[ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR} + @[ -f ${BUILD_DIR}/Makefile ] || (cd ${BUILD_DIR} && cmake ${CONFIGURE_ARGS} ..) diff --git a/template.d/autobuild/linux/autobuild.in b/template.d/autobuild/linux/autobuild.in new file mode 100755 index 0000000..ed39429 --- /dev/null +++ b/template.d/autobuild/linux/autobuild.in @@ -0,0 +1,62 @@ +#!/usr/bin/make -f +# Copyright (C) 2015, 2016 "IoT.bzh" +# Author "Romain Forlot" +# +# 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. + +THISFILE := $(lastword $(MAKEFILE_LIST)) +BUILD_DIR := $(abspath $(dir $(THISFILE)/../../../../..)/build) +DEST := ${BUILD_DIR}/target + +.PHONY: all clean distclean configure build package help + +all: help + +help: + @echo "List of targets available:" + @echo "" + @echo "- all" + @echo "- clean" + @echo "- distclean" + @echo "- configure" + @echo "- build" + @echo "- package" + @echo "" + @echo "Usage: ./conf.d/autobuild/agl/autobuild package DEST=${HOME}/opt" + @echo "Don't use your build dir as DEST as wgt file is generated at this location" + +clean: + @([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} clean) || echo Nothing to clean + +distclean: + @rm -rf ${BUILD_DIR} + +configure: ${BUILD_DIR}/Makefile + +build: configure + @cmake --build ${BUILD_DIR} ${BUILD_ARGS} --target all + +package: build + @mkdir -p ${BUILD_DIR}/$@/bin + @mkdir -p ${BUILD_DIR}/$@/etc + @mkdir -p ${BUILD_DIR}/$@/lib + @mkdir -p ${BUILD_DIR}/$@/htdocs + @mkdir -p ${BUILD_DIR}/$@/data + @cmake --build ${BUILD_DIR} --target packaging + @cmake --build ${BUILD_DIR} --target widget + @mkdir -p ${DEST} && cp ${BUILD_DIR}/*wgt ${DEST} + + +${BUILD_DIR}/Makefile: + @[ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR} + @[ -f ${BUILD_DIR}/Makefile ] || (cd ${BUILD_DIR} && cmake ${CONFIGURE_ARGS} ..) diff --git a/template.d/config.xml.in b/template.d/config.xml.in new file mode 100644 index 0000000..35d20b8 --- /dev/null +++ b/template.d/config.xml.in @@ -0,0 +1,9 @@ + + + @PROJECT_NAME@ + + + @PROJECT_DESCRIPTION@ + @PROJECT_AUTHOR@ <@PROJECT_AUTHOR_MAIL@> + @PROJECT_LICENSE@ + diff --git a/template.d/deb-config.dsc.in b/template.d/deb-config.dsc.in new file mode 100644 index 0000000..28a4835 --- /dev/null +++ b/template.d/deb-config.dsc.in @@ -0,0 +1,15 @@ +Format: @PROJECT_VERSION@ +Source: @NPKG_PROJECT_NAME@ +Binary: @NPKG_PROJECT_NAME@-bin +Architecture: any +Version: 2.0-0 +Maintainer: @PROJECT_AUTHOR@ <@PROJECT_AUTHOR_MAIL@> +Standards-Version: 3.8.2 +Homepage: @PROJECT_URL@ +Build-Depends: debhelper (>= 5), + pkg-config, + cmake, + gcc, + g++, +@DEB_PKG_DEPS@ +Debtransform-Tar: @NPKG_PROJECT_NAME@_@PROJECT_VERSION@.orig.tar.gz diff --git a/template.d/deb-config.install.in b/template.d/deb-config.install.in new file mode 100644 index 0000000..5858efd --- /dev/null +++ b/template.d/deb-config.install.in @@ -0,0 +1,2 @@ +/opt/AGL/* +/etc/profile.d/* diff --git a/template.d/debian.changelog.in b/template.d/debian.changelog.in new file mode 100644 index 0000000..f72c717 --- /dev/null +++ b/template.d/debian.changelog.in @@ -0,0 +1,5 @@ +@NPKG_PROJECT_NAME@ (@PROJECT_VERSION@-0) UNRELEASED; urgency=low + + * init build + + -- @PROJECT_AUTHOR@ <@PROJECT_AUTHOR_MAIL@> Mon, 25 Dec 2007 10:50:38 +0100 diff --git a/template.d/debian.compat.in b/template.d/debian.compat.in new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/template.d/debian.compat.in @@ -0,0 +1 @@ +8 diff --git a/template.d/debian.control.in b/template.d/debian.control.in new file mode 100644 index 0000000..ea4ad8a --- /dev/null +++ b/template.d/debian.control.in @@ -0,0 +1,16 @@ +Priority: optional +Maintainer: @PROJECT_AUTHOR@ <@PROJECT_AUTHOR_MAIL@> +Source: @NPKG_PROJECT_NAME@ +Build-Depends: debhelper (>= 5), + pkg-config, + cmake, + gcc, + g++, +@DEB_PKG_DEPS@ +Standards-Version: 3.8.2 +Homepage: @PROJECT_URL@ + +Package: @NPKG_PROJECT_NAME@ +Section: libs +Architecture: any +Description: @PROJECT_DESCRIPTION@ diff --git a/template.d/debian.rules.in b/template.d/debian.rules.in new file mode 100644 index 0000000..6bb2825 --- /dev/null +++ b/template.d/debian.rules.in @@ -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/@PROJECT_NAME@ -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/@PROJECT_NAME@;cd build;make populate;cp -r package/* ../debian/tmp/opt/AGL/@PROJECT_NAME@/ + mkdir -p debian/tmp/etc/profile.d + echo '#---------- AGL @PROJECT_NAME@ options Start ---------" ' > debian/tmp/etc/profile.d/AGL_@PROJECT_NAME@.sh + echo '# Object: AGL cmake option for binder/bindings' >> debian/tmp/etc/profile.d/AGL_@PROJECT_NAME@.sh + echo 'export LD_LIBRARY_PATH=/opt/AGL/@PROJECT_NAME@/lib/$(DEB_HOST_MULTIARCH):$$LD_LIBRARY_PATH' >> debian/tmp/etc/profile.d/AGL_@PROJECT_NAME@.sh + echo 'export LIBRARY_PATH=/opt/AGL/@PROJECT_NAME@/lib/$(DEB_HOST_MULTIARCH):$$LIBRARY_PATH' >> debian/tmp/etc/profile.d/AGL_@PROJECT_NAME@.sh + echo 'export PATH=/opt/AGL/@PROJECT_NAME@/bin:$$PATH' >> debian/tmp/etc/profile.d/AGL_@PROJECT_NAME@.sh + echo '#---------- AGL options End ---------' >> debian/tmp/etc/profile.d/AGL_@PROJECT_NAME@.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/template.d/gdb-native-target.ini.in b/template.d/gdb-native-target.ini.in new file mode 100644 index 0000000..1ba6bdb --- /dev/null +++ b/template.d/gdb-native-target.ini.in @@ -0,0 +1,35 @@ +# 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/ +# +# Warning: In remote native mode netbeans impose debug-command to point on a local instance of afb-daemon binary + +# Fulup Hoops: --ldpath should be absolute as solib-search-path refuse to work as documented + +# Start gdbserver on target and connect through SSH link WARNING: +target remote | ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null @RSYNC_TARGET@ gdbserver - afb-daemon --port=@AFB_REMPORT@ --workdir=$HOME/@RSYNC_PREFIX@/@PROJECT_NAME@ --roothttp=htdocs --ldpaths=$HOME/@RSYNC_PREFIX@/@PROJECT_NAME@/lib --verbose --token=@AFB_TOKEN@ + +# Disable auto answer no on questions and to set breakpoint +set confirm off + +# Disable auto load of libraries to improved perf +set auto-solib-add off + +# Define path for project libraries +set solib-search-path ${PROJECT_PKG_BUILD_DIR} + +# Replace run by continue (gdb use 'run' when gdbserver wants 'continue') +define run +continue +end + +# Manually load project libraries when loaded by afb-daemon +tbreak @GDB_INITIAL_BREAK@ +commands +sharedlibrary @RSYNC_PREFIX@/@PROJECT_NAME@ +continue +end + + diff --git a/template.d/install-wgt-on-target.sh.in b/template.d/install-wgt-on-target.sh.in new file mode 100755 index 0000000..39a69d5 --- /dev/null +++ b/template.d/install-wgt-on-target.sh.in @@ -0,0 +1,19 @@ +#!/bin/sh +# +# File: install-wgt-on-target.sh +# Author: Sebastien Douheret @ IoT.bzh +# Object: install widget on target +# Created on 24-May-2017, 09:23:37 +# Usage: + +# Do not change manually use 'make remote-target-populate' +export RSYNC_TARGET=@RSYNC_TARGET@ +export WGT_FILE_L=@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.wgt +export WGT_FILE_T=/tmp/@PROJECT_NAME@.wgt + +scp $WGT_FILE_L $RSYNC_TARGET:$WGT_FILE_T \ + && ssh -o "StrictHostKeyChecking no" -tt $RSYNC_TARGET -- \ + afm-util install $WGT_FILE_T + +# && rm -f $WGT_FILE_T + diff --git a/template.d/rpm-config.spec.in b/template.d/rpm-config.spec.in new file mode 100644 index 0000000..8b3d442 --- /dev/null +++ b/template.d/rpm-config.spec.in @@ -0,0 +1,62 @@ +########################################################################### +# Copyright 2015, 2016, 2017 IoT.bzh +# +# author: @PROJECT_AUTHOR@ <@PROJECT_AUTHOR_MAIL@> +# +# 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: @NPKG_PROJECT_NAME@ +Version: @PROJECT_VERSION@ +Release: 1 +Group: AGL +License: @PROJECT_LICENSE@ +Summary: @PROJECT_DESCRIPTION@ +Url: @PROJECT_URL@ +Source0: %{name}_%{version}.orig.tar.gz + +BuildRequires: cmake +BuildRequires: gcc gcc-c++ +@RPM_PKG_DEPS@ + +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%define _prefix /opt/AGL/@PROJECT_NAME@ +%define __cmake cmake + +%description +@PROJECT_DESCRIPTION@ + +%prep +%setup -q + +%build +%cmake -DBINDINGS_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/template.d/start-on-target.sh.in b/template.d/start-on-target.sh.in new file mode 100755 index 0000000..9e3a60d --- /dev/null +++ b/template.d/start-on-target.sh.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 -o UserKnownHostsFile=/dev/null -tt $RSYNC_TARGET << EOF + afb-daemon --workdir=$RSYNC_PREFIX --port=$AFB_REMPORT --roothttp=./htdocs --ldpath=./lib --verbose --token=$AFB_TOKEN & + PID_DAEMON=\$! + + trap "echo REMOTE-SIGNAL TRAP; kill -15 \$PID_DAEMON" INT QUIT TERM EXIT + + # wait for daemon to finish + wait \$PID_DAEMON + exit +EOF diff --git a/wgt/config.xml.in b/wgt/config.xml.in deleted file mode 100644 index 35d20b8..0000000 --- a/wgt/config.xml.in +++ /dev/null @@ -1,9 +0,0 @@ - - - @PROJECT_NAME@ - - - @PROJECT_DESCRIPTION@ - @PROJECT_AUTHOR@ <@PROJECT_AUTHOR_MAIL@> - @PROJECT_LICENSE@ - diff --git a/wgt/config.xml.in.sample b/wgt/config.xml.in.sample deleted file mode 100644 index b93f3d9..0000000 --- a/wgt/config.xml.in.sample +++ /dev/null @@ -1,142 +0,0 @@ - - - @PROJECT_NAME@ - - - @PROJECT_DESCRIPTION@ - @PROJECT_AUTHOR@ <@PROJECT_AUTHOR_MAIL@> - @PROJECT_LICENSE@ - - - - - - - - - diff --git a/wgt/install-wgt-on-target.sh.in b/wgt/install-wgt-on-target.sh.in deleted file mode 100755 index 39a69d5..0000000 --- a/wgt/install-wgt-on-target.sh.in +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# -# File: install-wgt-on-target.sh -# Author: Sebastien Douheret @ IoT.bzh -# Object: install widget on target -# Created on 24-May-2017, 09:23:37 -# Usage: - -# Do not change manually use 'make remote-target-populate' -export RSYNC_TARGET=@RSYNC_TARGET@ -export WGT_FILE_L=@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.wgt -export WGT_FILE_T=/tmp/@PROJECT_NAME@.wgt - -scp $WGT_FILE_L $RSYNC_TARGET:$WGT_FILE_T \ - && ssh -o "StrictHostKeyChecking no" -tt $RSYNC_TARGET -- \ - afm-util install $WGT_FILE_T - -# && rm -f $WGT_FILE_T - diff --git a/xds/xds-config.env.sample b/xds/xds-config.env.sample deleted file mode 100644 index a4c51b1..0000000 --- a/xds/xds-config.env.sample +++ /dev/null @@ -1,10 +0,0 @@ -XDS_PROJECT_ID=W2EAQBA-HQI75XA_unicens2-binding -XDS_SDK_ID=poky-agl_aarch64_3.99.1+snapshot -XDS_SERVER_URL=localhost:8000 - -DOCKER_TARGET=docker-sdk - -RSYNC_TARGET=root@192.168.168.11 -RSYNC_PREFIX=./opt -PROJECT_DIR=/home/seb/tmp/unicens2-binding - -- cgit 1.2.3-korg