From cb38dceee309ac0bbb2901ec0bb6a109cf6c33c0 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Thu, 15 Aug 2024 17:14:16 +0100 Subject: [PATCH] Build debian package --- .github/workflows/build.yml | 53 ++++ debian/changelog | 373 ++++++++++++++++++++++++ debian/compat | 1 + debian/control | 20 ++ debian/copyright | 40 +++ debian/docs | 2 + debian/openstreetmap-cgimap-bin.dirs | 1 + debian/openstreetmap-cgimap-bin.install | 0 debian/openstreetmap-cgimap-docs.docs | 2 + debian/outfile | 1 + debian/rules | 13 + debian/source/format | 1 + debian/watch | 8 + 13 files changed, 515 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/docs create mode 100644 debian/openstreetmap-cgimap-bin.dirs create mode 100644 debian/openstreetmap-cgimap-bin.install create mode 100644 debian/openstreetmap-cgimap-docs.docs create mode 100644 debian/outfile create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/watch diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..6bceff094 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,53 @@ +name: Build deb package + +on: [push, pull_request] + +jobs: + build: + name: ${{ matrix.os }} ${{ matrix.version }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + include: + - os: debian + version: bookworm + - os: ubuntu + version: jammy + - os: ubuntu + version: noble + + steps: + - uses: actions/checkout@v4 + + - name: Commit Hash + id: commit + uses: prompt/actions-commit-hash@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - uses: jtdor/build-deb-action@v1 + with: + docker-image: ${{ matrix.os == 'ubuntu' && format('ubuntu:{0}', matrix.version) || format('debian:{0}-slim', matrix.version) }} + buildpackage-opts: --build=binary --no-sign + before-build-hook: debchange --controlmaint --local "+${{ steps.commit.outputs.short }}~${{ matrix.version }}" -b --distribution ${{ matrix.version }} "CI build" + extra-build-deps: devscripts git + + - name: Upload package + uses: actions/upload-artifact@v4 + with: + name: openstreetmap-cgimap_${{ matrix.version }} + path: debian/artifacts/openstreetmap-cgimap-bin-_*.deb + + - name: Upload debugging symbols + uses: actions/upload-artifact@v4 + with: + name: openstreetmap-cgimap-dbgsym_${{ matrix.version }} + path: debian/artifacts/openstreetmap-cgimap-bin-dbgsym_*.deb \ No newline at end of file diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 000000000..4dcebcdba --- /dev/null +++ b/debian/changelog @@ -0,0 +1,373 @@ +openstreetmap-cgimap (0.9.3-1~jammy1) jammy; urgency=medium + + * Add the ability to limit changeset size (#413) + + -- mmd osm Fri, 21 Jun 2024 16:30:00 +0000 + +openstreetmap-cgimap (0.9.2-1~jammy1) jammy; urgency=medium + + * Revert "Skip changeset discussions unless requested" (#402) + + -- mmd osm Thu, 25 Apr 2024 16:10:00 +0000 + +openstreetmap-cgimap (0.9.1-1~jammy1) jammy; urgency=medium + + * Added support for brotli response body compression (#375) + * Drop support for staticxml backend in production code (#376) + * Require YAJL v2 in CMakeLists (#373) + * yajl: output json in larger chunks (#380) + * json writer: fmt for formatting integer values (#390) + * Reuse available string length (#385) + * Skip db query if no changesets were requested (#379) + * libpqxx: cache column names (#383) + * Skip changeset discussions unless requested (#388) + * Small performance improvements (#378) + * Use emplace_back instead of push_back, remove unnecessary temp objects by @Woazboat (#389) + * Move modified libxml++ lib to contrib directory(#367) + * Create separate cmake files for contrib libs by @Woazboat (#369) + * Remove duplicated cmake test definition by @Woazboat (#370) + * Remove unused catch2 automake reporter header file by @Woazboat (#371) + * Integrate clang-tidy in cmake build by @Woazboat (#382) + * A bit of refactoring in XML / JSON writer (#366) + * Change some enums to enum class (#372) + * Minor router cleanups (#377) + * Some cleanups from @Woazboat psql-array-iterator branch (#384) + * Use raw string literal for bearer token regex by @Woazboat (#387) + * Use std::forward for forwarding references instead of std::move by @Woazboat (#386) + * pqxx::field wrapper for psql_array_to_vector (#391) + + -- mmd osm Sun, 14 Apr 2024 17:19:00 +0000 + +openstreetmap-cgimap (0.9.0-1~jammy1) jammy; urgency=medium + + * Replace autotools by cmake by @Woazboat in #317 and @mmd-osm in #358 + * Fix json output incorrectly truncating coordinates by @Woazboat in #364 + * Fix test_parse_id_list unit test failure on ARM64 in #347 + * Adjustments for changes in underlying libpqxx 7.x.x library version in #301 + * Fix program option --instances in #339 + * Daemon mode improvements (multiple PRs) + * Check node lat lon not NaN or infinite by @Woazboat in (7d058d5) + * Use std::string / std::string_view for psql_array_to_vector by @Woazboat in #344 + * Reduce temporary allocations for xml serialization by @Woazboat in #342 + * Migrate unit tests to Catch2 framework, increased unit test coverage (multiple PRs) + * Code cleanups (multiple PRs) + + -- mmd osm Mon, 11 Mar 2024 19:47:12 +0000 + +openstreetmap-cgimap (0.8.10-1~jammy1) jammy; urgency=medium + + * Added changeset upload rate limiting (#296) (#297) + * process_post_put_request: small cleanups (#298) + + -- mmd osm Sun, 5 Nov 2023 10:36:00 +0000 + +openstreetmap-cgimap (0.8.9-1~jammy1) jammy; urgency=medium + + * Add moderators specific rate limiting settings (#294) + * Add Retry-After http header in 509 response (#295) + * Add ids to changeset comments output (#289) + * Fix vector reserve in pqsql select for historic n/w/r (#282) + * Replace deprecated std::iterator with direct member type declarations (#279) + * Check user state, only allow db changes for confirmed and active users (#284) + * Fix commented out Dockerfile config in lighttpd.conf (#287) + * Add more test files to gitignore (#288) + + -- mmd osm Sun, 29 Oct 2023 19:30:00 +0000 + +openstreetmap-cgimap (0.8.8-1~jammy1) jammy; urgency=medium + + * Undo "Replace custom array parser by pqxx::array_parser" (#277) + + -- mmd osm Wed, 27 Jul 2022 18:19:04 +0000 + +openstreetmap-cgimap (0.8.7-1~jammy1) jammy; urgency=medium + + * Released version 0.8.7 + * Switch to Ubuntu 20.04 + * Refactoring + + -- mmd osm Sat, 16 Jul 2022 11:38:00 +0000 + +openstreetmap-cgimap (0.8.6-1~focal1) focal; urgency=medium + + * Released version 0.8.6 + * Add support for Argon2 password hashing (#251) + * Simplify xml parser context handling (#249) + + -- mmd osm Sun, 14 Nov 2021 19:42:01 +0000 + +openstreetmap-cgimap (0.8.5-1~focal1) focal; urgency=medium + + * Released version 0.8.5 + * OAuth2: plain token support (#248) + + -- mmd osm Fri, 25 Jun 2021 18:30:57 +0000 + +openstreetmap-cgimap (0.8.4-1~focal1) focal; urgency=medium + + * Released version 0.8.4 + * Adding OAuth2 support (#246) + + -- mmd osm Wed, 23 Jun 2021 20:13:04 +0000 + +openstreetmap-cgimap (0.8.3-1~focal1) focal; urgency=medium + + * Released version 0.8.3 + * Updated Dockerfile and lighttpd.conf (#213) + * Make compile time constants configurable via program options (#232) + * Program options can be set via new command line parameter --configfile (#232) + * Provide option to enforce limits for tags and relation members (#174) + * Use pg_virtualenv for unit tests + * Ubuntu 20.04 (Focal) adjustments for libpqxx deprecation warnings (#229) + * Fix closed_at timestamp when changeset is open >23h (#236) + + -- mmd osm Mon, 13 Jul 2020 19:36:57 +0000 + +openstreetmap-cgimap (0.8.2-1~bionic1) bionic; urgency=medium + + * Released version 0.8.2 + * Fix relations referencing deleted elements (#226) + * Fix: revert deleted master/child relations (#225) + + -- mmd osm Wed, 22 Apr 2020 19:51:11 +0000 + +openstreetmap-cgimap (0.8.1-1~bionic1) bionic; urgency=medium + + * Released version 0.8.1 + * Use MIME type application/xml for better Rails compatibility (#221) + + -- mmd osm Mon, 02 Mar 2020 17:12:55 +0000 + +openstreetmap-cgimap (0.8.0-1~bionic1) bionic; urgency=medium + + * Released version 0.8.0 + * Re-enable JSON output + * Added new API endpoints for Changeset create/update/close (#206) + * New handler for /*/relations and node/*/ways (#166) + * Fix compilation issues for libpqxx 6.x (#200) + * Use boost::spirit::standard instead of boost::spirit::ascii to + avoid assertions failures in param list parsing + * Prepend HTTP 412 error text w/ Precondition failed: for Rails port compatibility (#211) + * JSON format fixes (#218, #219) + * Vagrant: dist update fix (#216), use Bionic (#217) + * Improved XML parsing, using parts of libxml++ (#209) + * Replace boost regex by c++11 std (#205) + * Refactoring transaction handling (#204) + * Simplify changeset cache sql (#202) + * Application router HTTP method handling + * Remove write api backend (#198) + * Remove pgsnapshot backend and all related special case logic (#196) + + -- mmd osm Sat, 15 Feb 2020 12:10:22 +0000 + +openstreetmap-cgimap (0.7.5-1~bionic1) bionic; urgency=medium + + * Released version 0.7.5 + * Fix 412 Precondition Failed when trying to upload old version of a way/relation (#195) + + -- mmd osm Sat, 01 Jun 2019 18:32:42 +0000 + +openstreetmap-cgimap (0.7.4-1~bionic1) bionic; urgency=medium + + * Released version 0.7.4 + * Fix Basic Auth realm to be in sync with Rails (#192) + * Remove OAuth WWW-Authenticate header for better rails compatibility (#193) + + -- mmd osm Fri, 31 May 2019 06:43:02 +0000 + +openstreetmap-cgimap (0.7.3-1~bionic1) bionic; urgency=medium + + * Released version 0.7.3 + * Basic auth should also consider user email and lower case variants (#190) + * Reorder WWW-Authenticate headers to work around non-compliant clients (#191) + + -- mmd osm Thu, 30 May 2019 20:14:57 +0000 + +openstreetmap-cgimap (0.7.2-1~bionic1) bionic; urgency=medium + + * Released version 0.7.2 + * Fix history api returns wrong/duplicate tag data for ways (#183) + * Sort History api call result by object and version (#184) + * Introduce --disable-api-write command line param to disable API writes (#185) + * Added exception logging in osm_responder subclasses (#187) + + -- mmd osm Mon, 27 May 2019 19:15:12 +0000 + +openstreetmap-cgimap (0.7.1-1~bionic1) bionic; urgency=medium + + * Released version 0.7.1 + * Specify columns explictly when inserting into API tables (#179) + * Use cryptopp path for crypto++ includes (#178) + * Refactoring: improve OSMChange_Tracking diffresult isolation (#177) + + -- mmd osm Sat, 25 May 2019 19:11:57 +0000 + +openstreetmap-cgimap (0.7.0-1~bionic1) bionic; urgency=medium + + * Released version 0.7.0 + + -- mmd osm Sun, 24 Mar 2019 11:24:53 +0000 + +openstreetmap-cgimap (0.7.0-rc1~bionic1) bionic; urgency=medium + + * 0.7.0 RC-1 + * Changeset upload (#140) + * Disabled JSON output due to missing Rails support + + -- mmd osm Fri, 18 Jan 2019 19:30:12 +0000 + +openstreetmap-cgimap (0.6.2-1~bionic1) bionic; urgency=medium + + * Released version 0.6.2 + * JSON output (#153, #155) + * Include num_changes in changeset xml & json response (#156) + + -- mmd osm Sat, 08 Sep 2018 15:48:55 +0000 + +openstreetmap-cgimap (0.6.1-1~bionic1) bionic; urgency=medium + + * Released version 0.6.1 + * Performance: Prefetch cache details (#142) + * Error handling OAuth parsing failure (#147) + + -- mmd osm Fri, 20 Jul 2018 20:37:12 +0000 + +openstreetmap-cgimap (0.6.0-1~bionic1) bionic; urgency=medium + + * Released version 0.6.0 + + -- Matt Amos Thu, 28 Jun 2018 11:07:38 +0100 + +openstreetmap-cgimap (0.6.0-1~xenial1) xenial; urgency=medium + + * Released version 0.6.0 + + -- Matt Amos Mon, 10 Apr 2017 13:19:38 +0100 + +openstreetmap-cgimap (0.5.8-0ubuntu0ppa0~xenial1) xenial; urgency=medium + + * Attempting to coax a package out of Launchpad. + + -- Matt Amos Thu, 03 Nov 2016 12:30:38 +0000 + +openstreetmap-cgimap (0.5.8-0ubuntu0ppa0~xenial0) xenial; urgency=medium + + * Reject OAuth nonces more than 24h old, allowing them to be expired. + + -- Matt Amos Thu, 03 Nov 2016 12:22:14 +0000 + +openstreetmap-cgimap (0.5.7-0ubuntu0ppa0~xenial0) xenial; urgency=medium + + * Add more information for OAuth unauthorized rejections. + * Fix status message when code is 401. + + -- Matt Amos Mon, 24 Oct 2016 11:44:01 +0100 + +openstreetmap-cgimap (0.5.6-0ubuntu2ppa1~xenial1) xenial; urgency=medium + + * Fix but where changeset comments count was always zero. + + -- Matt Amos Thu, 20 Oct 2016 17:32:39 +0100 + +openstreetmap-cgimap (0.5.5-0ubuntu2ppa1~xenial1) xenial; urgency=medium + + * Implement missing apidb OAuth methods. + * Fix return type of `oauth_status_code` functor. + * Add end-to-end OAuth test. + + -- Matt Amos Sat, 8 Oct 2016 17:19:53 +0100 + +openstreetmap-cgimap (0.5.4-0ubuntu2ppa1~xenial1) xenial; urgency=medium + + * Fix bug with OAuth return checking logic. + * Fix bug with OAuth path normalisation. + + -- Matt Amos Thu, 6 Oct 2016 14:04:40 +0100 + +openstreetmap-cgimap (0.5.3-0ubuntu2ppa1~xenial1) xenial; urgency=medium + + * Fix bug with rate limiting. + + -- Matt Amos Tue, 4 Oct 2016 12:19:06 +0100 + +openstreetmap-cgimap (0.5.2-0ubuntu2ppa1~xenial1) xenial; urgency=medium + + * Fix bug with OAuth database connection parameters. + * Fix environment variable parsing. + + -- Matt Amos Mon, 3 Oct 2016 23:55:03 +0100 + +openstreetmap-cgimap (0.5.1-0ubuntu2ppa1~xenial1) xenial; urgency=medium + + * Fix integer types so that 32-bit builds work. + + -- Matt Amos Mon, 3 Oct 2016 14:13:36 +0100 + +openstreetmap-cgimap (0.5.0-0ubuntu2ppa1~xenial6) xenial; urgency=medium + + * Fix date formatting of changelog lines. + + -- Matt Amos Mon, 3 Oct 2016 13:30:41 +0100 + +openstreetmap-cgimap (0.5.0-0ubuntu2ppa1~xenial5) xenial; urgency=medium + + * Bump version to get launchpad to build it. + + -- Matt Amos Mon, 3 Oct 2016 11:30:02 +0100 + +openstreetmap-cgimap (0.5.0-0ubuntu2ppa1~xenial4) xenial; urgency=medium + + * Bump version to get launchpad to build it. + + -- Matt Amos Mon, 3 Oct 2016 10:56:02 +0100 + +openstreetmap-cgimap (0.5.0-0ubuntu2ppa1~xenial3) xenial; urgency=medium + + * Bump version to get launchpad to build it. + + -- Matt Amos Mon, 3 Oct 2016 10:37:45 +0100 + +openstreetmap-cgimap (0.5.0-0ubuntu2ppa1~xenial2) xenial; urgency=medium + + * Bump version to get launchpad to build it. + + -- Matt Amos Sun, 25 Sep 2016 11:43:44 +0100 + +openstreetmap-cgimap (0.5.0-0ubuntu2ppa1~xenial1) xenial; urgency=medium + + * Add support for changeset metadata and discussions. + + -- Matt Amos Mon, 19 Sep 2016 21:07:06 +0100 + +openstreetmap-cgimap (0.4.3-0ubuntu2ppa1~xenial2) xenial; urgency=medium + + * Add postinst call to ldconfig. + + -- Matt Amos Mon, 13 Jun 2016 13:13:06 +0100 + +openstreetmap-cgimap (0.4.3-0ubuntu2ppa1~xenial1) xenial; urgency=medium + + * Update changelog. Add signature location for upstream verification. + + -- Matt Amos Mon, 13 Jun 2016 11:51:19 +0100 + +openstreetmap-cgimap (0.4.3-0ubuntu2~4.gbp0bf067) wily; urgency=medium + + ** SNAPSHOT build @0bf0674b2ed4060d0c80cc14648a390a07c96f88 ** + + * UNRELEASED + * Fixing Lintian errors. + * Proper email address. + * Add version to watch file. + * Where should the so.0.0.0 and the symlink go? + * Update changelog with DCH. + * Shuffling package contents around at random attempting to satisfy Lintian. + * Update changelog again. + + -- Matt Amos Mon, 16 May 2016 19:04:15 +0100 + +openstreetmap-cgimap (0.4.2-0ubuntu1) wily; urgency=medium + + * Initial release. + + -- Matt Amos Sat, 07 May 2016 00:01:07 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 000000000..f599e28b8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +10 diff --git a/debian/control b/debian/control new file mode 100644 index 000000000..d12744b1a --- /dev/null +++ b/debian/control @@ -0,0 +1,20 @@ +Source: openstreetmap-cgimap +Section: libs +Priority: optional +Maintainer: Matt Amos +Build-Depends: debhelper (>=10), pkg-config, zlib1g-dev, libbrotli-dev, libxml2-dev, libpqxx-dev, libfcgi-dev, libboost-program-options-dev, libfmt-dev, libmemcached-dev, libcrypto++-dev, libargon2-dev, libyajl-dev, postgresql-all, postgresql-common (>= 148~), postgresql-server-dev-all, cmake +Homepage: https://github.com/zerebubuth/openstreetmap-cgimap +Standards-Version: 3.9.7 + +Package: openstreetmap-cgimap-bin +Section: contrib/net +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: CGImap is a C++ implementation of the OpenStreetMap API map call + CGImap is a C++ implementation of some parts of the OpenStreetMap API as an + FCGI process. The rails implementation of the "map" call had a few problems + with memory - it uses a lot of it and there is a leak which makes it annoying + to use in long-running environments, like the main OSM server. + . + CGImap attempts to address these memory problems and makes it easier to + optimise the queries, something which is also a bit of a pain to do in Rails. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 000000000..ca1097d8a --- /dev/null +++ b/debian/copyright @@ -0,0 +1,40 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: openstreetmap-cgimap +Source: https://github.com/zerebubuth/openstreetmap-cgimap + +Files: * +Copyright: 2016 Matt Amos +License: GPL-2 + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + +Files: debian/* +Copyright: 2016 Matt Amos +License: GPL-2+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/debian/docs b/debian/docs new file mode 100644 index 000000000..5a0147019 --- /dev/null +++ b/debian/docs @@ -0,0 +1,2 @@ +README +README.md diff --git a/debian/openstreetmap-cgimap-bin.dirs b/debian/openstreetmap-cgimap-bin.dirs new file mode 100644 index 000000000..e77248175 --- /dev/null +++ b/debian/openstreetmap-cgimap-bin.dirs @@ -0,0 +1 @@ +usr/bin diff --git a/debian/openstreetmap-cgimap-bin.install b/debian/openstreetmap-cgimap-bin.install new file mode 100644 index 000000000..e69de29bb diff --git a/debian/openstreetmap-cgimap-docs.docs b/debian/openstreetmap-cgimap-docs.docs new file mode 100644 index 000000000..efea0a6a2 --- /dev/null +++ b/debian/openstreetmap-cgimap-docs.docs @@ -0,0 +1,2 @@ +README.Debian +README.source diff --git a/debian/outfile b/debian/outfile new file mode 100644 index 000000000..163aaf8d8 --- /dev/null +++ b/debian/outfile @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/rules b/debian/rules new file mode 100755 index 000000000..4a8af6142 --- /dev/null +++ b/debian/rules @@ -0,0 +1,13 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + +%: + dh $@ --parallel --builddirectory=build --buildsystem=cmake + +override_dh_auto_test: + dh_auto_test --no-parallel + +override_dh_auto_configure: + dh_auto_configure -- -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) -DBUILD_TESTING=ON -DBUILD_SHARED_LIBS=OFF diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 000000000..163aaf8d8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/watch b/debian/watch new file mode 100644 index 000000000..21f23ddb9 --- /dev/null +++ b/debian/watch @@ -0,0 +1,8 @@ +version=3 +opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/openstreetmap-cgimap-$1\.tar\.gz/ \ + https://github.com/zerebubuth/openstreetmap-cgimap/tags .*/v?(\d\S*)\.tar\.gz +pgpsigurlmangle=s/github.com/raw.githubusercontent.com/;\ +s/archive\/master/signatures/;\ +s/([^\/]+)\.tar\.gz/openstreetmap-cgimap-$1\.tar\.gz/;\ +s/$/.asc/ \ + https://github.com/zerebubuth/openstreetmap-cgimap/tags .+master/(\d[\d\.]*)\.tar\.gz