From 6b2b09db8ee3cf88b09b59696d50b4fa2de79a72 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Thu, 11 Apr 2019 13:09:56 +0200 Subject: [PATCH] Reordering of sample and tutorial bindings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The main idea here is to install the sample and tutorial bindings in specific directory. This will at the end help to package parts of the binder. It also includes a simplification of CMakeLists files. Also fix an error in packaging rpm. Bug-AGL: SPEC-2165 Change-Id: I494cc753796848cde849de1c3596893c78fa228f Signed-off-by: José Bollo --- CMakeLists.txt | 1 + bindings/CMakeLists.txt | 2 +- bindings/intrinsics/CMakeLists.txt | 2 +- bindings/samples/CMakeLists.txt | 88 ++++------------------ bindings/{tutorial => tutorials}/CMakeLists.txt | 5 +- bindings/{tutorial => tutorials}/export.map | 0 bindings/{tutorial => tutorials}/tuto-1.c | 0 bindings/{tutorial => tutorials}/tuto-2.c | 0 bindings/{tutorial => tutorials}/tuto-3.cpp | 0 bindings/{tutorial => tutorials}/tuto-4.c | 0 bindings/{tutorial => tutorials}/tuto-5.cpp | 0 bindings/{tutorial => tutorials}/tuto-app1.c | 0 conf.d/packaging/deb/agl-app-framework-binder.dsc | 2 +- ...debian.agl-app-framework-binder-samples.install | 1 + conf.d/packaging/deb/debian.control | 6 ++ conf.d/packaging/rpm/agl-app-framework-binder.spec | 14 +++- 16 files changed, 40 insertions(+), 81 deletions(-) rename bindings/{tutorial => tutorials}/CMakeLists.txt (88%) rename bindings/{tutorial => tutorials}/export.map (100%) rename bindings/{tutorial => tutorials}/tuto-1.c (100%) rename bindings/{tutorial => tutorials}/tuto-2.c (100%) rename bindings/{tutorial => tutorials}/tuto-3.cpp (100%) rename bindings/{tutorial => tutorials}/tuto-4.c (100%) rename bindings/{tutorial => tutorials}/tuto-5.cpp (100%) rename bindings/{tutorial => tutorials}/tuto-app1.c (100%) create mode 100644 conf.d/packaging/deb/debian.agl-app-framework-binder-samples.install diff --git a/CMakeLists.txt b/CMakeLists.txt index f841b5de..ebda48f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,6 +157,7 @@ IF(ONLY_DEVTOOLS) MESSAGE(WARNING "Only DEVTOOLS are compiled, not the binder!") ELSE() SET(binding_install_dir ${CMAKE_INSTALL_FULL_LIBDIR}/afb) + SET(install_datadir ${CMAKE_INSTALL_FULL_DATADIR}/af-binder) ########################################################################### # activates the monitoring by default diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt index 35f22897..c4fbdea0 100644 --- a/bindings/CMakeLists.txt +++ b/bindings/CMakeLists.txt @@ -18,5 +18,5 @@ ADD_SUBDIRECTORY(intrinsics) ADD_SUBDIRECTORY(samples) -ADD_SUBDIRECTORY(tutorial) +ADD_SUBDIRECTORY(tutorials) diff --git a/bindings/intrinsics/CMakeLists.txt b/bindings/intrinsics/CMakeLists.txt index 70da19e9..ee981217 100644 --- a/bindings/intrinsics/CMakeLists.txt +++ b/bindings/intrinsics/CMakeLists.txt @@ -27,7 +27,7 @@ SET_TARGET_PROPERTIES(afb-dbus-binding PROPERTIES PREFIX "" LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map" ) -TARGET_LINK_LIBRARIES(afb-dbus-binding ${link_libraries}) +TARGET_LINK_LIBRARIES(afb-dbus-binding ${json-c_LDFLAGS} ${libsystemd_LDFLAGS}) INSTALL(TARGETS afb-dbus-binding LIBRARY DESTINATION ${binding_install_dir}) diff --git a/bindings/samples/CMakeLists.txt b/bindings/samples/CMakeLists.txt index 34b364f5..51442684 100644 --- a/bindings/samples/CMakeLists.txt +++ b/bindings/samples/CMakeLists.txt @@ -16,78 +16,18 @@ # limitations under the License. ########################################################################### - -INCLUDE_DIRECTORIES(${include_dirs}) - -################################################## -# AuthLogin -################################################## -ADD_LIBRARY(authLogin MODULE AuthLogin.c) -SET_TARGET_PROPERTIES(authLogin PROPERTIES - PREFIX "" - LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map" -) -TARGET_LINK_LIBRARIES(authLogin ${link_libraries}) -INSTALL(TARGETS authLogin - LIBRARY DESTINATION ${binding_install_dir}) - -################################################## -# DemoContext -################################################## -ADD_LIBRARY(demoContext MODULE DemoContext.c) -SET_TARGET_PROPERTIES(demoContext PROPERTIES - PREFIX "" - LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map" -) -TARGET_LINK_LIBRARIES(demoContext ${link_libraries}) -INSTALL(TARGETS demoContext - LIBRARY DESTINATION ${binding_install_dir}) - -################################################## -# DemoPost -################################################## -ADD_LIBRARY(demoPost MODULE DemoPost.c) -SET_TARGET_PROPERTIES(demoPost PROPERTIES - PREFIX "" - LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map" -) -TARGET_LINK_LIBRARIES(demoPost ${link_libraries}) -INSTALL(TARGETS demoPost - LIBRARY DESTINATION ${binding_install_dir}) - -################################################## -# tic-tac-toe -################################################## -ADD_LIBRARY(tic-tac-toe MODULE tic-tac-toe.c) -SET_TARGET_PROPERTIES(tic-tac-toe PROPERTIES - PREFIX "" - LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map" -) -TARGET_LINK_LIBRARIES(tic-tac-toe ${link_libraries}) -INSTALL(TARGETS tic-tac-toe - LIBRARY DESTINATION ${binding_install_dir}) - -################################################## -# hello2 -################################################## -ADD_LIBRARY(hello2 MODULE hello2.c) -SET_TARGET_PROPERTIES(hello2 PROPERTIES - PREFIX "" - LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map" -) -TARGET_LINK_LIBRARIES(hello2 ${link_libraries}) -INSTALL(TARGETS hello2 - LIBRARY DESTINATION ${binding_install_dir}) - -################################################## -# hello3 -################################################## -ADD_LIBRARY(hello3 MODULE hello3.c) -SET_TARGET_PROPERTIES(hello3 PROPERTIES - PREFIX "" - LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map" -) -TARGET_LINK_LIBRARIES(hello3 ${link_libraries}) -INSTALL(TARGETS hello3 - LIBRARY DESTINATION ${binding_install_dir}) +macro(sample name source) + add_library(${name} MODULE ${source}) + set_target_properties(${name} PROPERTIES PREFIX "" LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map") +# target_link_libraries(${name} ${link_libraries}) + target_link_libraries(${name} ${json-c_LDFLAGS} ${CMAKE_THREAD_LIBS_INIT}) + install(TARGETS ${name} LIBRARY DESTINATION ${install_datadir}/bindings/samples) +endmacro(sample) + +sample(authLogin AuthLogin.c) +sample(demoContext DemoContext.c) +sample(demoPost DemoPost.c) +sample(tic-tac-toe tic-tac-toe.c) +sample(hello2 hello2.c) +sample(hello3 hello3.c) diff --git a/bindings/tutorial/CMakeLists.txt b/bindings/tutorials/CMakeLists.txt similarity index 88% rename from bindings/tutorial/CMakeLists.txt rename to bindings/tutorials/CMakeLists.txt index f05fa541..e071d7a9 100644 --- a/bindings/tutorial/CMakeLists.txt +++ b/bindings/tutorials/CMakeLists.txt @@ -17,15 +17,14 @@ ########################################################################### -#INCLUDE_DIRECTORIES(${include_dirs}) - MACRO(tuto num ext) ADD_LIBRARY(tuto-${num} MODULE tuto-${num}.${ext}) SET_TARGET_PROPERTIES(tuto-${num} PROPERTIES PREFIX "" LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map" ) - TARGET_LINK_LIBRARIES(tuto-${num} ${link_libraries}) + TARGET_LINK_LIBRARIES(tuto-${num} ${json-c_LDFLAGS}) + install(TARGETS tuto-${num} LIBRARY DESTINATION ${install_datadir}/bindings/tutorials) ENDMACRO(tuto) diff --git a/bindings/tutorial/export.map b/bindings/tutorials/export.map similarity index 100% rename from bindings/tutorial/export.map rename to bindings/tutorials/export.map diff --git a/bindings/tutorial/tuto-1.c b/bindings/tutorials/tuto-1.c similarity index 100% rename from bindings/tutorial/tuto-1.c rename to bindings/tutorials/tuto-1.c diff --git a/bindings/tutorial/tuto-2.c b/bindings/tutorials/tuto-2.c similarity index 100% rename from bindings/tutorial/tuto-2.c rename to bindings/tutorials/tuto-2.c diff --git a/bindings/tutorial/tuto-3.cpp b/bindings/tutorials/tuto-3.cpp similarity index 100% rename from bindings/tutorial/tuto-3.cpp rename to bindings/tutorials/tuto-3.cpp diff --git a/bindings/tutorial/tuto-4.c b/bindings/tutorials/tuto-4.c similarity index 100% rename from bindings/tutorial/tuto-4.c rename to bindings/tutorials/tuto-4.c diff --git a/bindings/tutorial/tuto-5.cpp b/bindings/tutorials/tuto-5.cpp similarity index 100% rename from bindings/tutorial/tuto-5.cpp rename to bindings/tutorials/tuto-5.cpp diff --git a/bindings/tutorial/tuto-app1.c b/bindings/tutorials/tuto-app1.c similarity index 100% rename from bindings/tutorial/tuto-app1.c rename to bindings/tutorials/tuto-app1.c diff --git a/conf.d/packaging/deb/agl-app-framework-binder.dsc b/conf.d/packaging/deb/agl-app-framework-binder.dsc index 9327ea39..b9c1ef53 100644 --- a/conf.d/packaging/deb/agl-app-framework-binder.dsc +++ b/conf.d/packaging/deb/agl-app-framework-binder.dsc @@ -1,6 +1,6 @@ Format: 1.0 Source: agl-app-framework-binder -Binary: agl-app-framework-binder-bin, agl-app-framework-binder-dev +Binary: agl-app-framework-binder-bin, agl-app-framework-binder-dev, agl-app-framework-binder-samples Architecture: any Version: 2.0-0 Maintainer: unknown diff --git a/conf.d/packaging/deb/debian.agl-app-framework-binder-samples.install b/conf.d/packaging/deb/debian.agl-app-framework-binder-samples.install new file mode 100644 index 00000000..497004f6 --- /dev/null +++ b/conf.d/packaging/deb/debian.agl-app-framework-binder-samples.install @@ -0,0 +1 @@ +/opt/AGL/share/af-binder/* diff --git a/conf.d/packaging/deb/debian.control b/conf.d/packaging/deb/debian.control index 45e98277..d8dac6f8 100644 --- a/conf.d/packaging/deb/debian.control +++ b/conf.d/packaging/deb/debian.control @@ -24,3 +24,9 @@ Architecture: any Depends: agl-app-framework-binder-bin Description: agl-app-framework-binder-devel +Package: agl-app-framework-binder-samples +Section: libs +Architecture: any +Depends: agl-app-framework-binder-bin +Description: agl-app-framework-binder-samples + diff --git a/conf.d/packaging/rpm/agl-app-framework-binder.spec b/conf.d/packaging/rpm/agl-app-framework-binder.spec index 4f701469..7102e863 100644 --- a/conf.d/packaging/rpm/agl-app-framework-binder.spec +++ b/conf.d/packaging/rpm/agl-app-framework-binder.spec @@ -51,13 +51,19 @@ Summary: AGL app-framework-binder-devel Provides a test agl binder service which can be used to test agl bindings on Linux PC This service is evolving permanently and is only designed as a helper for developper. +%package samples +Requires: %{name} = %{version} +Summary: AGL app-framework-binder-samples +%description samples +Provides sample bindings for testing AGL framework binder + %prep %setup -q -n app-framework-binder-%{version} %build export PKG_CONFIG_PATH=%{_libdir}/pkgconfig -%cmake -DAGL_DEVEL=1 -DINCLUDE_MONITORING=ON" +%cmake -DAGL_DEVEL=1 -DINCLUDE_MONITORING=ON %__make %{?_smp_mflags} @@ -112,6 +118,12 @@ EOF %dir %{_libdir}/pkgconfig %{_libdir}/pkgconfig/*.pc +%files samples +%defattr(-,root,root) +%dir %{_datadir} +%dir %{_datadir}/af-binder +%{_datadir}/af-binder/* + %changelog * Wed Sep 27 2017 Dominig - move to git repo -- 2.16.6