Howdy Alan,

I've had an initial stab at packaging assimilation + deps for Fedora 18
and EPEL 6. This includes 5 packages that aren't already in the
repositories:

python-ctypesgen
python-testify
python-py2neo
neo4j
assimilation


The python packages were fairly straight forward. If any Fedora people
are watching I've posted them for review:

python-ctypesgen
https://bugzilla.redhat.com/show_bug.cgi?id=919932

python-testify
https://bugzilla.redhat.com/show_bug.cgi?id=919937

python-py2neo
https://bugzilla.redhat.com/show_bug.cgi?id=919933


The assimilation package (which of course at this pre-alpha "toy" stage
I don't have any intention to put up for review) can be viewed here:

Spec: http://jamielinux.fedorapeople.org/assimilation/assimilation.spec
SRPM:
http://jamielinux.fedorapeople.org/assimilation/SRPMS/assimilation-0.1.0-0.1.20130311hg514.fc18.src.rpm

Note that I decided to call it assimilation, with an
assimilation-nanoprobe subpackage. The services still retain the names
assimilation-cma and assimilation-nanoprobe, but I thought it might be
more intuitive if "yum install assimilation" gets you the main workhorse
(=cma).

I came across a few issues when building assimilation which I've hacked
around and listed below. These hacks are quick and dirty and probably
all wrong, so I'll leave you to fix them properly, assuming of course
they are actually real problems.

1) There are two unusual looking lines in cma/AssimCtypes.py:

  _libdirs = ['../../bin/clientlib',
'/home/alanr/monitor/bin/clientlib', '/usr/lib/x86_64-linux-gnu']

  add_library_search_dirs(['../../bin/clientlib',
'/home/alanr/monitor/bin/clientlib', '/usr/lib/x86_64-linux-gnu'])

As high availability as your home directory may be, /usr/sbin/cma can't
seem to find the shared libraries located there ;) so the current hack
I'm using looks like the following (where %{_libdir} is /usr/lib on
i686, or /usr/lib64 on x86_64):

sed -i \
    -e "s|^_libdirs =.*|_libdirs = ['%{_libdir}',
'%{_libdir}/assimilation']|g" \
    -e
"s|^add_library_search_dirs.*|add_library_search_dirs(['%{_libdir}',
'%{_libdir}/assimilation'])|g" \
    cma/AssimCtypes.py


2) It seems /usr/sbin/nanoprobe can't find the shared libraries either,
and I couldn't mould cmake to my bidding, so I'm symlinking the two
libraries at /usr/lib64/assimilation/libassimfoo.so to
/usr/lib64/libassimfoo.so.


3) When building on EPEL 6, I got hit by an "undefined reference to
clock_gettime" error, which I've hacked around with this patch:

--- a/clientlib/CMakeLists.txt
+++ b/clientlib/CMakeLists.txt
@@ -49,6 +49,6 @@
   target_link_libraries(${CLIENTLIB} ${GLIB_LIB})
   target_link_libraries(${CLIENTLIB} ${WS2_LIB})
 ELSE(WIN32)
-  target_link_libraries (${CLIENTLIB} -lpcap -lglib-2.0)
+  target_link_libraries (${CLIENTLIB} -lpcap -lglib-2.0 -lrt)
 ENDIF(WIN32)
 install(TARGETS ${CLIENTLIB} COMPONENT nanoprobe-component LIBRARY
DESTINATION ${InstallLIBS})


4) When building on 32bit EPEL 6, I get an "integer constant is too
large for 'unsigned long' type" error, which I've hacked around with
this patch:

--- a/clientlib/intframe.c
+++ b/clientlib/intframe.c
@@ -212,7 +212,7 @@
        guint16         framelength = get_generic_tlv_len(tlvstart, pktend);
        const guint8*   framevalue = get_generic_tlv_value(tlvstart, pktend);
        IntFrame *      ret = intframe_new(frametype, framelength);
-       guint64         intvalue = 0xffffffffffffffffUL;
+       guint64         intvalue = 0xffffffffffffffffULL;
        g_return_val_if_fail(ret != NULL, NULL);

        ret->baseclass.length = framelength;


5) /usr/sbin/cma service seems to run fine as an unprivileged user (ie,
UID!=0), but /usr/sbin/nanoprobe needs privs for pcap and complains if
UID!=0. Would it be feasible to allow nanoprobe to drop privs if run as
root, or to run usefully as an unprivileged user? Even if running as
root, systemd makes it possible to perform some service hardening.


The Fedora RPMS use systemd service files for assimilation-cma,
assimilation-nanoprobe and neo4j. The EPEL 6 RPMS use custom initscripts
(not the initscripts shipped with assimilation or neo4j).

Packaging neo4j... well, let's just say Java packaging is comparable to
gouging one's eyes out with a rusty spoon. The current package is not
suitable for inclusion into Fedora as there are numerous bundled .jar
files that need to be packaged separately. Maybe I'll tackle that at a
later date (later=3months).

Self-inflicted spoon-related eye injuries aside, I've set up a
repository for Fedora 18 and EPEL 6 that has all of the dependencies.
For anyone interested, repository instructions are below.

DISCLAIMER: This repository may be discontinued at any time. Do not rely
on it for anything other than testing assimilation, and even then you're
probably better off compiling from source. The packages are signed with
my GPG key, so when your computer explodes I cannot try to pretend it
wasn't me. And finally, these packages have received barely any testing
and may be horribly broken, but I need to sleep now :)

Fedora 18:
http://repos.fedorapeople.org/repos/jamielinux/assimilation/fedora-assimilation.repo

EPEL 6:
http://repos.fedorapeople.org/repos/jamielinux/assimilation/epel-assimilation.repo


Kind regards,

-- 
Jamie Nguyen


_______________________________________________
Assimilation mailing list - Discovery-Driven Monitoring
[email protected]
http://lists.community.tummy.com/cgi-bin/mailman/listinfo/assimilation
http://assimmon.org/

Reply via email to