summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Adamansky <adamansky@gmail.com>2015-03-12 22:56:43 +0600
committerAnton Adamansky <adamansky@gmail.com>2015-03-12 22:56:43 +0600
commit3d4daa1a33132ad06cf557f516eadf3dbb7969a7 (patch)
treebb1e1aef4d14c8054a5047f4edff9a63fd5681b6
parentced940c57ab20866ab25cf7b221737c8ccf2c0e5 (diff)
downloadejdb-3d4daa1a33132ad06cf557f516eadf3dbb7969a7.tar.gz
ejdb-3d4daa1a33132ad06cf557f516eadf3dbb7969a7.tar.bz2
ejdb-3d4daa1a33132ad06cf557f516eadf3dbb7969a7.zip
#115
-rw-r--r--tcejdb/CMakeLists.txt37
-rw-r--r--tcejdb/Changelog2
-rw-r--r--tcejdb/cmake/Modules/UploadPPA.cmake63
-rw-r--r--tcejdb/installer/CMakeLists.txt5
-rw-r--r--tcejdb/src/CMakeLists.txt7
5 files changed, 69 insertions, 45 deletions
diff --git a/tcejdb/CMakeLists.txt b/tcejdb/CMakeLists.txt
index c68de43..84f6afa 100644
--- a/tcejdb/CMakeLists.txt
+++ b/tcejdb/CMakeLists.txt
@@ -1,18 +1,29 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 2.8.12)
set(PROJECT_NAME "ejdb")
set(PROJECT_VENDOR "Softmotions")
set(PROJECT_WEBSITE "http://ejdb.org")
set(PROJECT_MAINTAINER "Anton Adamansky <adamansky@gmail.com>")
set(PROJECT_DESCRIPTION_SUMMARY "Embedded JSON database library (EJDB)")
-set(PROJECT_DESCRIPTION ${PROJECT_DESCRIPTION_SUMMARY})
+set(PROJECT_DESCRIPTION
+"EJDB aims to be a fast MongoDB-like library which can be embedded into C/C++ applications under terms of LGPL license.")
set(PROJECT_PPA "ppa:adamansky/ejdb")
-project(${PROJECT_NAME} VERSION 1.2.0 LANGUAGES C)
+project(${PROJECT_NAME} C)
+
+set(PROJECT_VERSION_MAJOR 1)
+set(PROJECT_VERSION_MINOR 2)
+set(PROJECT_VERSION_PATCH 2)
+set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
+set(${PROJECT_NAME}_VERSION ${PROJECT_VERSION})
+set(${PROJECT_NAME}_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
+set(${PROJECT_NAME}_VERSION_MINOR ${PROJECT_VERSION_MINOR})
+set(${PROJECT_NAME}_VERSION_PATCH ${PROJECT_VERSION_PATCH})
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(BUILD_TESTS "Build test cases" OFF)
option(PACKAGE_DEB "Build .deb instalation packages" OFF)
option(PACKAGE_TGZ "Build .tgz package archive" ON)
+option(ENABLE_PPA "Enable PPA package build" OFF)
option(UPLOAD_PPA "Upload debian packages to the launchpad ppa repository" OFF)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
@@ -24,28 +35,32 @@ macro_ensure_out_of_source_build(
"${CMAKE_PROJECT_NAME} requires an out of source build."
)
-if (NOT PACKAGE_DEB)
- add_subdirectory(src)
+if (UPLOAD_PPA)
+ set(ENABLE_PPA ON)
endif()
-#######################################################
+if (NOT ENABLE_PPA)
+ add_subdirectory(src)
+endif()
set(CPACK_GENERATORS)
if (PACKAGE_TGZ)
list(APPEND CPACK_GENERATORS "TGZ")
endif()
-if (PACKAGE_DEB)
+if (PACKAGE_DEB OR ENABLE_PPA)
list(APPEND CPACK_GENERATORS "DEB")
endif()
if (CPACK_GENERATORS)
set(CPACK_GENERATOR "${CPACK_GENERATORS}")
+ set(CPACK_SOURCE_IGNORE_FILES
+ "tcejdb.mk"
+ "tcejdb.project"
+ ".cmake_dirty"
+ "ctest.cmake"
+ )
add_subdirectory(installer)
endif()
-#########################################################
-
message("CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
message("CPACK_GENERATORS: ${CPACK_GENERATORS}")
-
-
diff --git a/tcejdb/Changelog b/tcejdb/Changelog
index 12139c7..28a5aee 100644
--- a/tcejdb/Changelog
+++ b/tcejdb/Changelog
@@ -1,4 +1,4 @@
-libejdb (1.2.0-0ubuntu1) testing; urgency=low
+libejdb (1.2.0-0ppa1) testing; urgency=low
* Added negation support for the $elemMatch #109
* Set `TCETHREAD` when pthread mutex or lock allocation fails.
diff --git a/tcejdb/cmake/Modules/UploadPPA.cmake b/tcejdb/cmake/Modules/UploadPPA.cmake
index 504859b..0e00351 100644
--- a/tcejdb/cmake/Modules/UploadPPA.cmake
+++ b/tcejdb/cmake/Modules/UploadPPA.cmake
@@ -126,7 +126,7 @@ set(DEBIAN_SOURCE_DIR ${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${CPACK_DEBIAN_PACKAG
##############################################################################
# debian/control
set(debian_control ${DEBIAN_SOURCE_DIR}/debian/control)
-list(APPEND CPACK_DEBIAN_PACKAGE_BUILD_DEPENDS cmake)
+list(APPEND CPACK_DEBIAN_PACKAGE_BUILD_DEPENDS cmake debhelper)
list(REMOVE_DUPLICATES CPACK_DEBIAN_PACKAGE_BUILD_DEPENDS)
list(SORT CPACK_DEBIAN_PACKAGE_BUILD_DEPENDS)
string(REPLACE ";" ", " build_depends "${CPACK_DEBIAN_PACKAGE_BUILD_DEPENDS}")
@@ -137,33 +137,33 @@ file(WRITE ${debian_control}
"Priority: ${CPACK_DEBIAN_PACKAGE_PRIORITY}\n"
"Maintainer: ${CPACK_DEBIAN_PACKAGE_MAINTAINER}\n"
"Build-Depends: ${build_depends}\n"
- "Standards-Version: 3.9.3\n"
+ "Standards-Version: 3.9.5\n"
"Homepage: ${CPACK_DEBIAN_PACKAGE_HOMEPAGE}\n"
"\n"
"Package: ${CPACK_DEBIAN_PACKAGE_NAME}\n"
"Architecture: ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}\n"
- "Depends: ${bin_depends}, \${shlibs:Depends}\n"
- "Description: ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}\n"
+ "Depends: ${bin_depends}, \${shlibs:Depends}, \${misc:Depends}\n"
+ "Description: ${CPACK_PACKAGE_DESCRIPTION}\n"
"${deb_long_description}"
)
-#foreach(COMPONENT ${CPACK_COMPONENTS_ALL})
-# string(TOUPPER ${COMPONENT} UPPER_COMPONENT)
-# set(DEPENDS "${CPACK_DEBIAN_PACKAGE_NAME}")
-# foreach(DEP ${CPACK_COMPONENT_${UPPER_COMPONENT}_DEPENDS})
-# set(DEPENDS "${DEPENDS}, ${CPACK_DEBIAN_PACKAGE_NAME}-${DEP}")
-# endforeach(DEP ${CPACK_COMPONENT_${UPPER_COMPONENT}_DEPENDS})
-# file(APPEND ${debian_control} "\n"
-# "Package: ${CPACK_DEBIAN_PACKAGE_NAME}-${COMPONENT}\n"
-# "Architecture: ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}\n"
-# "Depends: ${DEPENDS}\n"
-# "Description: ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}"
-# ": ${CPACK_COMPONENT_${UPPER_COMPONENT}_DISPLAY_NAME}\n"
-# "${deb_long_description}"
-# " .\n"
-# " ${CPACK_COMPONENT_${UPPER_COMPONENT}_DESCRIPTION}\n"
-# )
-#endforeach(COMPONENT ${CPACK_COMPONENTS_ALL})
+foreach(COMPONENT ${CPACK_COMPONENTS_ALL})
+ string(TOUPPER ${COMPONENT} UPPER_COMPONENT)
+ set(DEPENDS "${CPACK_DEBIAN_PACKAGE_NAME}")
+ foreach(DEP ${CPACK_COMPONENT_${UPPER_COMPONENT}_DEPENDS})
+ set(DEPENDS "${DEPENDS}, ${CPACK_DEBIAN_PACKAGE_NAME}-${DEP}")
+ endforeach(DEP ${CPACK_COMPONENT_${UPPER_COMPONENT}_DEPENDS})
+ file(APPEND ${debian_control} "\n"
+ "Package: ${CPACK_DEBIAN_PACKAGE_NAME}-${COMPONENT}\n"
+ "Architecture: ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}\n"
+ "Depends: ${DEPENDS}\n"
+ "Description: ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}"
+ ": ${CPACK_COMPONENT_${UPPER_COMPONENT}_DISPLAY_NAME}\n"
+ "${deb_long_description}"
+ " .\n"
+ " ${CPACK_COMPONENT_${UPPER_COMPONENT}_DESCRIPTION}\n"
+ )
+endforeach(COMPONENT ${CPACK_COMPONENTS_ALL})
##############################################################################
# debian/copyright
@@ -174,7 +174,6 @@ configure_file(${CPACK_RESOURCE_FILE_LICENSE} ${debian_copyright} COPYONLY)
# debian/rules
set(debian_rules ${DEBIAN_SOURCE_DIR}/debian/rules)
-
if(OLD_RULES)
file(WRITE ${debian_rules}
"#!/usr/bin/make -f\n"
@@ -235,7 +234,6 @@ foreach(component ${CPACK_COMPONENTS_ALL})
endif(NOT CPACK_COMPONENT_${COMPONENT}_BINARY_INDEP)
endforeach(component)
-
file(APPEND ${debian_rules}
"\n"
"binary-indep: build-indep\n"
@@ -265,13 +263,17 @@ file(APPEND ${debian_rules}
".PHONY: binary binary-arch binary-indep clean\n"
)
-
else()
+
file(WRITE ${debian_rules}
-"#!/usr/bin/make -f\n"
-"%:\n"
-"\tdh $@ --buildsystem=cmake\n"
+ "#!/usr/bin/make -f\n"
+ "\nexport DH_VERBOSE=1"
+ "\n%:\n"
+ "\tdh $@ --buildsystem=cmake\n"
+ "\noverride_dh_auto_configure:\n"
+ "\tdh_auto_configure -- -DBUILD_SHARED_LIBS=ON -DPACKAGE_DEB=OFF -DPACKAGE_TGZ=OFF"
)
+
endif(OLD_RULES)
execute_process(COMMAND chmod +x ${debian_rules})
@@ -335,6 +337,7 @@ endif()
# )
set(CPACK_SOURCE_IGNORE_FILES
+ ${CPACK_SOURCE_IGNORE_FILES}
"/build/"
"/build-*/"
"/debian/"
@@ -345,7 +348,8 @@ set(CPACK_SOURCE_IGNORE_FILES
"/packaging/"
"*~")
-set(package_file_name "${CPACK_DEBIAN_PACKAGE_NAME}_${DEBIAN_PACKAGE_VERSION}")
+#set(package_file_name "${CPACK_DEBIAN_PACKAGE_NAME}_${DEBIAN_PACKAGE_VERSION}")
+set(package_file_name "${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}")
file(WRITE "${CMAKE_BINARY_DIR}/Debian/${DISTRI}/cpack.cmake"
"set(CPACK_GENERATOR TGZ)\n"
@@ -355,9 +359,10 @@ file(WRITE "${CMAKE_BINARY_DIR}/Debian/${DISTRI}/cpack.cmake"
"set(CPACK_PACKAGE_DESCRIPTION \"${CPACK_PACKAGE_NAME} Source\")\n"
"set(CPACK_IGNORE_FILES \"${CPACK_SOURCE_IGNORE_FILES}\")\n"
"set(CPACK_INSTALLED_DIRECTORIES \"${CPACK_SOURCE_INSTALLED_DIRECTORIES}\")\n"
+ "set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)\n"
)
-set(orig_file "${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${DEBIAN_PACKAGE_VERSION}.orig.tar.gz")
+set(orig_file "${CMAKE_BINARY_DIR}/Debian/${DISTRI}/${package_file_name}.orig.tar.gz")
add_custom_command(OUTPUT ${orig_file}
COMMAND cpack --config ${CMAKE_BINARY_DIR}/Debian/${DISTRI}/cpack.cmake
diff --git a/tcejdb/installer/CMakeLists.txt b/tcejdb/installer/CMakeLists.txt
index 39bcf58..9d08c24 100644
--- a/tcejdb/installer/CMakeLists.txt
+++ b/tcejdb/installer/CMakeLists.txt
@@ -27,12 +27,13 @@ if (PACKAGE_DEB)
if (EXECUTE_RESULT)
message(FATAL_ERROR "dpkg not found: No package generation.")
endif()
+ set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION})
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${PROJECT_WEBSITE})
set(CPACK_DEBIAN_PACKAGE_SECTION libs)
set(CPACK_DEBIAN_PACKAGE_PRIORITY optional)
set(CPACK_DEBIAN_PACKAGE_DEPENDS zlib1g)
- set(CPACK_DEBIAN_PACKAGE_BUILD_DEPENDS cmake pkg-config git devscripts dh-make zlib1g-dev)
- set(PPA_DEBIAN_VERSION ppa1)
+ set(CPACK_DEBIAN_PACKAGE_BUILD_DEPENDS pkg-config git devscripts dh-make zlib1g-dev)
+ set(PPA_DEBIAN_VERSION 0ppa3)
if (PROJECT_PPA)
set(DPUT_HOST ${PROJECT_PPA})
endif()
diff --git a/tcejdb/src/CMakeLists.txt b/tcejdb/src/CMakeLists.txt
index 4e3da14..4efe60d 100644
--- a/tcejdb/src/CMakeLists.txt
+++ b/tcejdb/src/CMakeLists.txt
@@ -232,8 +232,11 @@ install(FILES
${CMAKE_SOURCE_DIR}/Changelog
DESTINATION ${CMAKE_INSTALL_DOCDIR})
-
-export(EXPORT ejdb-exports)
+if (CMAKE_VERSION VERSION_GREATER 3.0)
+ export(EXPORT ejdb-exports)
+else()
+ export(TARGETS ejdb FILE ejdb-exports.cmake)
+endif()
message("")