From 6df2c34974aa89ee87e94d27d14e0e941e538829 Mon Sep 17 00:00:00 2001 From: Federico Ceratto Date: Fri, 13 Nov 2020 08:59:30 +0000 Subject: [PATCH] Initial packaging (#117) * Add initial packaging * Update Vcs URLs * Disable test * Update dh version * Switch to ubuntu-20.04 * Add d/compat * Update install * Find file * Update location * Upload to bintray * Add version * Add dep * Set vars * Drop file * Update Readme.md * Update linux-debian-packages.yml * Update linux-debian-packages.yml Co-authored-by: Simone Basso --- .github/workflows/linux-debian-packages.yml | 33 +++++++++++++++++ Readme.md | 2 ++ debian/TODO | 8 +++++ debian/changelog | 5 +++ debian/compat | 1 + debian/control | 17 +++++++++ debian/copyright | 40 +++++++++++++++++++++ debian/ooniprobe-cli.install | 1 + debian/rules | 13 +++++++ debian/source/format | 1 + 10 files changed, 121 insertions(+) create mode 100644 .github/workflows/linux-debian-packages.yml create mode 100644 debian/TODO create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/ooniprobe-cli.install create mode 100755 debian/rules create mode 100644 debian/source/format diff --git a/.github/workflows/linux-debian-packages.yml b/.github/workflows/linux-debian-packages.yml new file mode 100644 index 0000000..0c4e7ed --- /dev/null +++ b/.github/workflows/linux-debian-packages.yml @@ -0,0 +1,33 @@ +# Build a Debian package on every push or pull request +# and publish on a test/internal archive +name: linux-debian-packages +on: [push, pull_request] +jobs: + build: + runs-on: "ubuntu-20.04" + steps: + - uses: actions/setup-go@v1 + with: + go-version: "1.14" + - uses: actions/checkout@v2 + - run: ./build.sh linux + - run: find . -name ooniprobe -type f -executable + - run: sudo apt-get update -q + - run: sudo apt-get build-dep -y --no-install-recommends . + - run: | + VER=$(./CLI/linux/amd64/ooniprobe version) + DVER="${VER}~${GITHUB_RUN_NUMBER}" + dch -v $DVER "test version" + dpkg-buildpackage -us -uc -b + find ../ -name "*.deb" -type f + DEB="../ooniprobe-cli_${DVER}_amd64.deb" + BT_FNAME="ooniprobe-cli_${DVER}_amd64.deb" + curl --upload-file "${DEB}" -u "${BT_APIUSER}:${BT_APIKEY}" \ + "https://api.bintray.com/content/${BT_ORG}/${BT_REPO}/${BT_PKGNAME}/${DVER}/${BT_FNAME};deb_distribution=${DEBDIST};deb_component=main;deb_architecture=amd64;publish=1" + env: + DEBDIST: unstable + BT_APIKEY: ${{ secrets.BT_APIKEY }} + BT_APIUSER: federicoceratto + BT_ORG: ooni + BT_PKGNAME: ooniprobe + BT_REPO: ooniprobe-debian diff --git a/Readme.md b/Readme.md index 15e7219..b13dd9c 100644 --- a/Readme.md +++ b/Readme.md @@ -1,5 +1,7 @@ # OONI Probe CLI +[![linux-debian-packages](https://github.com/ooni/probe-cli/workflows/linux-debian-packages/badge.svg)](https://github.com/ooni/probe-cli/actions?query=workflow%3Alinux-debian-packages) + The next generation OONI Probe Command Line Interface. ## User setup diff --git a/debian/TODO b/debian/TODO new file mode 100644 index 0000000..8e5c405 --- /dev/null +++ b/debian/TODO @@ -0,0 +1,8 @@ + +pull python script +create bintray repo +detect tags + /etc conf file + timer + sandbox + shared unix group diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..c2a961b --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +ooniprobe-cli (0.0.0) UNRELEASED; urgency=medium + + * Test release + + -- Federico Ceratto Thu, 12 Nov 2020 16:26:14 +0000 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b4de394 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +11 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..5ce545d --- /dev/null +++ b/debian/control @@ -0,0 +1,17 @@ +Source: ooniprobe-cli +Maintainer: Federico Ceratto +Section: devel +Priority: optional +Build-Depends: dpkg-dev, debhelper, devscripts +Standards-Version: 4.5.0 +Vcs-Browser: https://github.com/ooni/probe-cli +Vcs-Git: https://github.com/ooni/probe-cli.git +Homepage: https://github.com/ooni/probe-cli +Rules-Requires-Root: no +XS-Go-Import-Path: github.com/ooni/probe-cli + +Package: ooniprobe-cli +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends} +Built-Using: ${misc:Built-Using} +Description: OONI Probe CLI diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..8abef2b --- /dev/null +++ b/debian/copyright @@ -0,0 +1,40 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Source: https://github.com/ooni/probe-cli +Upstream-Name: ooniprobe-cli + +Files: * +Copyright: 2018 Open Observatory of Network Interference (OONI) +License: BSD-3-clause + +Files: debian/* +Copyright: 2020 Federico Ceratto +License: BSD-3-clause +Comment: Debian packaging is licensed under the same terms as upstream + +License: BSD-3-clause + Copyright 2018 Open Observatory of Network Interference (OONI), The Tor Project + . + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + . + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + . + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/debian/ooniprobe-cli.install b/debian/ooniprobe-cli.install new file mode 100644 index 0000000..a4ecd68 --- /dev/null +++ b/debian/ooniprobe-cli.install @@ -0,0 +1 @@ +./CLI/linux/amd64/ooniprobe usr/bin diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..a3ed1b0 --- /dev/null +++ b/debian/rules @@ -0,0 +1,13 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_auto_build: + true + +override_dh_dwz: + true + +override_dh_auto_install: + dh_auto_install -- --no-source diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt)