From 861765c85a789203edfa04a2ea431da2ebfc9373 Mon Sep 17 00:00:00 2001 From: Magnus Hoff Date: Wed, 29 Nov 2017 15:45:03 +0100 Subject: [PATCH] Add brew formula --- README.md | 8 +++++++- deploy/sausagewiki.rb | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 deploy/sausagewiki.rb diff --git a/README.md b/README.md index 8bd8e53..7a23dcd 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,13 @@ single independent executable for Linux. For a more permanent installation, you could [install Sausagewiki as a systemd service](https://github.com/maghoff/sausagewiki/wiki/System-wide-installation-with-systemd). -Alternatively, you could build it from source code with `cargo build`. +Alternative installation methods include the following: + +**Build from source** with `cargo build`. This requires you to have a working +installation of [rust](https://www.rust-lang.org/en-US/). + +**Install with [Homebrew](https://brew.sh/)** on OS X/macOS: +`brew install --HEAD https://raw.githubusercontent.com/maghoff/sausagewiki/master/deploy/sausagewiki.rb` Command line arguments ---------------------- diff --git a/deploy/sausagewiki.rb b/deploy/sausagewiki.rb new file mode 100644 index 0000000..cc0a8e8 --- /dev/null +++ b/deploy/sausagewiki.rb @@ -0,0 +1,16 @@ +class Sausagewiki < Formula + desc "A simple, self-contained Wiki engine" + homepage "https://github.com/maghoff/sausagewiki/" + head "https://github.com/maghoff/sausagewiki.git" + + depends_on "rust" => :build + + def install + system "cargo", "build", "--release" + bin.install "target/release/sausagewiki" + end + + test do + system "#{bin}/sausagewiki", "--version" + end +end