All Projects → mh-cbon → go-bin-deb

mh-cbon / go-bin-deb

Licence: MIT license
Create binary package for debian system

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to go-bin-deb

fpm-fry
deep-fried package builder
Stars: ✭ 18 (-52.63%)
Mutual labels:  debian-packages, package-creation
debianized-jupyterhub
📦 ♃ Debian packaging of JupyterHub, a multi-user server for Jupyter notebooks
Stars: ✭ 28 (-26.32%)
Mutual labels:  debian-packages
debianopt-repo
Additional debian repository for awesome open-source projects.
Stars: ✭ 47 (+23.68%)
Mutual labels:  debian-packages
Dh Virtualenv
Python virtualenvs in Debian packages
Stars: ✭ 1,504 (+3857.89%)
Mutual labels:  debian-packages
Faster OpenCV 4 Raspberry Pi
A pre-compiled version of OpenCV 4 for Raspberry Pi optimized for deep learning / computer vision..
Stars: ✭ 46 (+21.05%)
Mutual labels:  debian-packages
intellij-idea-ultimate
Unofficial .deb packages of IntelliJ IDEA Ultimate Edition. This is a mirror of https://gitlab.com/mmk2410/intellij-idea-ultimate
Stars: ✭ 16 (-57.89%)
Mutual labels:  debian-packages
autohosts
Automate hosts file updates on Linux and MacOS. Block Firefox telemetry, Google snooping and web trackers at the root.
Stars: ✭ 69 (+81.58%)
Mutual labels:  debian-packages
maldetect
Debian packaging of Linux Malware Detect (https://github.com/rfxn/linux-malware-detect)
Stars: ✭ 48 (+26.32%)
Mutual labels:  debian-packages
php-deb-packager
A PHP library to generate `.deb` packages (Software distribution)
Stars: ✭ 54 (+42.11%)
Mutual labels:  debian-packages
Ubuntu-Launchpad
The Ubuntu version of Apple's/MacOS Launchpad application
Stars: ✭ 21 (-44.74%)
Mutual labels:  debian-packages
TeamSpeak3-Client
TeamSpeak3 Client package for Debian/Ubuntu
Stars: ✭ 14 (-63.16%)
Mutual labels:  debian-packages
bcg729-deb
(obsolete) Debian/Ubuntu package for the Bcg729 G.729 codec library
Stars: ✭ 14 (-63.16%)
Mutual labels:  debian-packages
wakemeops
A Debian repository for portable applications
Stars: ✭ 54 (+42.11%)
Mutual labels:  debian-packages
debian-packaging
Create Debian packages of non-free, closed-source and other software.
Stars: ✭ 19 (-50%)
Mutual labels:  debian-packages
docker-debian-repository
A local repository for publishing deb files for use with apt.
Stars: ✭ 49 (+28.95%)
Mutual labels:  debian-packages
intellij-idea-community
Unofficial .deb packages of IntelliJ IDEA Community Edition. This is a mirror of
Stars: ✭ 32 (-15.79%)
Mutual labels:  debian-packages
ec2-metadata-filter
Enhance the security of the EC2 metadata service. (Obsolete thanks to Instance Metadata Service Version 2, see note in README)
Stars: ✭ 32 (-15.79%)
Mutual labels:  debian-packages
raspberrypi-rstudio
RStudio for Raspberry Pi - Docker Build and Runtime Environment
Stars: ✭ 57 (+50%)
Mutual labels:  debian-packages
Devtools
Tools to make an R developer's life easier
Stars: ✭ 2,141 (+5534.21%)
Mutual labels:  package-creation
init-typescript-app
Initialize clean TypeScript setup by running single command. Optional package publication to npm.
Stars: ✭ 20 (-47.37%)
Mutual labels:  package-creation

go-bin-deb

travis Status Go Report Card GoDoc MIT License

Package go-bin-deb creates binary package for debian system

Using a json files to declare rules, it then performs necessary operations to invoke dpkg-deb to build a package, then check it with the help of lintian.

This tool is part of the go-github-release workflow

See the demo.

TOC

Install

Check the release page!

Glide

mkdir -p $GOPATH/src/github.com/mh-cbon/go-bin-deb
cd $GOPATH/src/github.com/mh-cbon/go-bin-deb
git clone https://github.com/mh-cbon/go-bin-deb.git .
glide install
go install

linux rpm/deb repository

wget -O - https://raw.githubusercontent.com/mh-cbon/latest/master/bintray.sh \
| GH=mh-cbon/go-bin-deb sh -xe
# or
curl -L https://raw.githubusercontent.com/mh-cbon/latest/master/bintray.sh \
| GH=mh-cbon/go-bin-deb sh -xe

linux rpm/deb standalone package

curl -L https://raw.githubusercontent.com/mh-cbon/latest/master/install.sh \
| GH=mh-cbon/go-bin-deb sh -xe
# or
wget -q -O - --no-check-certificate \
https://raw.githubusercontent.com/mh-cbon/latest/master/install.sh \
| GH=mh-cbon/go-bin-deb sh -xe

Requirements

A debian system, vagrant, travis, docker, whatever.

Usage

Workflow overview

To create a binary package you need to

  • build your application binaries
  • invoke go-bin-deb to generate the package
  • create deb repositories on travis hosted on gh-pages using this script

JSON file

For a reference of all fields, see this

For a real world example including service, shortcuts, env, see this

For a casual example to provide a simple binary, see this

JSON tokens

Several tokens are provided to consume into the JSON file.

name description example
!version! The version number provided in the command line, or in the JSON file. 1.0.2
!arch! The architecture short name provided in the command line or in the JSON file. amd64
!name! The name of the project provided in the JSON file. hello

CLI

go-bin-deb -help

NAME:
   go-bin-deb - Generate a binary debian package

USAGE:
   go-bin-deb <cmd> <options>
   
VERSION:
   0.0.0
   
COMMANDS:
     generate  Generate the contents of the package
     test      Test the package json file
     help, h   Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version

generate

go-bin-deb generate -help

NAME:
   go-bin-deb generate - Generate the contents of the package

USAGE:
   go-bin-deb generate [command options] [arguments...]

OPTIONS:
   --wd value, -w value      Working directory to prepare the package (default: "pkg-build")
   --output value, -o value  Output directory for the debian package files
   --file value, -f value    Path to the deb.json file (default: "deb.json")
   --version value           Version of the package
   --arch value, -a value    Arch of the package

test

go-bin-deb test -help

NAME:
   go-bin-deb test - Test the package json file

USAGE:
   go-bin-deb test [command options] [arguments...]

OPTIONS:
   --file value, -f value  Path to the deb.json file (default: "deb.json")

Recipes

Installing generated package

TLDR

# install a package with dependencies
dpkg -i mypackage.deb
apt-get install --fix-missing
# or
gdebi mypackage.deb

On debian system to install a package .deb file, you should use dpkg -i and not apt-get i.

But, dpkg does not install dependencies by itself, thus you will need to execute an extra command apt-get i --fix-missing to locate and install missing dependencies ater you installed your own .deb.

An alternative is to use gdebi, which appears to be bale to all of that in one command.

Finally, if one provides a web interface to host the package, it should be no problem to use a regular apt-get.

PS: To remove the package dpkg -r.

Vagrant recipe

Please check the demo app here

Travis recipe

  • get a github repo
  • create a token in your settings
  • get a travis account
  • connect your github account to travis and register your repo
  • install travis client gem install --user travis
  • run travis encrypt --add -r your/repo GH_TOKEN=xxxx
  • run travis setup releases
  • personalize the .travis.yml
sudo: required

services:
  - docker

language: go
go:
  - tip

env:
  global:
    - MYAPP=dummy
    - [email protected]
    - secure: GH_TOKEN xxxx

before_install:
  - sudo apt-get -qq update
  - mkdir -p ${GOPATH}/bin

install:
  - cd $GOPATH/src/github.com/YOUR_USERNAME/$MYAPP
  - go install

script: echo "pass"

# build the app, build the package
before_deploy:
  - mkdir -p build/{386,amd64}
  - GOOS=linux GOARCH=386 go build --ldflags "-X main.VERSION=${TRAVIS_TAG}" -o build/386/$MYAPP main.go
  - GOOS=linux GOARCH=amd64 go build --ldflags "-X main.VERSION=${TRAVIS_TAG}" -o build/amd64/$MYAPP main.go
  - curl -L https://raw.githubusercontent.com/mh-cbon/go-bin-deb/master/create-pkg.sh | GH=YOUR_USERNAME/$MYAPP sh -xe

# build the package repo on gh-pages
after_deploy:
  - curl -L https://raw.githubusercontent.com/mh-cbon/go-bin-deb/master/setup-repository.sh | GH=YOUR_USERNAME/$MYAPP EMAIL=$MYEMAIL sh -xe

# deploy package files into gh releases
deploy:
  provider: releases
  api_key:
    secure: GH_TOKEN xxxx
  file_glob: true
  file:
    - $MYAPP-386.deb
    - $MYAPP-amd64.deb
  skip_cleanup: true
  on:
    tags: true

useful deb commands

# Install required dependencies to build a package
sudo apt-get install build-essential lintian -y
# build a bin package
dpkg-deb --build debian hello.deb
# show info of a package
dpkg-deb --show hello.deb
# list contents of a package
dpkg-deb --contents hello.deb

Release the project

gump patch -d # check
gump patch # bump

History

CHANGELOG

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].