summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGernot Wirschal <Gernot.Wirschal@bmw.de>2014-01-27 13:33:24 +0100
committerGernot Wirschal <Gernot.Wirschal@bmw.de>2014-01-27 13:54:41 +0100
commitc699a742ec203fd30b2b29444aeeac87619e899c (patch)
tree65cbed6d25d6fb3cf55805d26d919376248e9a01
parent3c8fbdddd1c480cb699e25f3637ff91caae0c271 (diff)
downloadgenivi-common-api-runtime-c699a742ec203fd30b2b29444aeeac87619e899c.tar.gz
[CommonAPI lib] first try to build with cmake and create rpm package for GPT
-rw-r--r--CMakeLists.txt67
-rw-r--r--commonapi.spec.in54
-rw-r--r--src/CommonAPI/CMakeLists.txt13
3 files changed, 134 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..9b819db
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,67 @@
+cmake_minimum_required (VERSION 2.8.1)
+
+PROJECT(libcommonapi)
+
+SET( ${PROJECT_NAME}_MAJOR_VERSION 2 )
+SET( ${PROJECT_NAME}_MINOR_VERSION 1 )
+SET( ${PROJECT_NAME}_PATCH_LEVEL 4 )
+
+set(GENIVI_PROJECT_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_LEVEL})
+
+set(GENIVI_RPM_RELEASE ${GENIVI_PROJECT_VERSION})
+
+##################### RPM CONFIG ########################
+#SET( GENIVI_RPM_RELEASE "1${SVN_REVISION}" )
+SET( LICENSE "MPL2" )
+#########################################################
+
+
+SET( prefix ${CMAKE_INSTALL_PREFIX})
+SET( libdir "\${exec_prefix}/lib" )
+SET( includedir "\${exec_prefix}/include" )
+
+SET( SHMLIBDIR ${CMAKE_INSTALL_PREFIX}/lib )
+SET( SHMLIBSTATIC ${CMAKE_INSTALL_PREFIX}/lib )
+SET( SHMINCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include )
+
+FIND_PACKAGE(PkgConfig)
+FIND_PACKAGE(Threads REQUIRED)
+
+###############################################################################
+# is using the 'pkg-config' tool
+#pkg_check_modules(DLT automotive-dlt)
+##############################################################################
+# general stuff
+
+
+
+OPTION(BUILD_SHARED_LIBS "Set to OFF to build static libraries" ON )
+OPTION(ENABLE_BUILD_DOC "Set to ON to build Documentation" OFF)
+
+ADD_SUBDIRECTORY( src/CommonAPI )
+#ADD_SUBDIRECTORY( Test/Implementation )
+#ADD_SUBDIRECTORY( src )
+
+
+##############################################################################
+# installing files
+
+INSTALL(FILES CommonAPI.pc
+ DESTINATION /usr/lib/pkgconfig
+ COMPONENT base)
+
+
+#INSTALL(FILES Config/shm.conf
+# DESTINATION /etc
+# PERMISSIONS OWNER_WRITE OWNER_READ
+# GROUP_READ GROUP_EXECUTE
+# WORLD_READ WORLD_EXECUTE
+#)
+
+CONFIGURE_FILE(commonapi.spec.in commonapi.spec)
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/CommonAPI.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/CommonAPI.pc)
+CONFIGURE_FILE(CommonAPI-uninstalled.pc.in CommonAPI-uninstalled.pc)
+CONFIGURE_FILE(doxygen.cfg.in doxygen.cfg)
+#CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h)
+
+
diff --git a/commonapi.spec.in b/commonapi.spec.in
new file mode 100644
index 0000000..f4b901e
--- /dev/null
+++ b/commonapi.spec.in
@@ -0,0 +1,54 @@
+Name: @PROJECT_NAME@
+Version: @GENIVI_PROJECT_VERSION@
+Release: @GENIVI_RPM_RELEASE@
+Summary: CommonAPI
+Group: Applications/BMW
+License: @LICENSE@
+Vendor: BMW Group
+URL: http://www.bmw.de
+Source: @PROJECT_NAME@-@GENIVI_RPM_RELEASE@.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+#Requires:
+
+%description
+CAPI middleware for IPC
+
+%prep
+%setup
+
+%build
+mkdir -p build
+cd build
+#../configure --host=@HOST_TYPE@ --prefix=%{_usr}
+../configure --host=@GENIVI_HOST_ARCHITECTURE@ --prefix=%{_usr}
+
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+cd build
+make install DESTDIR=$RPM_BUILD_ROOT
+
+mkdir -p $RPM_BUILD_ROOT%{_bindir}
+mkdir -p $RPM_BUILD_ROOT/etc/init.d
+
+/usr/bin/install -c -m 755 ../src/shm-daemon $RPM_BUILD_ROOT%{_bindir}
+/usr/bin/install -c -m 755 ../Config/shm.conf $RPM_BUILD_ROOT%{_sysconfdir}
+/usr/bin/install -c -m 755 ../CommonAPI.pc $RPM_BUILD_ROOT/usr/lib/pkgconfig
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%{_libdir}/libCommonAPI.so.0
+%{_libdir}/libCommonAPI.so.3.0.0
+%{_libdir}/libCommonAPI.so
+#%{_includedir}/shm/shm_swwd.h
+%{_libdir}/pkgconfig/CommonAPI.pc
+
+%changelog
+* Mon Jan 27 2014 Gernot Wirschal <Gernot.Wirschal@bmw.de> @GENIVI_PROJECT_VERSION@
+- Initial packaging for GPT
+
diff --git a/src/CommonAPI/CMakeLists.txt b/src/CommonAPI/CMakeLists.txt
new file mode 100644
index 0000000..73d1046
--- /dev/null
+++ b/src/CommonAPI/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required (VERSION 2.8.1)
+FIND_PACKAGE(PkgConfig)
+set(CAPI_LIB_SRCS *.cpp )
+add_library(CommonAPI ${shm_LIB_SRCS})
+target_link_libraries(CommonAPI ${EXPAT_LIBRARIES})
+set_target_properties(CommonAPI PROPERTIES VERSION 3.0.0 SOVERSION 0 LINKER_LANGUAGE C)
+
+set(CAPI_DEV_INCL *.h )
+
+install(TARGETS CommonAPI
+ LIBRARY DESTINATION /usr/lib
+ ARCHIVE DESTINATION lib/static
+ COMPONENT base)