* added package creation based on cpack
authorchristian mueller <christian.ei.mueller@bmw.de>
Sun, 15 Jan 2012 11:37:58 +0000 (12:37 +0100)
committerchristian mueller <christian.ei.mueller@bmw.de>
Sun, 15 Jan 2012 12:53:53 +0000 (13:53 +0100)
* updated .gitignore

21 files changed:
.gitignore
AudioManagerDaemon/CMakeLists.txt
AudioManagerDaemon/src/CommandSender.cpp
AudioManagerDaemon/src/ControlSender.cpp
AudioManagerDaemon/test/controlInterface/CMakeLists.txt
AudioManagerDaemon/test/database/CMakeLists.txt
AudioManagerDaemon/test/routingInterface/CMakeLists.txt
AudioManagerDaemon/test/sockethandler/CMakeLists.txt
CHANGELOG
CMakeLists.txt
LICENCE [new file with mode: 0644]
PluginCommandInterfaceDbus/CMakeLists.txt
PluginCommandInterfaceDbus/test/CMakeLists.txt
PluginControlInterface/CMakeLists.txt
PluginRoutingInterfaceAsync/CMakeLists.txt
PluginRoutingInterfaceAsync/test/CMakeLists.txt
PluginRoutingInterfaceDbus/CMakeLists.txt
README
cmake/add_package_dependencies.sh [new file with mode: 0755]
cmake/cmake_uninstall.cmake.in
includes/config.h

index 1e3fec5..b3857df 100644 (file)
@@ -1,14 +1,6 @@
 bin/
 build/
 doc/
-beagleClient/
-.metadata/
-PluginRoutingInterfaceTCP/
-pulseaudio-0.9.22/
-dbusInterfaces/tcpMessages.h
-.settings/
-*.cproject
-*.project
-.metadata/
-/music/navi.mp3
-/test
+packages/
+.*
+
index d54b17b..7e8946d 100644 (file)
@@ -100,5 +100,17 @@ INSTALL(TARGETS AudioManager
         RUNTIME 
         DESTINATION bin
         PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
+        COMPONENT bin
 )
 
+INSTALL(DIRECTORY "${AUDIO_INCLUDES_FOLDER}/" 
+        DESTINATION include
+        COMPONENT dev
+)
+
+SET(ADD_DEPEND "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)")
+set_property(GLOBAL APPEND PROPERTY bin_prop "${ADD_DEPEND}")
+
+SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)")
+set_property(GLOBAL APPEND PROPERTY dev_prop "${ADD_DEPEND}")
+
index 92734c4..a481317 100644 (file)
@@ -61,6 +61,7 @@ CommandSender::CommandSender(const std::vector<std::string>& listOfPluginDirecto
                if (!directory)
                {
                        DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("Error opening directory "),DLT_STRING(directoryName));
+                       continue;
                }
 
         // iterate content of directory
index a9e9220..3371fb2 100644 (file)
@@ -25,6 +25,7 @@
 #include "ControlSender.h"
 #include <assert.h>
 #include <dlt/dlt.h>
+#include <fstream>
 #include "PluginTemplate.h"
 
 DLT_IMPORT_CONTEXT(AudioManager)
@@ -37,7 +38,12 @@ ControlSender::ControlSender(std::string controlPluginFile)
        :mlibHandle(NULL),
         mController(NULL)
 {
-       if (!controlPluginFile.empty())
+       std::ifstream isfile(controlPluginFile.c_str());
+       if (!isfile)
+       {
+               DLT_LOG(AudioManager,DLT_LOG_ERROR, DLT_STRING("ControlSender::ControlSender: Controller plugin not found:"),DLT_STRING(controlPluginFile.c_str()));
+       }
+       else if (!controlPluginFile.empty())
        {
                ControlSendInterface* (*createFunc)();
                createFunc = getCreateFunction<ControlSendInterface*()>(controlPluginFile,mlibHandle);
@@ -49,7 +55,7 @@ ControlSender::ControlSender(std::string controlPluginFile)
        }
        else
        {
-               DLT_LOG(AudioManager,DLT_LOG_ERROR, DLT_STRING("No controller loaded !"));
+               DLT_LOG(AudioManager,DLT_LOG_ERROR, DLT_STRING("ControlSender::ControlSender: No controller loaded !"));
        }
 }
 
index 6e0acad..024e6b2 100644 (file)
@@ -67,5 +67,15 @@ TARGET_LINK_LIBRARIES(controlInterfaceTest
     gmock
 )
 
+INSTALL(TARGETS controlInterfaceTest 
+        DESTINATION "~/AudioManagerTest/"
+        PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
+        COMPONENT tests
+)
+
+SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)" "libgtest-dev(>=1.6.0-1)" "google-mock" "libpthread-stubs0")
+set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
+
+
 
 
index 1f368aa..6a8b742 100644 (file)
@@ -62,4 +62,14 @@ TARGET_LINK_LIBRARIES( databasetest
        ${CMAKE_THREAD_LIBS_INIT}
        ${GTEST_LIBRARIES}
        gmock
-)
\ No newline at end of file
+)
+
+INSTALL(TARGETS databasetest 
+        DESTINATION "~/AudioManagerTest/"
+        PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
+        COMPONENT tests
+)
+
+SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)" "libgtest-dev(>=1.6.0-1)" "google-mock" "libpthread-stubs0")
+set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
+
index 292065b..dc12a93 100644 (file)
@@ -65,5 +65,14 @@ TARGET_LINK_LIBRARIES(routinginterfacetest
     gmock
 )
 
+INSTALL(TARGETS routinginterfacetest 
+        DESTINATION "~/AudioManagerTest/"
+        PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
+        COMPONENT tests
+)
+
+SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)" "libgtest-dev(>=1.6.0-1)" "google-mock" "libpthread-stubs0")
+set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
+
 
 
index 787b120..ba1eb80 100644 (file)
@@ -65,5 +65,13 @@ TARGET_LINK_LIBRARIES(socketHandlerTest
     gmock
 )
 
+INSTALL(TARGETS socketHandlerTest 
+        DESTINATION "~/AudioManagerTest/"
+        PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
+        COMPONENT tests
+)
+
+SET(ADD_DEPEND "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)" "libgtest-dev(>=1.6.0-1)" "google-mock" "libpthread-stubs0")
+set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
 
 
index 76ac9c0..5b30a2f 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,19 @@
+commit 126870e1c2af541558aefd46aad38565c0ece795
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+    * added package creation based on cpack
+    * updated .gitignore
+
+commit a4a4c50ff375d94fa90c13d293b145176f214bf4
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+    * added install and uninstall routines to make
+
+commit 915ae08fa586cfa67559cc94a72ac5787df909ea
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+    * just update changelog
+
 commit 5f02509296864bc5b4b438139a246fb3119802ed
 Author: christian mueller <christian.ei.mueller@bmw.de>
 
index 084d83f..07c6289 100644 (file)
@@ -46,6 +46,9 @@ OPTION( WITH_PLUGIN_CONTROL
 OPTION( WITH_PLUGIN_ROUTING
        "Build routing pluings" ON)
 
+OPTION( USE_BUILD_LIBS
+       "Sets the default path to the libs that are compiled with the AudioManager together. If turned off, the default location will be the one of the install path" OFF) 
+
 OPTION( WITH_MAIN
        "Build with daemon" ON)
 
@@ -77,10 +80,17 @@ ENDIF(NOT DEFINED MAX_TELNETCONNECTIONS)
 
 SET(DLT_CONTEXT AudioManager)
 SET(PLUGINS_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin/plugins)
-
-SET(DEFAULT_PLUGIN_COMMAND_DIR "${PLUGINS_OUTPUT_PATH}/command")
-SET(DEFAULT_PLUGIN_ROUTING_DIR "${PLUGINS_OUTPUT_PATH}/routing")
-SET(CONTROLLER_PLUGIN "${PLUGINS_OUTPUT_PATH}/control/libPluginControlInterface.so")
+SET(LIB_INSTALL_SUFFIX "audioManager")
+
+if(USE_BUILD_LIBS)
+       SET(DEFAULT_PLUGIN_COMMAND_DIR "${PLUGINS_OUTPUT_PATH}/command")
+       SET(DEFAULT_PLUGIN_ROUTING_DIR "${PLUGINS_OUTPUT_PATH}/routing")
+       SET(CONTROLLER_PLUGIN "${PLUGINS_OUTPUT_PATH}/control/libPluginControlInterface.so")
+else(USE_BUILD_LIBS)
+       SET(DEFAULT_PLUGIN_COMMAND_DIR "${CMAKE_INSTALL_PREFIX}/lib/${LIB_INSTALL_SUFFIX}/command")
+       SET(DEFAULT_PLUGIN_ROUTING_DIR "${CMAKE_INSTALL_PREFIX}/lib/${LIB_INSTALL_SUFFIX}/routing")
+       SET(CONTROLLER_PLUGIN "${CMAKE_INSTALL_PREFIX}/lib/${LIB_INSTALL_SUFFIX}/control/libPluginControlInterface.so")
+endif(USE_BUILD_LIBS)
 
 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
 SET(AUDIO_INCLUDES_FOLDER ${CMAKE_SOURCE_DIR}/includes)
@@ -105,7 +115,7 @@ IF(WITH_DOCUMENTATION)
        )
 ENDIF(WITH_DOCUMENTATION)
 
-##global build flags
+##global build flags set(CPACK_RPM_COMPONENT_INSTALL ON)
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -std=c++98 -D_GNU_SOURCE")
 
 if(WITH_PLUGIN_COMMAND)
@@ -134,7 +144,86 @@ configure_file(
 add_custom_target(uninstall
     COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
 
+# Here starts package creation
+SET(CPACK_SET_DESTDIR ON)
+SET(CPACK_OUTPUT_FILE_PREFIX ${CMAKE_SOURCE_DIR}/packages)
+SET(CPACK_GENERATOR "DEB")
+SET(CPACK_PACKAGE_NAME "AudioManager")
+SET(CPACK_PACKAGE_VENDOR "GENIVI")
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "AudioManager: This component manages audio in the GENIVI context")
+SET(CPACK_PACKAGE_VERSION "${DAEMONVERSION}")
+SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENCE)
+SET(CPACK_RESOURCE_FILE_README ${CMAKE_SOURCE_DIR}/README)
+SET(CPACK_PACKAGE_CONTACT "Christian Mueller (BMW) christian.ei.mueller@bmw.de")
+SET(CPACK_PACKAGE_INSTALL_DIRECTORY "genivi")
+SET(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
+SET(CPACK_DEBIAN_PACKAGE_DEPENDS "*")
+SET(CPACK_STRIP_FILES TRUE)
+SET(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_SOURCE_DIR}/README)
+SET(CPACK_SOURCE_GENERATOR "TGZ")
+SET(CPACK_SOURCE_IGNORE_FILES ".settings*" ".cproject" ".project" "/\\\\.metadata" "\\\\.#" "/#" ".*~" "/\\\\.git" "${CMAKE_CURRENT_BINARY_DIR}" "bin/" "packages/" "config.h") 
+
+#evaluate the properties
+get_property(ADD_DEPEND GLOBAL PROPERTY bin_prop)
+list(REMOVE_DUPLICATES ADD_DEPEND)
+set(ALL_DEPEND ${ADD_DEPEND})
+FOREACH (dep ${ADD_DEPEND})
+       SET(bin_DEPENDENCIES "${dep} ,${bin_DEPENDENCIES}")
+ENDFOREACH(dep)
+STRING(REGEX REPLACE ".$" "" bin_DEPENDENCIES ${bin_DEPENDENCIES})
+
+get_property(ADD_DEPEND GLOBAL PROPERTY sampleplugins_prop)
+list(REMOVE_DUPLICATES ADD_DEPEND)
+list(APPEND ALL_DEPEND ${ADD_DEPEND})
+FOREACH (dep ${ADD_DEPEND})
+       SET(sampleplugins_DEPENDENCIES "${dep} ,${sampleplugins_DEPENDENCIES}")
+ENDFOREACH(dep)
+STRING(REGEX REPLACE ".$" "" sampleplugins_DEPENDENCIES ${sampleplugins_DEPENDENCIES})
+
+get_property(ADD_DEPEND GLOBAL PROPERTY tests_prop)
+list(REMOVE_DUPLICATES ADD_DEPEND)
+list(APPEND ALL_DEPEND ${ADD_DEPEND})
+FOREACH (dep ${ADD_DEPEND})    
+       SET(tests_DEPENDENCIES "${dep} ,${tests_DEPENDENCIES}")
+ENDFOREACH(dep)
+STRING(REGEX REPLACE ".$" "" tests_DEPENDENCIES ${tests_DEPENDENCIES})
+
+get_property(ADD_DEPEND GLOBAL PROPERTY dev_prop)
+list(REMOVE_DUPLICATES ADD_DEPEND)
+list(APPEND ALL_DEPEND ${ADD_DEPEND})
+FOREACH (dep ${ADD_DEPEND})
+       SET(dev_DEPENDENCIES "${dep} ,${dev_DEPENDENCIES}")
+ENDFOREACH(dep)
+STRING(REGEX REPLACE ".$" "" dev_DEPENDENCIES ${dev_DEPENDENCIES})
+
+list(REMOVE_DUPLICATES ALL_DEPEND)
+FOREACH (dep ${ALL_DEPEND})
+       SET(all_DEPENDENCIES "${dep} ,${all_DEPENDENCIES}")
+ENDFOREACH(dep)
+STRING(REGEX REPLACE ".$" "" all_DEPENDENCIES ${all_DEPENDENCIES})
+execute_process(COMMAND cp ${CMAKE_MODULE_PATH}/add_package_dependencies.sh ${CMAKE_CURRENT_BINARY_DIR})
+
+#component based dep package generation is only supported above 2.8.5
+IF (${CMAKE_VERSION} VERSION_GREATER 2.8.4)
+
+       SET(CPACK_COMPONENTS_ALL bin sampleplugins tests dev)
+       SET(CPACK_COMPONENTS_IGNORE_GROUPS 1)
+       SET(CPACK_RPM_COMPONENT_INSTALL ON)
+       SET(CPACK_DEB_COMPONENT_INSTALL ON)
+       ADD_CUSTOM_TARGET(genivi_package 
+               COMMAND make package
+               COMMAND ${CMAKE_CURRENT_BINARY_DIR}/add_package_dependencies.sh ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Linux-bin.deb ${CPACK_OUTPUT_FILE_PREFIX} \"${bin_DEPENDENCIES}\"
+               COMMAND ${CMAKE_CURRENT_BINARY_DIR}/add_package_dependencies.sh ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Linux-sampleplugins.deb ${CPACK_OUTPUT_FILE_PREFIX} \"${sampleplugins_DEPENDENCIES}\"
+               COMMAND ${CMAKE_CURRENT_BINARY_DIR}/add_package_dependencies.sh ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Linux-tests.deb ${CPACK_OUTPUT_FILE_PREFIX} \"${tests_DEPENDENCIES}\"
+               COMMAND ${CMAKE_CURRENT_BINARY_DIR}/add_package_dependencies.sh ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Linux-dev.deb ${CPACK_OUTPUT_FILE_PREFIX} \"${dev_DEPENDENCIES}\"
+       ) 
+ELSE (${CMAKE_VERSION} VERSION_GREATER 2.8.4)
+       ADD_CUSTOM_TARGET(genivi_package 
+               COMMAND make package
+               COMMAND ${CMAKE_CURRENT_BINARY_DIR}/add_package_dependencies.sh ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Linux.deb ${CPACK_OUTPUT_FILE_PREFIX} \"${all_DEPENDENCIES}\"
+       )
+ENDIF (${CMAKE_VERSION} VERSION_GREATER 2.8.4)
 
-
+INCLUDE(CPack)
 
 
diff --git a/LICENCE b/LICENCE
new file mode 100644 (file)
index 0000000..bec695e
--- /dev/null
+++ b/LICENCE
@@ -0,0 +1,10 @@
+GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
+Copyright (C) 2011, BMW AG – Christian Müller  Christian.ei.mueller@bmw.de
+
+This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
+This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
+You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
+Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
+Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
+As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
+Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
index 2b78169..33e22fd 100644 (file)
@@ -53,5 +53,11 @@ IF(WITH_DOCUMENTATION)
        )
 ENDIF(WITH_DOCUMENTATION)
 
+INSTALL(TARGETS PluginCommandInterfaceDbus 
+        DESTINATION "lib/${LIB_INSTALL_SUFFIX}/command"
+        PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
+        COMPONENT sampleplugins
+)
 
-
+SET(ADD_DEPEND "audiomanager-bin" "dlt" "libdbus-1-3(>=1.2.16)")
+set_property(GLOBAL APPEND PROPERTY sampleplugins_prop "${ADD_DEPEND}")
index 7038af9..c3e136b 100644 (file)
@@ -96,3 +96,18 @@ TARGET_LINK_LIBRARIES(dbusCommandSignals
     gmock
 )
 
+INSTALL(TARGETS dbusCommandMessages 
+        DESTINATION "~/AudioManagerTest/"
+        PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
+        COMPONENT tests
+)
+
+INSTALL(TARGETS dbusCommandSignals 
+        DESTINATION "~/AudioManagerTest/"
+        PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
+        COMPONENT tests
+)
+
+SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "libdbus-1-3(>=1.2.16)" "libgtest-dev(>=1.6.0-1)" "google-mock" "libpthread-stubs0")
+set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
+
index 46d818a..89725a0 100644 (file)
@@ -46,4 +46,11 @@ IF(WITH_DOCUMENTATION)
        )
 ENDIF(WITH_DOCUMENTATION)
 
+INSTALL(TARGETS PluginControlInterface 
+        DESTINATION "lib/${LIB_INSTALL_SUFFIX}/control"
+        PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
+        COMPONENT sampleplugins
+)
 
+SET(ADD_DEPEND "audiomanager-bin")
+set_property(GLOBAL APPEND PROPERTY sampleplugins_prop "${ADD_DEPEND}")
index f2d6403..ebee65f 100644 (file)
@@ -75,4 +75,13 @@ IF(WITH_DOCUMENTATION)
 ENDIF(WITH_DOCUMENTATION)
 
 
+INSTALL(TARGETS PluginRoutingInterfaceAsync 
+        DESTINATION "lib/${LIB_INSTALL_SUFFIX}/routing"
+        PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
+        COMPONENT sampleplugins
+)
+
+SET(ADD_DEPEND "audiomanager-bin" "dlt" "libdbus-1-3(>=1.2.16)" "libpthread-stubs0")
+set_property(GLOBAL APPEND PROPERTY sampleplugins_prop "${ADD_DEPEND}")
+
 
index 04cf18c..5f61232 100644 (file)
@@ -86,5 +86,13 @@ TARGET_LINK_LIBRARIES(asyncRoutingInterfaceInterruptTest
     gmock
 )
 
+INSTALL(TARGETS asyncRoutingInterfaceInterruptTest 
+        DESTINATION "~/AudioManagerTest/"
+        PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
+        COMPONENT tests
+)
+
+SET(ADD_DEPEND "audiomanager-bin" "dlt" "libdbus-1-3(>=1.2.16)" "libgtest-dev(>=1.6.0-1)" "google-mock" "libpthread-stubs0")
+set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}")
 
 
index 6f36ff1..4b87e75 100644 (file)
@@ -52,5 +52,12 @@ IF(WITH_DOCUMENTATION)
        )
 ENDIF(WITH_DOCUMENTATION)
 
+INSTALL(TARGETS PluginRoutingInterfaceDbus 
+        DESTINATION "lib/${LIB_INSTALL_SUFFIX}/routing"
+        PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
+        COMPONENT sampleplugins
+)
 
+SET(ADD_DEPEND "audiomanager-bin" "dlt" "libdbus-1-3(>=1.2.16)")
+set_property(GLOBAL APPEND PROPERTY sampleplugins_prop "${ADD_DEPEND}")
 
diff --git a/README b/README
index 954fc1e..beded22 100644 (file)
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ GENIVI AUDIOMANAGER
 
 Copyright (C) 2011, BMW AG
 
-Datum  14.12.2012
+Datum  15.1.2012
 author Christian Müller (christian.ei.mueller@bmw.de)
 
 ***********************************************************************************************************
@@ -33,18 +33,21 @@ COMPILE PROGRAMS
 ***********************************************************************************************************
 - compile options with default values:
 
-       CMAKE_BUILD_TYPE                                                                                                                  
-       CMAKE_INSTALL_PREFIX             /usr/local                                                                                       
-       WITH_DBUS_WRAPPER                ON                                                                                               
-       WITH_DOCUMENTATION               OFF                                                                                              
-       WITH_MAIN                        ON                                                                                               
-       WITH_PLUGIN_COMMAND              ON                                                                                               
-       WITH_PLUGIN_CONTROL              ON                                                                                               
-       WITH_PLUGIN_ROUTING              ON                                                                                               
-       WITH_PPOLL                       ON                                                                                               
-       WITH_SIMPLEDBUS_LOOP             OFF                                                                                              
-       WITH_SOCKETHANDLER_LOOP          ON                                                                                               
-       WITH_TESTS                       ON   
+        CMAKE_BUILD_TYPE                                                                               
+        CMAKE_INSTALL_PREFIX             /usr/local                                                    
+        USE_BUILD_LIBS                   OFF                                                           
+        WITH_DBUS_WRAPPER                ON                                                            
+        WITH_DOCUMENTATION               OFF                                                           
+        WITH_MAIN                        ON                                                            
+        WITH_PLUGIN_COMMAND              ON                                                            
+        WITH_PLUGIN_CONTROL              ON                                                            
+        WITH_PLUGIN_ROUTING              ON                                                            
+        WITH_PPOLL                       ON                                                            
+        WITH_SIMPLEDBUS_LOOP             OFF                                                           
+        WITH_SOCKETHANDLER_LOOP          ON                                                            
+        WITH_TELNET                      OFF                                                           
+        WITH_TESTS                       ON  
 
 In order to change these options, you can modify this values with ccmake, do the appropriate changes in CmakeList.txt or via 
 the commandline for cmake or (when installed via ccmake)
@@ -84,25 +87,55 @@ In order to build the project (out of source build), please follow these instruc
 
 after the script finished, you should have:
 
-       a /bin folder which contains all executables and the libraries: 
-       a /build folder which has all build objects (erase that if you need a clean build)
-       a /doc folder in case you turned the documentation on
+       a bin/ folder which contains all executables and the libraries: 
+       a build/ folder which has all build objects (erase that if you need a clean build)
+       a doc/ folder in case you turned the documentation on
 
-The commandline options of the AudioManager:
+in order to install the AudioManager, you can do
+
+       sudo make install
+
+package generation is supported via CPack. To build packages, you have to 
+
+       make genivi_package
+
+this will create one package if your CMake version is < 2.8.5 (all binaries stripped):
+       
+       AudioManager-<git verison>-Linux.deb 
+
+if your version is above, you will get 4 packages (all binaries stripped) :
+       
+       AudioManager-<git verison>-Linux-bin.deb                [AudioManager binary]
+       AudioManager-<git verison>-Linux-dev.deb                [header files needed to compile plugins]
+       AudioManager-<git verison>-Linux-sampleplugins.deb      [sample plugins]
+       AudioManager-<git verison>-Linux-tests.deb              [tests including tests for sample plugins, installed in the ~/AudioMAnagerTests]
 
-Usage: AudioManagerDaemon [options]
-options:       
-       -h: print this message  
-       -v: print version       
-       -d: daemonize AudioManager      
-       -p: path for sqlite database (default is in memory)     
-       -c: <Name> use controllerPlugin <Name> (full path with .so ending)      
-       -l: <Name> replace command plugin directory with <Name> (full path)     
-       -r: <Name> replace routing plugin directory with <Name> (full path)     
-       -L: <Name> add command plugin directory with <Name> (full path) 
-       -R: <Name> add routing plugin directory with <Name> (full path) 
+to create a tar.gz file of all sources (not including .git, build and bin folder,config files), you can do:
 
+       make package_source     
+
+This will create the following package:
+
+       AudioManager-<git verison>-Source.tar.gz
+
+All packages will be placed in a folder called packages
+
+The commandline options of the AudioManager:
 
+       Usage:  AudioManagerDaemon [options]
+       options:        
+               -h: print this message  
+               -i: info about current settings         
+               -v: print version       
+               -d: daemonize AudioManager      
+               -p<path> path for sqlite database (default is in memory)        
+               -t<port> port for telnetconnection      
+               -m<max> number of max telnetconnections 
+               -c<Name> use controllerPlugin <Name> (full path with .so ending)        
+               -l<Name> replace command plugin directory with <Name> (full path)       
+               -r<Name> replace routing plugin directory with <Name> (full path)       
+               -L<Name> add command plugin directory with <Name> (full path)   
+               -R<Name> add routing plugin directory with <Name> (full path)   
 
 
 
diff --git a/cmake/add_package_dependencies.sh b/cmake/add_package_dependencies.sh
new file mode 100755 (executable)
index 0000000..a0c71e5
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+PACKAGE_NAME=$1
+PACKAGE_NAME_PATH=$2/$PACKAGE_NAME
+TMPDIR=`mktemp -d /tmp/gen.XXXXXXXXXX` || exit 1
+dpkg-deb -x "$PACKAGE_NAME_PATH" "$TMPDIR"
+dpkg-deb --control "$PACKAGE_NAME_PATH" "$TMPDIR"/DEBIAN
+cat "$TMPDIR"/DEBIAN/control | sed -e "s/Depends.*$/Depends: $3/" > "$TMPDIR"/DEBIAN/control_
+cp "$TMPDIR"/DEBIAN/control_ "$TMPDIR"/DEBIAN/control
+dpkg -b "$TMPDIR" "$PACKAGE_NAME_PATH"
+rm -r "$TMPDIR"
+
index 17376d2..1b17154 100755 (executable)
@@ -20,3 +20,6 @@ FOREACH(file ${files})
   ENDIF(EXISTS "$ENV{DESTDIR}${file}")
 ENDFOREACH(file)
 
+#remove the libraries in lib
+MESSAGE(STATUS "Removing libs")
+execute_process(COMMAND rm -R "@CMAKE_INSTALL_PREFIX@/lib/@LIB_INSTALL_SUFFIX@")
index d8c0ee7..193da1c 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _CONFIG_H
 #define _CONFIG_H
 
-#define DAEMONVERSION "ver-0.0.1-5-g5f02509"
+#define DAEMONVERSION "ver-0.0.1-8-g126870e"
 
 #define WITH_DBUS_WRAPPER
 #define WITH_SOCKETHANDLER_LOOP 
@@ -9,9 +9,9 @@
 #define WITH_PPOLL
 /* #undef WITH_TELNET */
 
-#define DEFAULT_PLUGIN_COMMAND_DIR "/home/christian/workspace/gitserver/bin/plugins/command"
-#define DEFAULT_PLUGIN_ROUTING_DIR "/home/christian/workspace/gitserver/bin/plugins/routing"
-#define CONTROLLER_PLUGIN "/home/christian/workspace/gitserver/bin/plugins/control/libPluginControlInterface.so"
+#define DEFAULT_PLUGIN_COMMAND_DIR "/usr/local/lib/audioManager/command"
+#define DEFAULT_PLUGIN_ROUTING_DIR "/usr/local/lib/audioManager/routing"
+#define CONTROLLER_PLUGIN "/usr/local/lib/audioManager/control/libPluginControlInterface.so"
 
 #define DEFAULT_TELNETPORT 6060
 #define MAX_TELNETCONNECTIONS 3