Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

DEVELOPER_NOTES 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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. binary/SNFServer), and which extra files are to be part of the
  45. distribution (e.g. BUGS, README, etc).
  46. 3) Makefile.am in each directory: binary/SNFServer,
  47. binary/SNFClient, binary/SNF2Check, binary/SNFServerConfig, Scripts,
  48. Tests, and config_files. These are used to create the Makefile
  49. files for building, configuring and installing the software. These
  50. Makefile.am files contain lists which source files are to be used
  51. for building, and directions to generate the configuration files.
  52. During the build process, the binary/<AppName> directories (where
  53. <AppName> is the name of the executable) are populated with the object
  54. files and executable. The system checks the dates of the files, and
  55. recompiles and relinks as necessary.
  56. To add an additional source file , edit the appropriate Makefile.am.
  57. Add the source file to the appropriate variable. For example, in
  58. binary/SNFServer/Makefile.am:
  59. 1) SNFServer_SOURCES for the cpp files for SNFServer.
  60. In the top-level Makefile.am:
  61. 1) noinst_HEADERS for the header files for SNFServer. These are
  62. part of the user tarball, but aren't installed into the user system.
  63. Note that files that are not listed will not be included in the
  64. distribution tarball. This allows you to have additional files in
  65. directories (used, for example, for other projects) without
  66. unnecessarily increasing the size of the SNFServer application or
  67. tarball.
  68. Using the build system
  69. ----------------------
  70. Issue the following command to prepare system newly checked out for
  71. building:
  72. 1) autoreconf --install
  73. Issue the following commands for building (the ./configure command
  74. needs options; see the INSTALL file or run './configure --help' for
  75. more info):
  76. 1) ./configure --enable-os-type=Ubuntu --sysconfdir=/etc
  77. --prefix=/usr
  78. 2) make
  79. The "./configure" command configures the system for installation into
  80. the default directory. The default directory '/usr/local', but can be
  81. specified to be '/var/spool/snfilter' by adding the following line in
  82. configure.ac:
  83. AC_PREFIX_DEFAULT([/var/spool/snfilter])
  84. This can be overridden when running configure:
  85. ./configure --prefix=installation_directory
  86. where installation_directory is the directory to install the software.
  87. Other commands:
  88. "make dist" creates a tarball of the form snf-server-X.Y.Z.tar.gz.
  89. X, Y, and Z, as well as SNFServer, are specified by the following
  90. line in configure.ac:
  91. AC_INIT(snf-server, X.Y.Z)
  92. "make install" installs the software (currently copies SNFServer to
  93. the bin subdirectory of the installation directory. I expect it
  94. will be modified to install other files (configuration files,
  95. scripts, etc).
  96. "make uninstall" removes the software from the installation
  97. directory.
  98. "make clean", "make distclean", "make maintainer-clean" remove files
  99. that can be recreated. After running "make clean", you'd need to
  100. run "make" to rebuild the system. After running "make distclean" or
  101. "make maintainer-clean", you'd need to run ./configure to build the
  102. system.
  103. "make dist" creates a tarball for the user. The name is
  104. snf-server-X.Y.Z.tar.gz, and the files are extracted into the
  105. directory snf-server-X.Y.Z.
  106. "make distcheck" tests a user tarball. This command extracts,
  107. configures, builds, and installs in temporary directories. After
  108. verifying that each operation was successful, the command removes
  109. the temporary directories.
  110. "make maintainer-clean" removes many of the files that can be
  111. created. After running this, you would need to run ./configure.
  112. Note: The script 'cleanForDist' cleans the developer distribution. It
  113. removes any user tarballs that might have been created, files created
  114. by 'autoreconf --install', and files ending in "~". After running
  115. this command, the directory tree can be imported into a version
  116. control system, or tarred and gzipped.
  117. Changing the version number or package name
  118. -------------------------------------------
  119. To change the version number or package name, do the following:
  120. 1) Update configure.ac:
  121. a) Change the version number and/or package name for the build
  122. system. Do this by modifying the argument to the AC_INIT line in
  123. configure.ac. For example, to change the package name to FOO and
  124. the version to 8.0.2, modify the line to be:
  125. AC_INIT(FOO, 8.0.2)
  126. Build-time configuration parameters
  127. -----------------------------------
  128. The configure script accepts the following command-line parameters in
  129. addition to the standard parameters;
  130. --enable-os-type=TYPE
  131. where TYPE specifies the operating system for which SNFServer is to
  132. be configured.
  133. Generation of sample configuration files and scripts
  134. ----------------------------------------------------
  135. The build system generates sample configuration files and scripts that
  136. take into account where the SNFServer distribution is installed. For
  137. example, if the distribution is built as follows:
  138. ./configure --prefix=/home/temp --enable-os-type=OpenBSD
  139. then the sample rulebase download script getRulebase.sample would
  140. download the rulebase to /home/temp/share/snf-server. The other files
  141. (SNFServer.xml.sample, and SNFServer) would also be generated to take
  142. the specified prefix into account.