Skip to content

Instantly share code, notes, and snippets.

@flazz
Created July 6, 2014 16:25
Show Gist options
  • Save flazz/74c497a3842294b856e7 to your computer and use it in GitHub Desktop.
Save flazz/74c497a3842294b856e7 to your computer and use it in GitHub Desktop.
{stdenv, fetchurl, bash, coreutils}:
let version = "2.07";
in stdenv.mkDerivation rec {
name = "perp-${version}";
src = fetchurl {
url = "http://b0llix.net/perp/distfiles/${name}.tar.gz";
sha256 = "1222fe31c16014d8b2a78416f93ba9f8c31eddbc381adc9021fa5d9764475815";
};
configurePhase = ''
substituteInPlace conf.mk --replace /usr/bin $out/bin
substituteInPlace conf.mk --replace /usr/sbin $out/sbin
substituteInPlace conf.mk --replace /usr/share/man $out/share/man
'';
dontStrip = true;
preFixup = "make strip";
perpBase = "~/Library/Application Support/Perp";
workingDir = "~/Library/Caches/Perp";
# TODO organize these under one set called tmpl?
activatePerpTmpl = ./activate-perp.template;
plistTmpl = ./perp.plist.template;
# TODO export these without this hack
bashD = bash;
coreutilsD = coreutils;
postInstall = ''
ensureDir $out/sbin
substituteAll $activatePerpTmpl $out/sbin/perp-activate
chmod +x $out/sbin/perp-activate
ensureDir $out/share
substituteAll $plistTmpl $out/share/perp.plist
'';
meta = {
homepage = "http://b0llix.net/perp/";
description = "Persistent process supervisor and service managment framework";
platforms = stdenv.lib.platforms.all;
license = {
shortName = "perp";
longName = "perp license";
url = "http://b0llix.net/perp/site.cgi?page=LICENSE";
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment