You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. Developer notes for the SNFServer developer distribution
  2. 27 January 2009
  3. Scope
  4. -----
  5. This file contains information for software developers. Ths
  6. information includes the prerequisite software for building, a
  7. description of the build system, and procedures for creating binary
  8. packages.
  9. Software prerequisites
  10. ----------------------
  11. The build system uses GNU software development system. The following
  12. software is needed for building:
  13. 1) automake
  14. 2) autoconf
  15. 3) libtool
  16. 4) make
  17. 5) g++
  18. 6) tar
  19. 7) curl
  20. 8) pthread development.
  21. These tools are normally available on a Linux system that is
  22. configured as a software development system. The Linux system
  23. installation process usually gives the user a choice of installing a
  24. workstation, server, or software development system. However, not all
  25. Linux distributions give these choices.
  26. If these tools are not installed, they may be installed (or upgraded)
  27. at any time. The commands vary from distribution to distribution.
  28. For Ubuntu, the apt-get command can be used:
  29. 1) 'apt-get install automake'.
  30. 2) 'apt-get install autoconf'.
  31. 3) 'apt-get install libtool'.
  32. 4) 'apt-get install make'.
  33. 5) 'apt-get install g++'.
  34. 6) 'apt-get install tar'.
  35. 7) 'apt-get install curl'.
  36. 8) 'apt-get install libc6-dev' (to install the pthread library).
  37. Structure of the build system
  38. -----------------------------
  39. The following files comprise the build system:
  40. 1) configure.ac. This is the main configuration file. It specifies
  41. the distribution name, version, which libraries are needed, etc.
  42. 2) Makefile.am. This is used to create the top-level Makefile. It
  43. lists which directories are part of the build system
  44. (e.g. SNFServer), and which extra files are to be part of the
  45. distribution (e.g. BUGS, README, etc).
  46. 3) CodeDweller/Makefile.am. This is used to create the Makefile for
  47. the CodeDweller library. It lists which source files are to be used
  48. for building.
  49. 3) SNFMulti/Makefile.am. This is used to create the Makefile for
  50. the SNFMulti library. It lists which source files are to be used
  51. for building.
  52. 4) SNFClient/Makefile.am. This is used to create the Makefile for
  53. SNFClient.
  54. 5) SNF2Check/Makefile.am. This is used to create the Makefile for
  55. SNF2Check.
  56. 6) Scripts/Makefile.am. This is used to create the Makefile for
  57. scripts (getRulebase, OS startup/shutdown, snfSniffer, etc).
  58. During the build process, the files in SNFMulti and CodeDweller are
  59. compiled into a static library. The applications SNFServer,
  60. SNFClient, and SNF2Check link with these libraries. This library is
  61. not installed. The system checks the dates of the files, and
  62. recompiles and relinks as necessary.
  63. To add an additional source file , edit the appropriate Makefile.am.
  64. Add the source file to the appropriate variable. For example, in
  65. SNFServer/Makefile.am:
  66. 1) SNFServer_SOURCES for the cpp files for SNFServer.
  67. 2) noinst_HEADERS for the header files for SNFServer. These are
  68. part of the user tarball, but aren't installed into the user system.
  69. Note that files that are not listed will not be included in the
  70. distribution tarball. This allows you to have additional files in
  71. directories (used, for example, for other projects) without
  72. unnecessarily increasing the size of the SNFServer application or
  73. tarball.
  74. Using the build system
  75. ----------------------
  76. Issue the following command to prepare system newly checked out for
  77. building:
  78. 1) autoreconf --install
  79. Issue the following commands for building (the ./configure command
  80. needs options; see the INSTALL file or run './configure --help' for
  81. more info):
  82. 1) ./configure --enable-os-type=Ubuntu --sysconfdir=/etc
  83. --prefix=/usr
  84. 2) make
  85. The "./configure" command configures the system for installation into
  86. the default directory. The default directory '/usr/local', but can be
  87. specified to be '/var/spool/snfilter' by adding the following line in
  88. configure.ac:
  89. AC_PREFIX_DEFAULT([/var/spool/snfilter])
  90. This can be overridden when running configure:
  91. ./configure --prefix=installation_directory
  92. where installation_directory is the directory to install the software.
  93. Other commands:
  94. "make dist" creates a tarball of the form snf-server-X.Y.Z.tar.gz.
  95. X, Y, and Z, as well as SNFServer, are specified by the following
  96. line in configure.ac:
  97. AC_INIT(snf-server, X.Y.Z)
  98. "make install" installs the software (currently copies SNFServer to
  99. the bin subdirectory of the installation directory. I expect it
  100. will be modified to install other files (configuration files,
  101. scripts, etc).
  102. "make uninstall" removes the software from the installation
  103. directory.
  104. "make clean", "make distclean", "make maintainer-clean" remove files
  105. that can be recreated. After running "make clean", you'd need to
  106. run "make" to rebuild the system. After running "make distclean" or
  107. "make maintainer-clean", you'd need to run ./configure to build the
  108. system.
  109. "make dist" creates a tarball for the user. The name is
  110. snf-server-X.Y.Z.tar.gz, and the files are extracted into the
  111. directory snf-server-X.Y.Z.
  112. "make distcheck" tests a user tarball. This command extracts,
  113. configures, builds, and installs in temporary directories. After
  114. verifying that each operation was successful, the command removes
  115. the temporary directories.
  116. "make maintainer-clean" removes many of the files that can be
  117. created. After running this, you would need to run ./configure.
  118. Note: The script 'cleanForDist' cleans the developer distribution. It
  119. removes any user tarballs that might have been created, files created
  120. by 'autoreconf --install', and files ending in "~". After running
  121. this command, the directory tree can be imported into a version
  122. control system, or tarred and gzipped.
  123. Changing the version number or package name
  124. -------------------------------------------
  125. To change the version number or package name, do the following:
  126. 1) Update configure.ac:
  127. a) Change the version number and/or package name for the build
  128. system. Do this by modifying the argument to the AC_INIT line in
  129. configure.ac. For example, to change the package name to FOO and
  130. the version to 8.0.2, modify the line to be:
  131. AC_INIT(FOO, 8.0.2)
  132. Build-time configuration parameters
  133. -----------------------------------
  134. The configure script accepts the following command-line parameters in
  135. addition to the standard parameters;
  136. --enable-os-type=TYPE
  137. where TYPE specifies the operating system for which SNFServer is to
  138. be configured.
  139. Generation of sample configuration files and scripts
  140. ----------------------------------------------------
  141. The build system generates sample configuration files and scripts that
  142. take into account where the SNFServer distribution is installed. For
  143. example, if the distribution is built as follows:
  144. ./configure --prefix=/home/temp --enable-os-type=OpenBSD
  145. then the sample rulebase download script getRulebase.sample would
  146. download the rulebase to /home/temp/share/snf-server. The other files
  147. (SNFServer.xml.sample, and SNFServer) would also be generated to take
  148. the specified prefix into account.