Added package generation
Some checks failed
the build failed

This commit is contained in:
tastytea 2018-08-30 19:51:46 +02:00
parent 8413aa67db
commit b2197397ed
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 93 additions and 13 deletions

View File

@ -5,20 +5,32 @@ pipeline:
commands: commands:
- apt-get update -q - apt-get update -q
- apt-get install -qy cmake libvsqlitepp-dev libboost-all-dev libxdg-basedir-dev - apt-get install -qy cmake libvsqlitepp-dev libboost-all-dev libxdg-basedir-dev
- apt-get install -qy rpm file
- rm -rf build && mkdir -p build && cd build - rm -rf build && mkdir -p build && cd build
- cmake .. - cmake ..
- make VERBOSE=1 - make VERBOSE=1
- make install DESTDIR=install - make install DESTDIR=install
- make package
- cmake -DWITH_DEB=ON ..
- make package
- cmake -DWITH_DEB=OFF -DWITH_RPM=ON ..
- make package
gcc7: gcc7:
image: gcc:7 image: gcc:7
pull: true pull: true
commands: commands:
- apt-get update -q - apt-get update -q
- apt-get install -qy cmake libvsqlitepp-dev libboost-all-dev libxdg-basedir-dev - apt-get install -qy cmake libvsqlitepp-dev libboost-all-dev libxdg-basedir-dev
- apt-get install -qy rpm file
- rm -rf build && mkdir -p build && cd build - rm -rf build && mkdir -p build && cd build
- cmake .. - cmake ..
- make VERBOSE=1 - make VERBOSE=1
- make install DESTDIR=install - make install DESTDIR=install
- make package
- cmake -DWITH_DEB=ON ..
- make package
- cmake -DWITH_DEB=OFF -DWITH_RPM=ON ..
- make package
gcc6: gcc6:
image: gcc:6 image: gcc:6
pull: true pull: true
@ -30,25 +42,39 @@ pipeline:
- apt-get install -qy -t stretch libvsqlitepp-dev libboost-all-dev - apt-get install -qy -t stretch libvsqlitepp-dev libboost-all-dev
- apt-get install -qy -t jessie-backports cmake - apt-get install -qy -t jessie-backports cmake
- apt-get install -qy libxdg-basedir-dev - apt-get install -qy libxdg-basedir-dev
- apt-get install -qy rpm file
- rm -rf build && mkdir -p build && cd build - rm -rf build && mkdir -p build && cd build
- cmake .. - cmake ..
- make VERBOSE=1 - make VERBOSE=1
- make install DESTDIR=install - make install DESTDIR=install
gcc5: - make package
image: gcc:5 - cmake -DWITH_DEB=ON ..
- make package
- cmake -DWITH_DEB=OFF -DWITH_RPM=ON ..
- make package
prepare_release:
image: gcc:6
pull: true pull: true
when:
event: tag
commands: commands:
- echo "deb http://deb.debian.org/debian jessie-backports main" >> /etc/apt/sources.list.d/backports.list - cp -v build/whyblocked*${DRONE_TAG}{.tar.gz,deb,rpm} .
- echo "deb http://deb.debian.org/debian stretch main" >> /etc/apt/sources.list.d/stretch.list gitea_release:
- echo "APT::Default-Release \"jessie\";" >> /etc/apt/apt.conf.d/00default_release image: plugins/gitea-release
- apt-get update -q pull: true
- apt-get install -qy -t stretch libvsqlitepp-dev libboost-all-dev when:
- apt-get install -qy -t jessie-backports cmake event: tag
- apt-get install -qy libxdg-basedir-dev base_url: https://schlomp.space
- rm -rf build && mkdir -p build && cd build secrets: [ gitea_token ]
- cmake .. title: ${DRONE_TAG}
- make VERBOSE=1 prerelease: true
- make install DESTDIR=install files:
- whyblocked-${DRONE_TAG}_x86_64.tar.gz
- whyblocked_${DRONE_TAG}-0_amd64.deb
- whyblocked-${DRONE_TAG}-0.x86_64.rpm
checksum:
- sha256
- sha512
notify: notify:
image: drillster/drone-email image: drillster/drone-email
pull: true pull: true

View File

@ -32,3 +32,57 @@ add_executable(whyblocked ${sources})
target_link_libraries(whyblocked target_link_libraries(whyblocked
${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp stdc++fs) ${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp stdc++fs)
install(TARGETS whyblocked DESTINATION ${CMAKE_INSTALL_BINDIR}) install(TARGETS whyblocked DESTINATION ${CMAKE_INSTALL_BINDIR})
# Packages
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
set(CPACK_PACKAGE_VERSION_MAJOR ${mastodon-cpp_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${mastodon-cpp_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${mastodon-cpp_VERSION_PATCH})
set(CPACK_PACKAGE_VERSION ${whyblocked_VERSION})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "whyblocked reminds you why you blocked someone.")
set(CPACK_PACKAGE_CONTACT "tastytea <tastytea@tastytea.de>")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md")
list(APPEND CPACK_SOURCE_IGNORE_FILES "/\\\\.git"
"/.gitignore"
"/build/"
"\\\\.sublime-"
"/.drone.yml")
execute_process(COMMAND uname -m
OUTPUT_VARIABLE CPACK_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}_${CPACK_PACKAGE_ARCHITECTURE}")
set(CPACK_GENERATOR "TGZ")
set(CPACK_SOURCE_GENERATOR "TGZ")
if (WITH_DEB)
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_GENERATOR "DEB")
set(CPACK_SOURCE_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://schlomp.space/tastytea/whyblocked")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
execute_process(COMMAND dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-0_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-0_src")
endif()
if (WITH_RPM)
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_GENERATOR "RPM")
set(CPACK_SOURCE_GENERATOR "RPM")
set(CPACK_RPM_PACKAGE_LICENSE "GPL-3")
set(CPACK_RPM_PACKAGE_URL "https://schlomp.space/tastytea/whyblocked")
set(CPACK_RPM_PACKAGE_REQUIRES "vsqlite++ >= 0.3.13 libxdg-basedir, >= 1.2.0")
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-0.${CPACK_PACKAGE_ARCHITECTURE}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-0.src")
endif()
include(CPack)