make: add install targets, stub for version
[netsniff-ng.git] / PACKAGING
blobcb15e092fe1d8bdfc7ff06d771d1374044a44f4c
1 If you are a package distribution maintainer, this is the right file for you.
2 By default, netsniff-ng has some architecture-specific tuning options enabled
3 that don't belong into a package binary of a distribution. Hence, you might
4 want to adapt some build-related things before starting to package the toolkit.
5 Have a look at the patches that are described in the following:
7 In case you want cmake to install manpages under /usr/share/man/, apply the
8 following patch from Emmanuel Roullit:
10 --- a/src/cmake/modules/Pod2Man.cmake
11 +++ b/src/cmake/modules/Pod2Man.cmake
12 @@ -47,7 +47,7 @@
14         INSTALL(
15                 FILES ${CMAKE_CURRENT_BINARY_DIR}/${MANFILE}.${SECTION}.gz
16 -               DESTINATION share/man/man${SECTION}
17 +               DESTINATION /usr/share/man/man${SECTION}
18         )
19  ENDMACRO(POD2MAN PODFILE MANFILE SECTION)
21 The same thing counts for installing relevant files from the documentation:
23 --- a/src/CMakeLists.txt
24 +++ b/src/CMakeLists.txt
25 @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 2.6)
26  set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
27  set(EXECUTABLE_INSTALL_PATH /usr/sbin)
28  set(CONFIG_INSTALL_PATH /etc/netsniff-ng)
29 -set(DOC_INSTALL_PATH share/doc/netsniff-ng)
30 +set(DOC_INSTALL_PATH /usr/share/doc/netsniff-ng)
32  set(VERSION "0.5.8")
34 In case there is already a NaCl library version shipped with your distribution
35 so that you only need to tell cmake pointers to the library and include path,
36 you can add a new cmake file into src/curvetun and apply the patch from Kartik
37 Mistry with perhaps changed paths:
39 --- /dev/null
40 +++ b/src/curvetun/nacl_path.cmake
41 @@ -0,0 +1,2 @@
42 +SET(NACL_INCLUDE_DIR /usr/include/nacl)
43 +SET(NACL_LIB_DIR /usr/lib)
45 Last but not least, if you package a binary distribution, make sure that
46 architecture specific tuning has been turned off. You can do this by changing
47 the following flags in the src/CMakeLists.txt file:
49 --- a/src/CMakeLists.txt
50 +++ b/src/CMakeLists.txt
51 @@ -16,15 +16,13 @@ include(CheckHwTimestamp)
52  include(Pod2Man)
54  add_definitions(
55 -  -O3
56 +  -O2
57    -fstack-protector
58    -fpie
59    -std=gnu99
60    -fno-strict-aliasing
61    -D_FORTIFY_SOURCE=2
62    -D_REENTRANT
63 -  -march=native
64 -  -mtune=native
65    -Wall
66    -Wundef
67    -Wstrict-prototypes
69 This should be it. However, in case we missed to describe something, drop us an
70 email as stated in REPORTING-BUGS.