From 438a3932e156e9b066f74c19cd4c44ffc860a7cf Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 8 Apr 2019 21:24:08 +0200 Subject: [PATCH] Build RPM packages on CentOS. --- .drone.yml | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- README.md | 8 +++++--- 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/.drone.yml b/.drone.yml index b059554..839a057 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,6 +3,8 @@ pipeline: gcc6: image: debian:stretch-slim pull: true + when: + event: [push, pull_request] environment: - LANG=C.utf8 - CXX=g++-6 @@ -89,15 +91,55 @@ pipeline: volumes: - /var/cache/debian-package-cache:/var/cache/apt/archives - prepare_release: + package_deb: image: debian:stretch-slim pull: true when: event: tag + environment: + - LANG=C.utf8 + - CXXFLAGS=-pipe -O2 commands: - - cp -v build/mastodon-cpp-${DRONE_TAG}_x86_64.tar.gz . - - cp -v build/libmastodon-cpp_${DRONE_TAG}-0_amd64.deb . - - cp -v build/libmastodon-cpp-${DRONE_TAG}-0.x86_64.rpm . + - rm /etc/apt/apt.conf.d/docker-clean + - echo "APT::Default-Release \"stretch\";" >> /etc/apt/apt.conf.d/00default_release + - echo "deb http://deb.debian.org/debian sid main" >> /etc/apt/sources.list.d/sid.list + - apt-get update -q + - apt-get install -qy build-essential cmake pkg-config + - apt-get install -qy libcurl4-openssl-dev libjsoncpp-dev doxygen + - apt-get install -qy -t sid libcurlpp-dev + - rm -rf build && mkdir -p build && cd build + - cmake -DWITH_EXAMPLES=NO -DWITH_TESTS=NO .. + - make package + - cmake -DWITH_DEB=YES .. + - make package + - cp -v mastodon-cpp-${DRONE_TAG}_x86_64.tar.gz .. + - cp -v libmastodon-cpp_${DRONE_TAG}-0_amd64.deb .. + volumes: + - /var/cache/debian-package-cache:/var/cache/apt/archives + + package_rpm: + image: centos:7 + pull: true + when: + event: tag + environment: + - LANG=C.utf8 + - CXXFLAGS=-pipe -O2 + commands: + - cd /var/cache/yum && wget -nc http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && cd - + - rpm -i epel-release-latest-7.noarch.rpm + - yum group install -qy "Development Tools" + - yum install -qy cmake libcurl-devel doxygen + - yum --enablerepo=epel install -qy jsoncpp-devel libcurlpp-devel + - yum install -qy rpm file + - rm -rf build && mkdir -p build && cd build + - cmake -DWITH_EXAMPLES=NO -DWITH_TESTS=NO .. + - make package + - cmake -DWITH_RPM=YES .. + - make package + - cp -v libmastodon-cpp-${DRONE_TAG}-0.x86_64.rpm .. + volumes: + - /var/cache/centos-package-cache:/var/cache/yum/ gitea_release: image: plugins/gitea-release diff --git a/README.md b/README.md index 08ebae4..2b057f6 100644 --- a/README.md +++ b/README.md @@ -116,10 +116,12 @@ emerge -a dev-cpp/mastodon-cpp ### DEB and RPM Prebuilt DEB and RPM packages for x86_64(amd64) are provided with each release. -These packages are automatically built and not tested. -Install with `dpkg -i` or `rpm -i`, respectively. +`.deb` packages are built on Debian stretch and `.rpm` packages are built on +CentOS 7. These packages are automatically built and not tested. Install with +`dpkg -i` or `rpm -i`, respectively. -To use the DEB package on stretch, you will need [libcurlpp0](https://packages.debian.org/libcurlpp0) from sid. +To use the DEB package on Debian stretch, you will need +[libcurlpp0](https://packages.debian.org/libcurlpp0) from sid. ## From source