# HG changeset patch # User Louis Opter # Date 1442195181 25200 # Node ID 0967247080a8a909d751b674c6544e42ab500e54 # Parent 907611feda92c9088655c9e7bb3d2c02eb1aa603 lightsd 0.9.2, launchd integration, keep devel for myself for now diff -r 907611feda92 -r 0967247080a8 lightsd.rb --- a/lightsd.rb Sun Sep 06 02:36:14 2015 -0700 +++ b/lightsd.rb Sun Sep 13 18:46:21 2015 -0700 @@ -3,28 +3,72 @@ class Lightsd < Formula desc "Daemon to control your LIFX wifi smart bulbs" homepage "https://github.com/lopter/lightsd/" - url "https://github.com/lopter/lightsd/archive/0.9.1.tar.gz" - sha256 "72eba6074ed18609fb0caf7b7429e1b8f6c3564ca6f81357be22c06ac00956b6" - revision 3 + url "https://github.com/lopter/lightsd/archive/0.9.2.tar.gz" + sha256 "2d785ede7c2e3b603ad33c11c3e44b5c634ee17e745d39296125025eddbbf420" + revision 1 depends_on "cmake" => :build - depends_on "libbsd" => :optional depends_on "libevent" => :build depends_on "python" => :optional def install - args = %W[ - -DCMAKE_BUILD_TYPE=RELEASE - -DCMAKE_INSTALL_PREFIX=#{prefix} - ] + args = std_cmake_args + args << "-DLGTD_RUNTIME_DIRECTORY=#{var}/run/lightsd" system "cmake", *args - system "make", "install" end + def plist; <<-EOS.undent + + + + + KeepAlive + + SuccessfulExit + + + Label + #{plist_name} + ProgramArguments + + #{opt_bin}/lightsd + -f + -v + warning + -s + #{var}/run/lightsd/socket + -c + #{var}/run/lightsd/pipe + + RunAtLoad + + WorkingDirectory + #{var} + StandardErrorPath + #{var}/log/lightsd.log + StandardOutPath + #{var}/log/lightsd.log + + + EOS + end + + def caveats; <<-EOS.undent + Once you've started lightsd with launchctl load (see below), you can start + poking around with lightsc.py: + + `lightsd --prefix`/share/doc/lightsd/examples/lightsc.py + EOS + end + + head do + url "https://github.com/lopter/lightsd.git" + end + devel do - url "https://github.com/lopter/lightsd.git" + url "file:///Users/louis/projs/lightsd", :using => :hg version "1.0" end @@ -36,7 +80,6 @@ -c #{dir}/lightsd.cmd -h ] - system "#{bin}/lightsd", *args end end