Bug 217556 - New port: security/moloch (help with minor npm problem during staging required)
Summary: New port: security/moloch (help with minor npm problem during staging required)
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: freebsd-ports-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-05 04:37 UTC by h0rst
Modified: 2019-08-13 19:07 UTC (History)
3 users (show)

See Also:


Attachments
initial port attempt (409.55 KB, patch)
2017-03-05 04:37 UTC, h0rst
no flags Details | Diff
v0.17.1 with fixed staging (305.32 KB, patch)
2017-04-26 12:09 UTC, h0rst
no flags Details | Diff
v0.18.2 (305.54 KB, patch)
2017-04-26 12:10 UTC, h0rst
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description h0rst 2017-03-05 04:37:54 UTC
Created attachment 180525 [details]
initial port attempt

I wrote up the initial attempt for a security/moloch port (AOLs large scale packet capturing, indexing and database system). 

The port compiles and works fine over here, however I can't finish it up as an npm-subpackage involves absolute paths when staging thus preventing a clean package build. It might be enough to somehow exclude the files from the plist, but I am not sure how to proceed.

Can someone more experienced have a look at that port, which otherwise appears to work fine?

Thanks!



Build error:

====> Running Q/A tests (stage-qa)
Error: '/usr/ports/custom/moloch/work/.PLIST.mktmp' is referring to /usr/ports/custom/moloch/work/stage
Error: '/usr/ports/custom/moloch/work/stage/usr/local/moloch/viewer/node_modules/fs-ext/build/config.gypi' is referring to /usr/ports/custom/moloch/work/stage
Error: '/usr/ports/custom/moloch/work/stage/usr/local/moloch/viewer/node_modules/fs-ext/build/Makefile' is referring to /usr/ports/custom/moloch/work/stage
Error: '/usr/ports/custom/moloch/work/stage/usr/local/moloch/viewer/node_modules/png/build/config.gypi' is referring to /usr/ports/custom/moloch/work/stage
Error: '/usr/ports/custom/moloch/work/stage/usr/local/moloch/viewer/node_modules/png/build/Makefile' is referring to /usr/ports/custom/moloch/work/stage
*** Error code 1

Stop.
Comment 1 Walter Schwarzenfeld freebsd_triage 2017-03-05 08:59:42 UTC
Fails on 10.3-RELEASE-p17 with:

reader-libpcap-file.o: In function `reader_libpcapfile_monitor_dir':
/ram/usr/ports/myports/moloch/work/moloch-0.17.1/capture/reader-libpcap-file.c:109: undefined reference to `inotify_add_watch'
reader-libpcap-file.o: In function `reader_libpcapfile_init_monitor':
/ram/usr/ports/myports/moloch/work/moloch-0.17.1/capture/reader-libpcap-file.c:151: undefined reference to `inotify_init1'
reader-libpcap-file.o: In function `reader_libpcapfile_opened':
/ram/usr/ports/myports/moloch/work/moloch-0.17.1/capture/reader-libpcap-file.c:451: undefined reference to `dlt_to_linktype'
reader-libpcap.o: In function `reader_libpcap_start':
/ram/usr/ports/myports/moloch/work/moloch-0.17.1/capture/reader-libpcap.c:113: undefined reference to `dlt_to_linktype'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 2 Walter Schwarzenfeld freebsd_triage 2017-03-06 01:15:36 UTC
It compiles if I did on the commandline
make CFLAGS+=-I/usr/include CPPFLAGS+=-I/usr/include.
Cause this not work if I put it in the Makefile.

(Further I had problems to compile phantomjs Bug 217557 ).
Comment 3 h0rst 2017-03-07 05:18:58 UTC
I tried once more on a different 10.3 machine. All dependencies (including phantomjs, to which I contributed a patch for the 2.1.1 upgrade) went through. This port compiles, too to finally fail at the same position (during qa-stage) as described in the original post, the reason being some absolute path references.

This means I have no idea why it is broken for you.
Comment 4 Walter Schwarzenfeld freebsd_triage 2017-03-07 10:02:01 UTC
I think phantonjs is an own problem, have nothing to do with this port.

Maybe, I have problem cause I am using libressl (?).
Comment 5 Walter Schwarzenfeld freebsd_triage 2017-03-08 04:31:02 UTC
--- capture/reader-libpcap-file.c.orig  2017-03-08 04:20:16 UTC
+++ capture/reader-libpcap-file.c
@@ -40,7 +40,7 @@ void reader_libpcapfile_opened();
 LOCAL struct bpf_program   *bpf_programs[MOLOCH_FILTER_MAX];
 LOCAL MolochPacketBatch_t   batch;
 
-#ifdef HAVE_SYS_INOTIFY_H
+#ifndef HAVE_SYS_INOTIFY_H

after this it compiles (except the install problem).
Comment 6 Walter Schwarzenfeld freebsd_triage 2017-03-08 05:09:05 UTC
I can*t work it out.
But take a look in www/lessc/Makefile. Maybe, the solution for the install problem is there (I am not sure
but I saw similar in other ports with npm).
Comment 7 h0rst 2017-04-26 12:09:13 UTC
Created attachment 182094 [details]
v0.17.1 with fixed staging

first, reworked above patch:
- v0.17.1
- use www/npm instead of www/npm2
- move simple source changes from ordinary patches to ${REINPLACE_CMD} runs
- fix npm staging problems (following hint by w.schwarzenfeld)
Comment 8 h0rst 2017-04-26 12:10:07 UTC
Created attachment 182095 [details]
v0.18.2

second, upgrade to current upstream:
- update to v0.18.2

problem #1: wise service remains disabled for now
problem #2: poudriere build fails due to lacking internet access of npm during build phase; cf.

https://github.com/freebsd/poudriere/issues/287

and a proposed solution, which is outdated unfortunately,

https://github.com/saper/ports-exp/commit/86b8a08728c4e76f15b7078c2d9ec06e2bded99a

- as outlined in the gh discussion above, it would appear that merely moving the npm bits to the fetch phase in order for poudriere to provide internet access won't work
Comment 10 Marcin Cieślak 2018-05-11 12:09:20 UTC
I'll have a look at it, I have solved the npm fetch problem in my unofficial node-sass port:

https://github.com/saper/ports-exp
Comment 11 Walter Schwarzenfeld freebsd_triage 2019-08-13 19:07:09 UTC
phantomjs:

DEPRECATED=     Project has been discontinued: https://github.com/ariya/phantomjs/issues/15344
EXPIRATION_DATE=2019-05-15

So I think it is no possible to create this port and we can close here. Thanks for your try.