File packaging.diff of Package owncloud-client

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 20a0de8be..0fdd52162 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,7 +31,7 @@ string(REPLACE "&" "&" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME}")
 string(REPLACE "<" "&lt;" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME_XML_ESCAPED}")
 string(REPLACE ">" "&gt;" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME_XML_ESCAPED}")
 
-set(PACKAGE "${APPLICATION_SHORTNAME}-client")
+set(PACKAGE "${APPLICATION_EXECUTABLE}-client")
 set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
 
 if(NOT CRASHREPORTER_EXECUTABLE)
@@ -120,7 +120,22 @@ if(NO_MSG_HANDLER)
    add_definitions(-DNO_MSG_HANDLER=1)
 endif()
 
-# this option creates only libocsync and libowncloudsync
+# this option builds the shell integration
+option(BUILD_SHELL_INTEGRATION "BUILD_SHELL_INTEGRATION" ON)
+
+# this option builds/installs the generic shell integration icons
+option(BUILD_SHELL_INTEGRATION_ICONS "BUILD_SHELL_INTEGRATION_ICONS" ON)
+
+# this options builds the dolphin integration plugin
+option(BUILD_SHELL_INTEGRATION_DOLPHIN "BUILD_SHELL_INTEGRATION_DOLPHIN" ON)
+
+# this options builds the nautilus (like) integration plugins
+option(BUILD_SHELL_INTEGRATION_NAUTILUS "BUILD_SHELL_INTEGRATION_NAUTILUS" ON)
+
+# this option builds the client
+option(BUILD_CLIENT "BUILD_CLIENT" ON)
+
+# this option creates only libocsync and libowncloudsync (NOTE: BUILD_CLIENT needs to be on)
 option(BUILD_LIBRARIES_ONLY "BUILD_LIBRARIES_ONLY" OFF)
 
 # When this option is enabled, 5xx errors are not added to the blacklist
@@ -153,30 +168,32 @@ if(APPLE)
   set( SOCKETAPI_TEAM_IDENTIFIER_PREFIX "" CACHE STRING "SocketApi prefix (including a following dot) that must match the codesign key's TeamIdentifier/Organizational Unit" )
 endif()
 
-find_package(OpenSSL 1.0.0 REQUIRED)
+if(BUILD_CLIENT)
+    find_package(OpenSSL 1.0.0 REQUIRED)
 
-if(APPLE)
-  find_package(Sparkle)
-endif(APPLE)
-
-if(UNIX)
-  find_package(INotify REQUIRED)
-else()
-  find_package(INotify)
-endif()
-find_package(Sphinx)
-find_package(PdfLatex)
+    if(APPLE)
+    find_package(Sparkle)
+    endif(APPLE)
 
-find_package(SQLite3 3.8.0 REQUIRED)
-# On some OS, we want to use our own, not the system sqlite
-if (USE_OUR_OWN_SQLITE3)
-    include_directories(BEFORE ${SQLITE3_INCLUDE_DIR})
-    if (WIN32)
-        add_definitions(-DSQLITE_API=__declspec\(dllimport\))
+    if(UNIX)
+    find_package(INotify REQUIRED)
+    else()
+    find_package(INotify)
+    endif()
+    find_package(Sphinx)
+    find_package(PdfLatex)
+
+    find_package(SQLite3 3.8.0 REQUIRED)
+    # On some OS, we want to use our own, not the system sqlite
+    if (USE_OUR_OWN_SQLITE3)
+        include_directories(BEFORE ${SQLITE3_INCLUDE_DIR})
+        if (WIN32)
+            add_definitions(-DSQLITE_API=__declspec\(dllimport\))
+        endif()
     endif()
-endif()
 
-find_package(ZLIB)
+    find_package(ZLIB)
+endif()
 
 configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
 
@@ -195,14 +212,19 @@ endif( WIN32 )
 file( GLOB TRANS_FILES ${CMAKE_SOURCE_DIR}/translations/client_*.ts)
 set(TRANSLATIONS ${TRANS_FILES})
 
-add_subdirectory(csync)
-add_subdirectory(src)
-if(NOT BUILD_LIBRARIES_ONLY)
-add_subdirectory(shell_integration)
-add_subdirectory(doc)
-add_subdirectory(doc/dev)
-add_subdirectory(admin)
-endif(NOT BUILD_LIBRARIES_ONLY)
+if(BUILD_CLIENT)
+    add_subdirectory(csync)
+    add_subdirectory(src)
+    if(NOT BUILD_LIBRARIES_ONLY)
+        add_subdirectory(doc)
+        add_subdirectory(doc/dev)
+        add_subdirectory(admin)
+    endif()
+endif()
+
+if(BUILD_SHELL_INTEGRATION)
+    add_subdirectory(shell_integration)
+endif()
 
 if(UNIT_TESTING)
     include(CTest)
@@ -213,7 +235,7 @@ endif(UNIT_TESTING)
 if(BUILD_OWNCLOUD_OSX_BUNDLE)
     install(FILES sync-exclude.lst DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/)
     configure_file(sync-exclude.lst bin/${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/sync-exclude.lst COPYONLY)
-else()
+elseif(BUILD_CLIENT)
     install( FILES sync-exclude.lst DESTINATION ${SYSCONFDIR}/${APPLICATION_SHORTNAME} )
     configure_file(sync-exclude.lst bin/sync-exclude.lst COPYONLY)
 endif()
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index dbca98a7d..bc34c8f39 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -12,10 +12,13 @@ if(SPHINX_FOUND)
     # assets
     set(LATEX_LOGO          "${CMAKE_CURRENT_SOURCE_DIR}/logo-blue.pdf")
 
-    install(DIRECTORY ${SPHINX_HTML_DIR} DESTINATION ${CMAKE_INSTALL_DOCDIR} OPTIONAL)
+    set(APPLICATION_DOC_DIR "${CMAKE_INSTALL_DOCDIR}/${PACKAGE}")
+    install(DIRECTORY ${SPHINX_HTML_DIR} DESTINATION ${APPLICATION_DOC_DIR} OPTIONAL)
+    install(DIRECTORY ${SPHINX_PDF_DIR} DESTINATION ${APPLICATION_DOC_DIR} OPTIONAL)
+    install(DIRECTORY ${SPHINX_QCH_DIR} DESTINATION ${APPLICATION_DOC_DIR} OPTIONAL)
+
     install(DIRECTORY ${SPHINX_MAN_DIR} DESTINATION ${CMAKE_INSTALL_MANDIR} OPTIONAL)
-    install(DIRECTORY ${SPHINX_PDF_DIR} DESTINATION ${CMAKE_INSTALL_DOCDIR} OPTIONAL)
-    install(DIRECTORY ${SPHINX_QCH_DIR} DESTINATION ${CMAKE_INSTALL_DOCDIR} OPTIONAL)
+
 
     configure_file("${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" conf.py @ONLY)
 
diff --git a/shell_integration/CMakeLists.txt b/shell_integration/CMakeLists.txt
index 03b2bbc34..85e539879 100644
--- a/shell_integration/CMakeLists.txt
+++ b/shell_integration/CMakeLists.txt
@@ -1,17 +1,23 @@
 if (APPLE)
   add_subdirectory(MacOSX)
 endif()
-add_subdirectory(icons)
+if(BUILD_SHELL_INTEGRATION_ICONS)
+  add_subdirectory(icons)
+endif()
 
 if( UNIX AND NOT APPLE )
-  add_subdirectory(nautilus)
+  if(BUILD_SHELL_INTEGRATION_NAUTILUS)
+    add_subdirectory(nautilus)
+  endif()
 
-  find_package(ECM 1.2.0 NO_MODULE QUIET)
-  set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
-  find_package(KF5 "5.16" COMPONENTS KIO)
-  if(KF5_FOUND)
-    add_subdirectory(dolphin)
-  else()
-    message("Dolphin plugin disabled: KDE Frameworks 5.16 not found")
+  if(BUILD_SHELL_INTEGRATION_DOLPHIN)
+    find_package(ECM 1.2.0 NO_MODULE QUIET)
+    set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+    find_package(KF5 "5.16" COMPONENTS KIO)
+    if(KF5_FOUND)
+        add_subdirectory(dolphin)
+    else()
+        message("Dolphin plugin disabled: KDE Frameworks 5.16 not found")
+    endif()
   endif()
 endif()
openSUSE Build Service is sponsored by