diff options
author | Martchus <martchus@gmx.net> | 2017-03-23 21:48:04 +0100 |
---|---|---|
committer | Martchus <martchus@gmx.net> | 2017-03-23 21:48:04 +0100 |
commit | 13f0799ec3ceb45e07cda4a79417d7272cf576c2 (patch) | |
tree | 0de41034f695ddd3561831a508cf8f18b51ad789 | |
download | pistache-git-13f0799ec3ceb45e07cda4a79417d7272cf576c2.tar.xz pistache-git-13f0799ec3ceb45e07cda4a79417d7272cf576c2.zip |
Initial import
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | 0001-Call-library-target-pistache-to-avoid-conflict-with-.patch | 82 | ||||
-rw-r--r-- | 0002-Export-targets.patch | 76 | ||||
-rw-r--r-- | PKGBUILD | 53 |
4 files changed, 234 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..8689171 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,23 @@ +# Generated by mksrcinfo v8 +# Thu Mar 23 20:48:04 UTC 2017 +pkgbase = pistache-git + pkgdesc = Modern and elegant HTTP and REST framework for C++ + pkgver = 176.8604968 + pkgrel = 1 + url = https://github.com/oktal/pistache + arch = i686 + arch = x86_64 + license = APACHE + makedepends = cmake + makedepends = git + provides = pistache + conflicts = pistache + source = pistache::git://github.com/oktal/pistache.git + source = 0001-Call-library-target-pistache-to-avoid-conflict-with-.patch + source = 0002-Export-targets.patch + sha256sums = SKIP + sha256sums = 28383926baaa5f8b57f3513d21cafe8997dc779cff8170676904c39e20e7a71e + sha256sums = 4e2a5cc2bd0c1c85d9bbff03325af03fb1742aefed7dbada231e76b4ad2d20e7 + +pkgname = pistache-git + diff --git a/0001-Call-library-target-pistache-to-avoid-conflict-with-.patch b/0001-Call-library-target-pistache-to-avoid-conflict-with-.patch new file mode 100644 index 0000000..1d930d6 --- /dev/null +++ b/0001-Call-library-target-pistache-to-avoid-conflict-with-.patch @@ -0,0 +1,82 @@ +From b9aac8b2d284179f2c4339e72311d61b20cc3614 Mon Sep 17 00:00:00 2001 +From: Martchus <martchus@gmx.net> +Date: Thu, 23 Mar 2017 20:42:27 +0100 +Subject: [PATCH 1/2] Call library target pistache to avoid conflict with + libnet + +--- + examples/CMakeLists.txt | 12 ++++++------ + src/CMakeLists.txt | 12 ++++++------ + tests/CMakeLists.txt | 2 +- + 3 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +index 253772d..079841b 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -1,21 +1,21 @@ + add_executable(http_server http_server.cc) +-target_link_libraries(http_server net_static) ++target_link_libraries(http_server pistache) + + add_executable(hello_server hello_server.cc) +-target_link_libraries(hello_server net_static) ++target_link_libraries(hello_server pistache) + + add_executable(http_client http_client.cc) +-target_link_libraries(http_client net_static) ++target_link_libraries(http_client pistache) + + add_executable(custom_header custom_header.cc) +-target_link_libraries(custom_header net_static) ++target_link_libraries(custom_header pistache) + + add_executable(rest_server rest_server.cc) +-target_link_libraries(rest_server net_static) ++target_link_libraries(rest_server pistache) + + find_package(RapidJSON) + if (RapidJSON_FOUND) + include_directories(${RapidJSON_INCLUDE_DIRS}) + add_executable(rest_description rest_description.cc) +-target_link_libraries(rest_description net_static) ++target_link_libraries(rest_description pistache) + endif() +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 8fcecf1..60902dd 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -8,11 +8,11 @@ set(SOURCE_FILES + ${CLIENT_SOURCE_FILES} + ) + +-add_library(net_static ${SOURCE_FILES}) +-target_link_libraries(net_static pthread) +-install(TARGETS net_static DESTINATION lib) ++add_library(pistache_static ${SOURCE_FILES}) ++target_link_libraries(pistache_static pthread) ++install(TARGETS pistache_static DESTINATION lib) + +-add_library(net SHARED ${SOURCE_FILES}) +-target_link_libraries(net pthread) +-install(TARGETS net DESTINATION lib) ++add_library(pistache SHARED ${SOURCE_FILES}) ++target_link_libraries(pistache pthread) ++install(TARGETS pistache DESTINATION lib) + +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index 155a411..bcf48ab 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -3,7 +3,7 @@ function(pistache_test test_name) + set(TEST_SOURCE ${test_name}.cc) + + add_executable(${TEST_EXECUTABLE} ${TEST_SOURCE}) +- target_link_libraries(${TEST_EXECUTABLE} gtest gtest_main net_static) ++ target_link_libraries(${TEST_EXECUTABLE} gtest gtest_main pistache) + add_test(${test_name} ${TEST_EXECUTABLE}) + endfunction() + +-- +2.12.1 + diff --git a/0002-Export-targets.patch b/0002-Export-targets.patch new file mode 100644 index 0000000..e390688 --- /dev/null +++ b/0002-Export-targets.patch @@ -0,0 +1,76 @@ +From 431986f951f5f5b3028e9262eed0e56d0f861dee Mon Sep 17 00:00:00 2001 +From: Martchus <martchus@gmx.net> +Date: Thu, 23 Mar 2017 20:50:21 +0100 +Subject: [PATCH 2/2] Export targets + +--- + CMakeLists.txt | 2 +- + src/CMakeLists.txt | 29 +++++++++++++++++++++++++++-- + src/PistacheConfig.cmake.in | 4 ++++ + 3 files changed, 32 insertions(+), 3 deletions(-) + create mode 100644 src/PistacheConfig.cmake.in + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e2c9916..0197e24 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required (VERSION 2.8.7) ++cmake_minimum_required (VERSION 3.0.2) + project (pistache) + include(CheckCXXCompilerFlag) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 60902dd..c1d88e4 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -10,9 +10,34 @@ set(SOURCE_FILES + + add_library(pistache_static ${SOURCE_FILES}) + target_link_libraries(pistache_static pthread) +-install(TARGETS pistache_static DESTINATION lib) ++install(TARGETS pistache_static ++ EXPORT PistacheStaticTargets ++ DESTINATION lib) ++install(EXPORT PistacheStaticTargets ++ DESTINATION "lib/cmake/pistache" ++ EXPORT_LINK_INTERFACE_LIBRARIES ++ COMPONENT cmake-config ++) + + add_library(pistache SHARED ${SOURCE_FILES}) + target_link_libraries(pistache pthread) +-install(TARGETS pistache DESTINATION lib) ++install(TARGETS pistache ++ EXPORT PistacheSharedTargets ++ DESTINATION lib) ++install(EXPORT PistacheSharedTargets ++ DESTINATION "lib/cmake/pistache" ++ EXPORT_LINK_INTERFACE_LIBRARIES ++ COMPONENT cmake-config ++) + ++include(CMakePackageConfigHelpers) ++configure_package_config_file( ++ "PistacheConfig.cmake.in" ++ "${CMAKE_CURRENT_BINARY_DIR}/PistacheConfig.cmake" ++ INSTALL_DESTINATION "lib/cmake/pistache" ++) ++install( ++ FILES "${CMAKE_CURRENT_BINARY_DIR}/PistacheConfig.cmake" ++ DESTINATION "lib/cmake/pistache" ++ COMPONENT cmake-config ++) +diff --git a/src/PistacheConfig.cmake.in b/src/PistacheConfig.cmake.in +new file mode 100644 +index 0000000..a5dca28 +--- /dev/null ++++ b/src/PistacheConfig.cmake.in +@@ -0,0 +1,4 @@ ++@PACKAGE_INIT@ ++ ++include("${CMAKE_CURRENT_LIST_DIR}/PistacheSharedTargets.cmake") ++include("${CMAKE_CURRENT_LIST_DIR}/PistacheStaticTargets.cmake") +-- +2.12.1 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..a52e5ce --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,53 @@ +# Maintainer: Martchus <martchus@gmx.net> + +# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where +# you also find the URL of a binary repository. + +pkgname=pistache-git +_name=${pkgname%-git} +pkgver=176.8604968 +pkgrel=1 +arch=('i686' 'x86_64') +pkgdesc='Modern and elegant HTTP and REST framework for C++' +license=('APACHE') +depends=() +makedepends=('cmake' 'git') +provides=("${_name}") +conflicts=("${_name}") +url="https://github.com/oktal/${_name}" +source=("${_name}::git://github.com/oktal/${_name}.git" + '0001-Call-library-target-pistache-to-avoid-conflict-with-.patch' + '0002-Export-targets.patch') +sha256sums=('SKIP' + '28383926baaa5f8b57f3513d21cafe8997dc779cff8170676904c39e20e7a71e' + '4e2a5cc2bd0c1c85d9bbff03325af03fb1742aefed7dbada231e76b4ad2d20e7') + +pkgver() { + cd "${srcdir}/${_name}" + echo "$(git rev-list --count HEAD).$(git rev-parse --short HEAD)" +} + +prepare() { + cd "${srcdir}/${_name}" + + patch -p1 -i "${srcdir}/0001-Call-library-target-pistache-to-avoid-conflict-with-.patch" + patch -p1 -i "${srcdir}/0002-Export-targets.patch" +} + +build() { + cd "${srcdir}/${_name}" + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="/usr" + make +} + +check() { + cd "${srcdir}/${_name}" + make test +} + +package() { + cd "${srcdir}/${_name}" + make DESTDIR="${pkgdir}" install +} |