Unverified Commit 55727103 authored by Kip's avatar Kip Committed by GitHub

Merge pull request #974 from Tachi107/debian-remove

Moved Debian data to the `debian` branch
parents b23ead34 f6b29f4e
......@@ -26,7 +26,14 @@ jobs:
arch: [ amd64, arm64, armhf, i386, ppc64el ] # , s390x
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
- name: Checkout Debian data
uses: actions/checkout@v2
with:
ref: debian
path: debian
# The Debian repository is needed by autopkgtest-build-qemu when building
# for foreign architectures, since the tool tries to install
......
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: pistache
Upstream-Contact: Mathieu Stefani <auquetal@gmail.com>
Source: https://github.com/pistacheio/pistache
Files: debian/*
Copyright: 2019 Kip Warner
License: Apache-2.0
......@@ -74,7 +74,7 @@ But until then currently Pistache has partially compliant upstream Debianization
#### Supported Architectures
Currently Pistache is built and tested on a number of [architectures](https://wiki.debian.org/SupportedArchitectures). Some of these are suitable for desktop or server use and others for embedded environments. As of this writing we do not currently have any MIPS related packages that have been either built or tested. The `ppc64el` builds are occasionally tested on POWER9 hardware, courtesy of IBM.
Currently Pistache is built and tested on a number of [architectures](https://wiki.debian.org/SupportedArchitectures). Some of these are suitable for desktop or server use and others for embedded environments. As of this writing we do not currently have any MIPS related packages that have been either built or tested.
- amd64
- arm64
......@@ -228,47 +228,6 @@ Some other Meson options:
| PISTACHE_BUILD_EXAMPLES | False | Build all of the example apps |
| PISTACHE_BUILD_DOCS | False | Build Doxygen docs |
## Continuous Integration Testing
It is important that all patches pass unit testing. Unfortunately developers make all kinds of changes to their local development environment that can have unintended consequences. This can means sometimes tests on the developer's computer pass when they should not, and other times failing when they should not have.
To properly validate that things are working, continuous integration (CI) is required. This means compiling, performing local in-tree unit tests, installing through the system package manager, and finally testing the actually installed build artifacts to ensure they do what the user expects them to do.
The key thing to remember is that in order to do this properly, this all needs to be done within a realistic end user system that hasn't been unintentionally modified by a developer. This might mean a chroot container with the help of QEMU and KVM to verify that everything is working as expected. The hermetically sealed test environment validates that the developer's expected steps for compilation, linking, unit testing, and post installation testing are actually replicable.
There are [different ways](https://wiki.debian.org/qa.debian.org#Other_distributions) of performing CI on different distros. The most common one is via the international [DEP-8](https://dep-team.pages.debian.net/deps/dep8/) standard as used by hundreds of different operating systems.
### Autopkgtest
On Debian based distributions, `autopkgtest` implements the DEP-8 standard. To create and use a build image environment for Ubuntu, follow these steps. First install the autopkgtest(1) tools:
```sh
$ sudo apt install autopkgtest
```
Next create the test image, substituting `groovy` or `amd64` for other releases or architectures:
```sh
$ autopkgtest-buildvm-ubuntu-cloud -r groovy -a amd64
```
Generate a Pistache source package in the parent directory of `pistache_source`:
```sh
$ cd pistache_source
$ sudo apt build-dep pistache
$ ./debian/rules get-orig-source
$ debuild -S -sa -uc -us
```
Test the source package on the host architecture in QEMU with KVM support and 8GB of RAM and four CPUs:
```sh
$ autopkgtest --shell-fail --apt-upgrade ../pistache_(...).dsc -- \
qemu --ram-size=8192 --cpus=4 --show-boot path_to_build_image.img \
--qemu-options='-enable-kvm'
```
## Example
### Hello World (server)
......
pistache (0.0.002-pistache1) groovy; urgency=medium
* Latest upstream.
-- Kip Warner <kip@thevertigo.com> Sun, 27 Dec 2020 16:40:00 -0700
# SPDX-FileCopyrightText: 2019 Kip Warner
#
# SPDX-License-Identifier: Apache-2.0
Source: pistache
Section: libdevel
Priority: optional
Maintainer: Kip Warner <kip@thevertigo.com>
Standards-Version: 4.2.1
Build-Depends:
meson (>= 0.50.0),
cppcheck,
debhelper-compat (= 12),
dh-exec,
libc6-dev (>= 2.26),
libcurl4-openssl-dev,
libgtest-dev (>= 1.8.0),
libssl-dev (>= 1.1.1),
libstdc++6 (>= 7.2.0),
lintian,
pkg-config (>= 0.28),
rapidjson-dev (>= 1.1.0),
valgrind
Vcs-Git: https://github.com/pistacheio/pistache.git
Vcs-browser: https://github.com/pistacheio/pistache
Homepage: http://pistache.io
Package: libpistache-dev
Architecture: any
Pre-Depends: ${misc:Pre-Depends}
Depends:
${misc:Depends},
pkg-config (>= 0.28),
libpistache0 (= ${binary:Version}),
libssl-dev,
rapidjson-dev (>= 1.1.0)
Description: elegant C++ REST framework
Pistache is a C++ REST framework originally written by Mathieu Stefani at
Datacratic, since maintained by other volunteers. It is written in pure C++17
with no external dependency and provides a low-level HTTP abstraction.
.
Pistache provides both an HTTP client and server that can be used to create and
query complex web and REST APIs.
.
Pistache is released under the Apache License 2.0 license.
.
This package contains the development headers, static library, and examples.
The static library was built with SSL support.
Package: libpistache0
Architecture: any
Pre-Depends: ${misc:Pre-Depends}
Depends:
${misc:Depends},
${shlibs:Depends}
Description: elegant C++ REST framework
Pistache is a C++ REST framework originally written by Mathieu Stefani at
Datacratic, since maintained by other volunteers. It is written in pure C++17
with no external dependency and provides a low-level HTTP abstraction.
.
Pistache provides both an HTTP client and server that can be used to create and
query complex web and REST APIs.
.
Pistache is released under the Apache License 2.0 license.
.
This package contains the shared library built with SSL support.
# SPDX-FileCopyrightText: 2019 Kip Warner
#
# SPDX-License-Identifier: Apache-2.0
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: pistache
Upstream-Contact: Kip Warner <kip@thevertigo.com>
Source: https://github.com/pistacheio/pistache.git
Comment: Upstream's Debianization.
Files: *
Copyright: Copyright 2001-2019 Mathieu Stefani <m.stefani@abc-arbitrage.com>
License: Apache-2.0
A permissive license whose main conditions require preservation of copyright
and license notices. Contributors provide an express grant of patent rights.
Licensed works, modifications, and larger works may be distributed under
different terms and without source code.
usr/include
usr/lib/*/pkgconfig
usr/lib/*/libpistache*.a
usr/lib/*/libpistache*.so
usr/lib/*/libpistache*.so.*
#!/usr/bin/make -f
# SPDX-FileCopyrightText: 2019 Kip Warner
#
# SPDX-License-Identifier: Apache-2.0
# Output every command that modifies files on the build system...
DH_VERBOSE = 1
export DH_OPTIONS=-v
# Set flags for how the package will be compiled and built. Note separated with
# white space and not comma, as per DPM § 4.9.1...
# Set various group related security hardening build flags for format,
# fortify, stackprotector, relro, bindnow, and pie...
DH_BUILD_MAINT_OPTIONS = hardening=+all
# Skip unit testing...
#DH_BUILD_MAINT_OPTIONS += nocheck
# The above should be reflected when dpkg-buildflags is called and merged
# with the defaults...
export DH_BUILD_MAINT_OPTIONS
# Should be avoided since debhelper 9
# https://www.debian.org/doc/manuals/debmake-doc/ch05.en.html#variablesrules
# Including only the necessary variables
include /usr/share/dpkg/pkg-info.mk
# Directory containing package since may not be called from current working
# directory. MAKEFILE_LIST pre-defined by Make and appended each time another
# makefile is included, so first one should be debian/rules...
PACKAGE_DIR = $(abspath $(dir $(firstword $(MAKEFILE_LIST))))
# Source directory...
SOURCE_DIR = $(abspath $(PACKAGE_DIR)/../)
# Main packaging script based on debhelper 7 syntax. The % is an implicit
# pattern rule that acts as a universal target...
%:
dh $@ --buildsystem=meson
# Configure source...
override_dh_auto_configure:
dh_auto_configure -- \
--default-library=both \
-DPISTACHE_BUILD_EXAMPLES=true \
-DPISTACHE_BUILD_TESTS=true \
-DPISTACHE_ENABLE_NETWORK_TESTS=false \
-DPISTACHE_BUILD_DOCS=false \
-DPISTACHE_USE_SSL=true \
# It is pointless to customize the tests until we upgrade to debhelper-compat 13,
# because debhelper 12 runs ninja test instead of meson test, and --wrap=valgrind
# is only supported by the latter.
#override_dh_auto_test:
#ifeq "$(DEB_BUILD_ARCH)" "armhf"
# @echo "# Performing unit tests, but skipping valgrind because it is broken on this platform..."
# dh_auto_test
#else
# @echo "# Performing all unit tests..."
# dh_auto_test -- --wrap=valgrind
#endif
# get-orig-source is deprecated since version 4.1.4 of the Debian Policy
# Prepare an upstream vanilla distribution tarball as per DPM § 4.9...
# http://wiki.debian.org/onlyjob/get-orig-source
get-orig-source: $(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz $(info I: $(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM))
@
# Prepare an upstream vanilla distribution tarball...
# meson dist does not include .github in the source tarball (mesonbuild/meson#8541)
# so it is necessary to manually add the folder to the archive
$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz:
@echo "# Preparing source for $(DEB_SOURCE) v$(DEB_VERSION_UPSTREAM)..."
cd $(SOURCE_DIR) \
&& cd $(PACKAGE_DIR) \
&& meson setup $(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM) .. \
--buildtype=plain \
-DPISTACHE_BUILD_EXAMPLES=true \
-DPISTACHE_BUILD_TESTS=true \
-DPISTACHE_ENABLE_NETWORK_TESTS=false \
-DPISTACHE_BUILD_DOCS=false \
-DPISTACHE_USE_SSL=true \
--prefix=/usr \
--wrap-mode=nodownload \
&& meson dist -C $(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM) --formats=gztar \
&& cd $(PACKAGE_DIR)/$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM) \
&& mkdir $(DEB_SOURCE)-$(DEB_VERSION_UPSTREAM) \
&& cp -r $(SOURCE_DIR)/.github $(DEB_SOURCE)-$(DEB_VERSION_UPSTREAM) \
&& gunzip $(PACKAGE_DIR)/$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)/meson-dist/$(DEB_SOURCE)-$(DEB_VERSION_UPSTREAM).tar.gz \
&& tar --append --file=$(PACKAGE_DIR)/$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)/meson-dist/$(DEB_SOURCE)-$(DEB_VERSION_UPSTREAM).tar $(DEB_SOURCE)-$(DEB_VERSION_UPSTREAM)/.github \
&& gzip $(PACKAGE_DIR)/$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)/meson-dist/$(DEB_SOURCE)-$(DEB_VERSION_UPSTREAM).tar \
&& mv $(PACKAGE_DIR)/$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)/meson-dist/$(DEB_SOURCE)-$(DEB_VERSION_UPSTREAM).tar.gz $(SOURCE_DIR)/../$@
@echo "# Cleaning up..."
$(RM) -r $(PACKAGE_DIR)/$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
# Targets which aren't actual products...
.PHONY: get-orig-source override_dh_auto_configure# override_dh_auto_test
# SPDX-FileCopyrightText: 2019 Kip Warner
#
# SPDX-License-Identifier: Apache-2.0
Tests: test-compilation-and-link.sh
Depends: libpistache-dev, build-essential
#!/bin/sh
# SPDX-FileCopyrightText: 2019 Kip Warner
#
# SPDX-License-Identifier: Apache-2.0
# Bail on any errors...
set -e
# Create a working directory...
BUILD_DIR=$(mktemp -d)
# On exit or any other abnormality cleanup our build artifacts...
trap "rm -rf $BUILD_DIR" 0 INT QUIT ABRT PIPE TERM
# Enter our build directory...
cd $BUILD_DIR
cat <<EOF > pistache_test.cpp
#include <pistache/endpoint.h>
int main()
{
Pistache::Http::Endpoint endpoint(Pistache::Address("*:9080"));
return 0;
}
EOF
g++ -o pistache_test pistache_test.cpp -std=c++17 -Wall -Werror `pkg-config --cflags --libs libpistache`
echo "build: OK"
[ -x pistache_test ]
./pistache_test
echo "run: OK"
version=4
opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/pistache-$1\.tar\.gz/ \
https://github.com/pistacheio/pistache/tags .*/v?(\d\S*)\.tar\.gz
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment