Add build environment.
Add stats.h.
Do not link with libpthread.
Add RPM spec.
Add test case.