├── LICENSE └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Andrea Bernardo Ciddio 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # A debian package for Consul 2 | [![Build Status](https://semaphoreci.com/api/v1/bcandrea/consul-deb/branches/debian/badge.svg)](https://semaphoreci.com/bcandrea/consul-deb) 3 | 4 | ## Overview 5 | 6 | This project can be used to create a debian package for the 7 | [Consul](http://www.consul.io) git repository on github 8 | (https://github.com/hashicorp/consul). The package is produced following the 9 | standard layout of [`git-buildpackage` 10 | projects](http://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.html), 11 | except for the name of the debian branch (which in this case is `debian` instead 12 | of `master`), and uses [Docker](https://www.docker.com) to ensure isolated, 13 | repeatable builds. 14 | 15 | To build the package, checkout the `debian` branch and run `make`: 16 | 17 | $ git checkout debian 18 | $ make -C debian/build 19 | 20 | The command only depends on the presence of git and Docker; it creates a new 21 | image locally and executes `gbp buildpackage` in it. Results will be saved to 22 | `/tmp/consul-deb`. 23 | 24 | $ ls /tmp/consul-deb 25 | consul_0.6.4-1~trusty1~ppa1.debian.tar.gz consul_0.6.4-1~trusty1~ppa1.dsc 26 | consul_0.6.4-1~trusty1~ppa1_source.build consul_0.6.4-1~trusty1~ppa1_source.changes 27 | consul_0.6.4.orig.tar.gz 28 | 29 | This repository is tagged with upstream versions (e.g., `v0.6.4`), which point 30 | to the commits from the `upstream` branch, and Debian package versions (e.g. 31 | `v0.6.4-1_trusty1_ppa1`). Since the tilde (`~`) character is not legal in git 32 | tags, Debian revision tags use underscore instead (the tag in the example points 33 | to version `0.6.4-1~trusty1~ppa1`). You can build a specific version of the 34 | package by checking out the relevant tag: 35 | 36 | $ # ==> build version 0.6.4-1~trusty1~ppa1 37 | $ git checkout v0.6.4-1_trusty1_ppa1 38 | $ make -C debian/build 39 | 40 | Ubuntu packages built regularly with this Makefile are available at 41 | [this Launchpad PPA](https://launchpad.net/~bcandrea/+archive/ubuntu/consul) for 42 | releases up to 16.04 (Wily Werewolf), and at [this other PPA](https://launchpad.net/~bcandrea/+archive/ubuntu/consul-new) for Yakkety and 43 | newer. To install the latest Consul packages on your Ubuntu system you just need 44 | to add one of the repositories and update the local sources: 45 | 46 | $ # For Trusty, Wily, Xenial 47 | $ sudo apt-add-repository ppa:bcandrea/consul 48 | $ sudo apt-get update 49 | $ sudo apt-get install consul consul-web-ui 50 | 51 | $ # For Yakkety and newer 52 | $ sudo apt-add-repository ppa:bcandrea/consul-new 53 | $ sudo apt-get update 54 | $ sudo apt-get install consul consul-web-ui 55 | 56 | ## Usage 57 | 58 | The available targets in the makefile are: 59 | 60 | * `buildpackage`: The default target. Builds binary and source packages. 61 | * `buildsource`: Builds a source debian package that can be used for uploads to 62 | Launchpad. 63 | * `upload`: Uploads the source package to Launchpad. Requires setting the `PPA` 64 | variable on the command line (e.g. `make -C debian/build upload PPA=myuser/myppa`). 65 | * `clean`: Removes intermediate Docker images and the `/tmp/consul-deb` directory. 66 | 67 | ## Prerequisites 68 | 69 | The build machine just needs a working Docker installation (and, of course, git) 70 | to be able to run the makefile (e.g. it can be a Mac). When building a source 71 | package to upload to a PPA you will also need a GPG key. 72 | 73 | ### Setting up GPG 74 | 75 | First make sure GPG is installed and working: 76 | 77 | $ gpg --list-sec 78 | 79 | The output should contain a list of valid GPG signing keys. For the makefile to 80 | work, a file named `~/.devscripts` must be created with at least the following 81 | variable: 82 | 83 | DEBSIGN_KEYID= 84 | 85 | (you can specify other values, e.g. `DEBFULLNAME` and `DEBEMAIL`). 86 | --------------------------------------------------------------------------------