From 55515f2fc63437af67a7055f949000a9f8c7edb3 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Thu, 9 Jul 2020 16:17:30 -0700 Subject: [PATCH 1/2] Add Debian packaging It may make sense to move kiwix-compile-resources.1 into the main source and have meson manage it in the future. --- debian/changelog | 5 ++++ debian/control | 45 ++++++++++++++++++++++++++++++++ debian/copyright | 1 + debian/kiwix-compile-resources.1 | 20 ++++++++++++++ debian/libkiwix-dev.install | 4 +++ debian/libkiwix-dev.manpages | 1 + debian/libkiwix9.install | 1 + debian/rules | 5 ++++ debian/source/format | 1 + 9 files changed, 83 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/kiwix-compile-resources.1 create mode 100644 debian/libkiwix-dev.install create mode 100644 debian/libkiwix-dev.manpages create mode 100644 debian/libkiwix9.install create mode 100755 debian/rules create mode 100644 debian/source/format diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 000000000..599d0a997 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +libkiwix (0.0.0) unstable; urgency=medium + + * Initial release + + -- Kunal Mehta Wed, 08 Jul 2020 18:12:32 -0700 diff --git a/debian/control b/debian/control new file mode 100644 index 000000000..79a8dc123 --- /dev/null +++ b/debian/control @@ -0,0 +1,45 @@ +Source: libkiwix +Priority: optional +Maintainer: Kiwix team +Build-Depends: debhelper-compat (= 12), + meson, + pkg-config, + libzim-dev (>= 6.0.0), + libcurl4-gnutls-dev, + libicu-dev, + libgtest-dev, + libkainjow-mustache-dev, + liblzma-dev, + libmicrohttpd-dev, + libpugixml-dev, + zlib1g-dev +Standards-Version: 4.5.0 +Section: libs +Homepage: https://github.com/kiwix/kiwix-lib +Rules-Requires-Root: no + +Package: libkiwix-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: libkiwix9 (= ${binary:Version}), ${misc:Depends}, python3, aria2, + libzim-dev (>= 6.0.0), + libicu-dev, + libpugixml-dev, + libcurl4-gnutls-dev +Description: library of common code for Kiwix (development) + Kiwix is an offline Wikipedia reader. libkiwix provides the + software core for Kiwix, and contains the code shared by all + Kiwix ports (Windows, Linux, OSX, Android, etc.). + . + This package contains development files. + +Package: libkiwix9 +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, ${misc:Depends} +Conflicts: libkiwix0, libkiwix3 +Description: library of common code for Kiwix + Kiwix is an offline Wikipedia reader. libkiwix provides the + software core for Kiwix, and contains the code shared by all + Kiwix ports (Windows, Linux, OSX, Android, etc.). diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 000000000..ff4636642 --- /dev/null +++ b/debian/copyright @@ -0,0 +1 @@ +See COPYING in the repository root. diff --git a/debian/kiwix-compile-resources.1 b/debian/kiwix-compile-resources.1 new file mode 100644 index 000000000..1b6dec9b8 --- /dev/null +++ b/debian/kiwix-compile-resources.1 @@ -0,0 +1,20 @@ +.TH KIWIX-COMPILE-RESOURCES "1" "August 2017" "Kiwix" "User Commands" +.SH NAME +kiwix-compile-resources \- helper to compile and generate some Kiwix resources +.SH SYNOPSIS +\fBkiwix\-compile\-resources\fR [\-h] [\-\-cxxfile CXXFILE] [\-\-hfile HFILE] resource_file\fR +.SH DESCRIPTION +.TP +resource_file +The list of resources to compile. +.TP +\fB\-h\fR, \fB\-\-help\fR +show a help message and exit +.TP +\fB\-\-cxxfile\fR CXXFILE +The Cpp file name to generate +.TP +\fB\-\-hfile\fR HFILE +The h file name to generate +.SH AUTHOR +Matthieu Gautier diff --git a/debian/libkiwix-dev.install b/debian/libkiwix-dev.install new file mode 100644 index 000000000..47cf7e423 --- /dev/null +++ b/debian/libkiwix-dev.install @@ -0,0 +1,4 @@ +usr/include +usr/lib/*/libkiwix.so +usr/lib/*/pkgconfig +usr/bin diff --git a/debian/libkiwix-dev.manpages b/debian/libkiwix-dev.manpages new file mode 100644 index 000000000..02826e612 --- /dev/null +++ b/debian/libkiwix-dev.manpages @@ -0,0 +1 @@ +debian/kiwix-compile-resources.1 diff --git a/debian/libkiwix9.install b/debian/libkiwix9.install new file mode 100644 index 000000000..af651ca92 --- /dev/null +++ b/debian/libkiwix9.install @@ -0,0 +1 @@ +usr/lib/*/libkiwix.so.* diff --git a/debian/rules b/debian/rules new file mode 100755 index 000000000..74cc648ba --- /dev/null +++ b/debian/rules @@ -0,0 +1,5 @@ +#!/usr/bin/make -f +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +%: + dh $@ --buildsystem=meson diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 000000000..89ae9db8f --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) From 6b783b39981636fee8c76f0009cf5c1a9c7de5fe Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Thu, 9 Jul 2020 19:10:51 -0700 Subject: [PATCH 2/2] Automatically build and publish packages via Github Actions We can currently only build for Ubuntu versions because we're not yet publishing libzim for Debian. Development builds (on commits to master) will build against master libzim while release builds (on tag pushes) will build against the most recent release of libzim. --- .github/workflows/package.yml | 78 +++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/package.yml diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 000000000..ae485f95d --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,78 @@ +name: Packages +on: [push, pull_request] + +jobs: + build-deb: + runs-on: ubuntu-latest + strategy: + matrix: + distro: [ubuntu-groovy, ubuntu-focal, ubuntu-eoan] + steps: + - uses: actions/checkout@v2 + + # Determine which PPA we should upload to + - name: PPA + id: ppa + run: | + if [[ $REF == refs/tags* ]] + then + echo "::set-output name=ppa::kiwixteam/release" + else + echo "::set-output name=ppa::kiwixteam/dev" + fi + env: + REF: ${{ github.ref }} + + - uses: legoktm/gh-action-auto-dch@master + with: + fullname: Kiwix builder + email: release+launchpad@kiwix.org + distro: ${{ matrix.distro }} + + - uses: legoktm/gh-action-build-deb@ubuntu-groovy + if: matrix.distro == 'ubuntu-groovy' + name: Build package for ubuntu-groovy + id: build-ubuntu-groovy + with: + args: --no-sign + ppa: ${{ steps.ppa.outputs.ppa }} + + - uses: legoktm/gh-action-build-deb@ubuntu-focal + if: matrix.distro == 'ubuntu-focal' + name: Build package for ubuntu-focal + id: build-ubuntu-focal + with: + args: --no-sign + ppa: ${{ steps.ppa.outputs.ppa }} + + - uses: legoktm/gh-action-build-deb@ubuntu-eoan + if: matrix.distro == 'ubuntu-eoan' + name: Build package for ubuntu-eoan + id: build-ubuntu-eoan + with: + args: --no-sign + ppa: ${{ steps.ppa.outputs.ppa }} + + - uses: actions/upload-artifact@v2 + with: + name: Packages for ${{ matrix.distro }} + path: output + + - uses: legoktm/gh-action-dput@master + name: Upload dev package + # Only upload on pushes to master + if: github.event_name == 'push' && github.event.ref == 'refs/heads/master' && startswith(matrix.distro, 'ubuntu-') + with: + gpg_key: ${{ secrets.LAUNCHPAD_GPG }} + repository: ppa:kiwixteam/dev + packages: output/*_source.changes + + - uses: legoktm/gh-action-dput@master + name: Upload release package + # Only upload on pushes to master or tag + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && startswith(matrix.distro, 'ubuntu-') + with: + gpg_key: ${{ secrets.LAUNCHPAD_GPG }} + repository: ppa:kiwixteam/release + packages: output/*_source.changes +