submit formula for darkstat #13557

Closed
wants to merge 4 commits into
from

Projects

None yet

9 participants

@dacresni

a network statistics grapher, collector
http://unix4lyfe.org/darkstat/

@jacknagel jacknagel and 1 other commented on an outdated diff Jul 24, 2012
Library/Formula/darkstat.rb
+
+class Darkstat < Formula
+ homepage 'http://unix4lyfe.org/darkstat/'
+ url 'http://unix4lyfe.org/darkstat/darkstat-3.0.715.tar.bz2'
+ sha1 'e635f7ae0c6dfe3a7d1fac3855ca733187163973'
+
+
+ def install
+
+ system "./configure", "--disable-debug", "--disable-dependency-tracking",
+ "--prefix=#{prefix}"
+ system "make install" # if this fails, try separate make/make install steps
+ end
+
+ def test
+ system "./darkstat -i en0"
@jacknagel
jacknagel Jul 24, 2012

This won't work; $PWD is wherever brew test is invoked from.

@adamv
adamv Jul 25, 2012

"#{sbin}/darkstat -i en0" ought to work.

@dacresni dacresni and 1 other commented on an outdated diff Jul 25, 2012
Library/Formula/darkstat.rb
@@ -0,0 +1,17 @@
+require 'formula'
+
+
+class Darkstat < Formula
+ homepage 'http://unix4lyfe.org/darkstat/'
+ url 'http://unix4lyfe.org/darkstat/darkstat-3.0.715.tar.bz2'
+ sha1 'e635f7ae0c6dfe3a7d1fac3855ca733187163973'
+
+ def install
+ system "./configure", "--disable-debug", "--prefix=#{prefix}"
+ system "make install"
+ end
+
+ def test
+ system "sudo #{sbin}/darkstat -i en0 -p 8000"
@dacresni
dacresni Jul 25, 2012

must bind to port, i think it still needs root

@Sharpie
Sharpie Aug 9, 2012

Root permissions are not necessary to bind to ports over 1024.

@dacresni
dacresni Aug 9, 2012

next time I will, will this still be an issue?

On Thu, Aug 9, 2012 at 10:48 AM, Charlie Sharpsteen <
notifications@github.com> wrote:

In Library/Formula/darkstat.rb:

@@ -0,0 +1,17 @@
+require 'formula'
+
+
+class Darkstat < Formula

  • def install
  • system "./configure", "--disable-debug", "--prefix=#{prefix}"
  • system "make install"
  • end
  • def test
  • system "sudo #{sbin}/darkstat -i en0 -p 8000"

Root permissions are not necessary to bind to ports over 1024.


Reply to this email directly or view it on GitHubhttps://github.com/mxcl/homebrew/pull/13557/files#r1343640.

@dacresni
dacresni commented Aug 2, 2012

are there any more problems with this one?

@mxcl
Member
mxcl commented Aug 8, 2012

Really we want a test that doesn't require sudo since we'll want to run tests with our automated test suite at some point.

@adamv
adamv commented Aug 8, 2012

Also squash to a single commit

@samueljohn

... are the man files installed, too?

Oh, and I don't see sudo being used on the homepage under quickstart.

@emikulic
emikulic commented Aug 9, 2012

Hi there. darkstat maintainer here. The homepage subtly implies that darkstat is being run from a root shell. i.e. # prompt instead of $ prompt. ;)

Seriously though: darkstat needs to be started with root privs in order to open /dev/bpf (unless you play games with groups I guess), bind to a low port (can be configured to a high port), and chroot().

What do you want the test to do? The one in the diff above will run a full, daemonized darkstat, and leave it running in the background. I don't think that's what you want.

@samueljohn

Pardon, my fail. @emikulic can you suggest a good test? Any other objections, features?

@emikulic
emikulic commented Aug 9, 2012

I would suggest not running a test.

Although it's embarassing to admit this, I don't really have any automated tests for darkstat. And as someone who's done packaging before, I feel your pain wrt maintainers doing the wrong thing and/or not fitting into your packaging framework, but I bet you've dealt with far worse offenders than this package. ;)

@mxcl
Member
mxcl commented Aug 9, 2012

The test really only has to prove that the software doesn't segfault when run. darkstat --version is acceptable.

Like ideally we'd run a full test suite or something, but fundamentally we just want to check the build has produced functional software.

No need for embarrassment or apologies, we're all developers here! :)

@dacresni
dacresni commented Aug 9, 2012

Oh! I can do that ^_^

On Thu, Aug 9, 2012 at 8:32 AM, Max Howell notifications@github.com wrote:

Like ideally we'd run a full test suite or something, but fundamentally we
just want to check the build has produced functional software.

@dacresni
dacresni commented Aug 9, 2012

hmm, I think my history is a little messed up. My branch is behind when I rebase, every time I pull, it pulls those commits back in, how do I resolve this, did I do it right?

@samueljohn

@dacresni this is not the best git way, but still easy:

  • copy the content of your formula to a temporary place
  • git reset --hard HEAD in your branch. Instead of HEAD you can use any rev prior to your changes.
  • git rebase master to get up to date. Should work now without conflicts.
  • copy back the content of your new darkstat formula.
@dacresni
dacresni commented Aug 9, 2012

i just git push -f
that shouldn't screw up much from where I forked

@mistydemeo
Collaborator

@dacresni It's recommended to submit pull requests from a branch specific to your pull request, to avoid this kind of problem happening.

@dacresni
dacresni commented Aug 9, 2012

next time I will, sorry, is it still an issue?

@adamv adamv was assigned Aug 22, 2012
@adamv adamv added a commit that closed this pull request Sep 4, 2012
@dacresni dacresni darkstat 3.0.715
Closes #13557.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
bb9c34a
@adamv adamv closed this in bb9c34a Sep 4, 2012
@Sharpie Sharpie pushed a commit to Sharpie/homebrew that referenced this pull request Sep 12, 2012
@dacresni dacresni darkstat 3.0.715
Closes #13557.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
571f588
@snakeyroc3 snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this pull request Dec 17, 2012
@dacresni dacresni darkstat 3.0.715
Closes #13557.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
e0826b7
@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.