Bug 223677 - New port: net-mgmt/py-netgrasp: A passive network monitor tracking ARP packets
Summary: New port: net-mgmt/py-netgrasp: A passive network monitor tracking ARP packets
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Yuri Victorovich
URL:
Keywords:
Depends on: 223862 223863 223864
Blocks:
  Show dependency treegraph
 
Reported: 2017-11-15 07:28 UTC by Jeremy Andrews
Modified: 2018-03-11 17:32 UTC (History)
2 users (show)

See Also:


Attachments
Passive network monitor tracking ARP packets (7.76 KB, text/plain)
2017-11-15 07:28 UTC, Jeremy Andrews
no flags Details
Passive network monitor tracking ARP packets (49.16 KB, text/plain)
2017-11-16 13:06 UTC, Jeremy Andrews
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Andrews 2017-11-15 07:28:59 UTC
Created attachment 188011 [details]
Passive network monitor tracking ARP packets

Netgrasp is a passive network monitor that tracks IP and MAC address pairs seen on the network while it runs, optionally generating notifications. For example, it can notify you when a new device joins your network. It can also send daily and weekly emails summarizing the devices using your network.

WWW: https://github.com/jeremyandrews/netgrasp
Comment 1 Yuri Victorovich freebsd_committer 2017-11-16 05:21:40 UTC
It fails in the stage phase:
mkdir: /var/db/netgrasp: Permission denied

You can only create directories under ${STAGEDIR}.

The port also needs these changes:
* Remove 'Created by'
* Rename the directory into py-netgrasp
* Change MASTER_SITE to CHEESESHOP and remove github.
* It's better to use "USE_PYTHON=    autoplist distutils"
* No need for do-install. This will happen automatically. Some extra-files can be added. See the example here: graphics/py-seqdiag


The beginning on the Makefile should look like this:

> # $FreeBSD$
> 
> PORTNAME=       NetGrasp
> DISTVERSION=    0.9.4
> CATEGORIES=     net-mgmt
> MASTER_SITES=   CHEESESHOP 
> PKGNAMEPREFIX=  ${PYTHON_PKGNAMEPREFIX}
Comment 2 Jeremy Andrews 2017-11-16 13:06:12 UTC
Created attachment 188044 [details]
Passive network monitor tracking ARP packets

Thanks for the quick review!

I've made the requested changes. I'm not sure how CHEESESHOP work though, as it doesn't find the netgrasp tarball, hence I'm not sure how it's supposed to be named.

The way I've implemented the @sample together with autoplist generates a warning about the file being declared twice, but it auto-cleans up the sample file on deinstall this way.
Comment 3 Yuri Victorovich freebsd_committer 2017-11-16 16:44:06 UTC
(In reply to Jeremy Andrews from comment #2)

Thank you for your quick update!
Comment 4 Yuri Victorovich freebsd_committer 2017-11-16 16:52:04 UTC
setup.py has
> install_requires=["pypcap>=1.1.6", "dpkt>=1.8.0", "daemonize>=2.4.7", "pyzmail>=1.0.3", "jinja2>=2.9.6"]
which should be reflected in Makefile as RUN_DEPENDS.
Comment 5 Yuri Victorovich freebsd_committer 2017-11-16 16:53:18 UTC
(In reply to Yuri Victorovich from comment #4)

Also, python2>0:lang/python2 isn't needed.
Comment 6 Jeremy Andrews 2017-11-16 16:55:38 UTC
> Also, python2>0:lang/python2 isn't needed

I had to add this to ensure that /usr/local/bin/python2 was available. Otherwise I believe I was only seeing /usr/local/bin/python (which was python2, but which breaks the netgrasp script which looks for python2)
Comment 7 Yuri Victorovich freebsd_committer 2017-11-16 16:59:08 UTC
(In reply to Jeremy Andrews from comment #6)

The correct way is to patch /usr/local/bin/python2.7 -> /usr/local/bin/python
No need to hardcode the python version.
Comment 8 Yuri Victorovich freebsd_committer 2017-11-16 16:59:49 UTC
(In reply to Yuri Victorovich from comment #7)

It should actually be #!/usr/bin/env python
Comment 9 Walter Schwarzenfeld freebsd_triage 2018-03-11 16:50:47 UTC
A ping to Jeremy!
Comment 10 Jeremy Andrews 2018-03-11 17:32:48 UTC
Thanks for the ping. I've decided to rework the codebase, integrating w/ a web framework and updating to Python 3. I'll re-submit once that effort is complete -- and be sure to address the above feedback as well.