Skip to content

Instantly share code, notes, and snippets.

@dopey
Created July 8, 2015 19:25
Show Gist options
  • Save dopey/690e12fefbe03b30d3d9 to your computer and use it in GitHub Desktop.
Save dopey/690e12fefbe03b30d3d9 to your computer and use it in GitHub Desktop.
Certified Deb packager
#!/bin/sh
VERSION="1.0.2"
BUILD="betable1"
set -e -x
ORIGPWD="$(pwd)"
cd "$(mktemp -d)"
trap "rm -rf \"$PWD\"" EXIT INT QUIT TERM
git clone https://github.com/rcrowley/certified.git; cd certified; git checkout -b "$VERSION" "5b9b04010d05053e1a262d01d4eb5218fa1aa464"
DIRNAME="$(pwd)"
cd ../
find "$DIRNAME" -type "d" -printf "%P\n" |
xargs -I"__" mkdir -p "rootfs/__"
find "$DIRNAME" -mindepth 2 -not -path "*/.git/*" -type "f" -printf "%P\n" |
xargs -I"__" cp "$DIRNAME/__" "rootfs/__"
rm -f "$ORIGPWD/certified_${VERSION}-${BUILD}_amd64.deb"
fakeroot fpm -C "rootfs" \
-m "Max Furman <max@betable.com>" \
-n "certified" -v "$VERSION-$BUILD" \
-p "$ORIGPWD/certified_${VERSION}-${BUILD}_amd64.deb" \
-s "dir" -t "deb" \
"bin" "lib" "share"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment