diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ab0c61ad..db3907525 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,6 +199,9 @@ if (TESTS) add_test(zn_large_data_test bash routed.sh zn_large_data_test) endif(TESTS) + + + # For packaging if (PACKAGING) @@ -223,19 +226,16 @@ if (PACKAGING) set(CPACK_COMPONENT_LIB_DESCRIPTION "The C client library for Eclipse zenoh") set(CPACK_COMPONENT_DEV_DESCRIPTION "${CPACK_COMPONENT_LIB_DESCRIPTION} - devel files") + # Sources package set(CPACK_SOURCE_GENERATOR "TGZ") set(CPACK_SOURCE_IGNORE_FILES "/.git/;/build/") - set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}") + set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-src-${PROJECT_VERSION}") set(CPACK_GENERATOR "") if(CMAKE_SYSTEM_NAME STREQUAL "Linux") message(STATUS "Configure packaging for Linux ${TARGET_ARCH}") - # Sources package - set(CPACK_SOURCE_GENERATOR "TGZ") - set(CPACK_SOURCE_IGNORE_FILES "/.git/;/build/") - set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}") - set(CPACK_GENERATOR "DEB;RPM") + # DEB package set(CPACK_DEBIAN_PACKAGE_MAINTAINER "ADLINK zenoh team, ") set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${TARGET_ARCH}) diff --git a/Jenkinsfile b/Jenkinsfile index 2289ed39c..f7b111987 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent { label 'UbuntuVM' } + agent { label 'MacMini' } parameters { gitParameter name: 'TAG', type: 'PT_TAG', @@ -32,16 +32,32 @@ pipeline { steps { sh ''' docker images || true - make all-cross + make all all-cross ''' } } - stage('Deploy to to download.eclipse.org') { + stage('Deploy to download.eclipse.org') { steps { sshagent ( ['projects-storage.eclipse.org-bot-ssh']) { sh ''' - ssh genie.zenoh@projects-storage.eclipse.org mkdir -p /home/data/httpd/download.eclipse.org/zenoh/zenoh-c/${TAG} - scp build/crossbuilds/*/*.deb* build/crossbuilds/*/*.rpm* genie.zenoh@projects-storage.eclipse.org:/home/data/httpd/download.eclipse.org/zenoh/zenoh-c/${TAG}/ + HOST="genie.zenoh@projects-storage.eclipse.org" + DOWNLOAD_DIR="/home/data/httpd/download.eclipse.org/zenoh/zenoh-c/${TAG}" + ssh ${HOST} rm -fr ${DOWNLOAD_DIR} + ssh ${HOST} mkdir -p ${DOWNLOAD_DIR} + + for PLATFORM in `ls build/crossbuilds/`; do + echo "Deploy for platform: ${PLATFORM}" + ssh ${HOST} mkdir -p ${DOWNLOAD_DIR}/${PLATFORM} + scp build/crossbuilds/${PLATFORM}/libzenohc*.* build/crossbuilds/${PLATFORM}/z_* build/crossbuilds/${PLATFORM}/zn_* ${DOWNLOAD_DIR}/${PLATFORM}/ + done + + echo "Deploy for platform: OSX" + ssh ${HOST} mkdir -p ${DOWNLOAD_DIR}/OSX + scp build/crossbuilds/${PLATFORM}/libzenohc*.* build/crossbuilds/${PLATFORM}/z_* build/crossbuilds/${PLATFORM}/zn_* ${DOWNLOAD_DIR}/OSX/ + + echo "Deploy include files" + tar czvf zenoh-c-includes.tgz include/ + scp zenoh-c-includes.tgz ${DOWNLOAD_DIR}/ ''' } } diff --git a/Makefile b/Makefile index ce97f006d..c1e0ca02c 100644 --- a/Makefile +++ b/Makefile @@ -22,15 +22,13 @@ ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) # Build directory BUILD_DIR=build -CROSS_BUILD_TARGETS=manylinux2010-x64 manylinux2010-x86 linux-armv5 linux-armv6 linux-arm64 osx-64 +CROSS_BUILD_TARGETS=manylinux2010-x64 manylinux2010-x86 linux-armv5 linux-armv6 linux-arm64 CROSS_BUILD_DIR=$(BUILD_DIR)/crossbuilds CROSS_SCRIPTS_DIR=crossbuilds # NOTES: # - ARM: can't use dockcross/dockcross since it uses an old GCC (4.8.3) which lacks (even using -std=gnu11) -# - MacOS: can't use multiarch/crossbuild since it uses Clang 3.5.0 which lacks (even using -std=gnu11) DOCKER_CROSSBUILD_IMAGE=multiarch/crossbuild -DOCKER_OSXCROSS_IMAGE=liushuyu/osxcross DOCKCROSS_x86_IMAGE=dockcross/manylinux2010-x86 DOCKCROSS_x64_IMAGE=dockcross/manylinux2010-x64 @@ -68,7 +66,6 @@ test: $(BUILD_DIR)/Makefile DOCKER_OK := $(shell docker version 2> /dev/null) DOCKER_CROSSBUILD_INFO := $(shell docker image inspect $(DOCKER_CROSSBUILD_IMAGE) 2> /dev/null) -DOCKER_OSXCROSS_INFO := $(shell docker image inspect $(DOCKER_OSXCROSS_IMAGE) 2> /dev/null) DOCKCROSS_x86_INFO := $(shell docker image inspect $(DOCKCROSS_x86_IMAGE) 2> /dev/null) DOCKCROSS_x64_INFO := $(shell docker image inspect $(DOCKCROSS_x64_IMAGE) 2> /dev/null) @@ -79,9 +76,6 @@ endif ifeq ($(DOCKER_CROSSBUILD_INFO),[]) docker pull $(DOCKER_CROSSBUILD_IMAGE) endif -ifeq ($(DOCKER_OSXCROSS_INFO),[]) - docker pull $(DOCKER_OSXCROSS_IMAGE) -endif ifeq ($(DOCKCROSS_x86_INFO),[]) docker pull $(DOCKCROSS_x86_IMAGE) endif @@ -108,11 +102,6 @@ linux-arm64: check-docker docker run --rm -v $(ROOT_DIR):/workdir -e CROSS_TRIPLE=aarch64-linux-gnu $(DOCKER_CROSSBUILD_IMAGE) \ make VERBOSE=1 -C$(CROSS_BUILD_DIR)/$@ all -osx-64: check-docker - docker run --rm -v $(ROOT_DIR):/workdir -w /workdir -e CC=x86_64-apple-darwin18-clang -e CXX=x86_64-apple-darwin18-clang $(DOCKER_OSXCROSS_IMAGE) bash -c "\ - cmake $(CMAKE_OPT) -DCMAKE_SYSTEM_NAME=Darwin -B$(CROSS_BUILD_DIR)/$@ && \ - make VERBOSE=1 -C$(CROSS_BUILD_DIR)/$@ all" - manylinux2010-x86: check-docker docker run --rm -v $(ROOT_DIR):/workdir -w /workdir $(DOCKCROSS_x86_IMAGE) bash -c "\ cmake $(CMAKE_OPT) -DPACKAGING=ON -DTARGET_ARCH=i386 -B$(CROSS_BUILD_DIR)/$@ && \