This repository has been archived by the owner. It is now read-only.

Add Formla for fhem a GPL'd perl server for house automation. #18314

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

iStehle commented Mar 7, 2013

Working and tested formula, used inreplace for the Makefile

Version 5.3
www.fhem.de

@jacknagel jacknagel commented on an outdated diff Mar 7, 2013

Library/Formula/fhem.rb
+ def install
+ # Replace vars in the Makefile to match the homebrew spec
+
+ inreplace 'Makefile' do |s|
+ s.change_make_var! "BINDIR", prefix
+ s.change_make_var! "ETCDIR", etc
+ s.change_make_var! "VARDIR", var.to_s + "/log/fhem"
+ s.change_make_var! "MANDIR", doc
+ s.change_make_var! "RELATIVE_PATH", FALSE
+ end
+
+ system "make install"
+ ohai 'Installation of fhem completed!
+
+ Start fhem with
+ perl /usr/local/Cellar/fhem/5.3/fhem.pl /usr/local/etc/fhem.cfg'
@jacknagel

jacknagel Mar 7, 2013

Contributor

Remove this ohai, we don't do output like this

@jacknagel jacknagel commented on an outdated diff Mar 8, 2013

Library/Formula/fhem.rb
+
+ inreplace 'Makefile' do |s|
+ s.change_make_var! "BINDIR", prefix
+ s.change_make_var! "ETCDIR", etc
+ s.change_make_var! "VARDIR", var+"log/fhem"
+ s.change_make_var! "MANDIR", doc
+ s.change_make_var! "RELATIVE_PATH", FALSE
+ end
+
+ system "make install"
+ end
+
+ def caveats
+ ohai 'Start fhem with
+
+ perl /usr/local/Cellar/fhem/5.3/fhem.pl '+etc+'/fhem.cfg'
@jacknagel

jacknagel Mar 8, 2013

Contributor

caveats should just return a string, not output stuff directly

@jacknagel jacknagel commented on an outdated diff Mar 8, 2013

Library/Formula/fhem.rb
@@ -0,0 +1,30 @@
+require 'formula'
+
+class Fhem < Formula
+ homepage 'http://fhem.de/fhem.html'
+ url 'http://fhem.de/fhem-5.3.tar.gz'
+ sha1 'b347cc520298500dea5140538b31de9eacbc8bb1'
+
+ depends_on 'Device::SerialPort' => :perl
+
+ def install
+ # Replace vars in the Makefile to match the homebrew spec
@jacknagel

jacknagel Mar 8, 2013

Contributor

Unnecessary comment

@jacknagel jacknagel and 1 other commented on an outdated diff Mar 8, 2013

Library/Formula/fhem.rb
+ sha1 'b347cc520298500dea5140538b31de9eacbc8bb1'
+
+ depends_on 'Device::SerialPort' => :perl
+
+ def install
+ # Replace vars in the Makefile to match the homebrew spec
+
+ inreplace 'Makefile' do |s|
+ s.change_make_var! "BINDIR", prefix
+ s.change_make_var! "ETCDIR", etc
+ s.change_make_var! "VARDIR", var+"log/fhem"
+ s.change_make_var! "MANDIR", doc
+ s.change_make_var! "RELATIVE_PATH", FALSE
+ end
+
+ system "make install"
@jacknagel

jacknagel Mar 8, 2013

Contributor

Usually these variables can be passed to make rather than inreplaced:

system "make", "BINDIR=#{prefix}", "ETCDIR=#{etc}", ...

can you see if that is sufficient here?

@iStehle

iStehle Mar 8, 2013

Contributor

didn't think of that, but it does not work that way with the makefile

Contributor

jacknagel commented Mar 8, 2013

Squash to a single commit please, thanks.

Contributor

iStehle commented Mar 21, 2013

Squashed the commits, should be ready to merge.

We should write out a startup script that contains this line.

Contributor

adamv commented May 16, 2013

Replace the caveat with a startup script:

(bin/'fhem').write <<-EOS.undent
  #!/bin/bash
  #{prefix}/fhem.pl #{etc}/fhem.cfg
EOS
Contributor

adamv commented May 22, 2013

I'm -1 on including this in core due to the Perl module dependency; does any other maintainer want to advocate for this formula?

Contributor

adamv commented Jul 31, 2013

Passing on this.

@adamv adamv closed this Jul 31, 2013

@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.