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.

snf-server.spec.in 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. #
  2. # $Id$
  3. #
  4. # $Id: configure.in,v 1.33 2008/02/08 15:10:17 adeniz Exp $
  5. #
  6. # autoconf input for the MicroNeil @PACKAGE_NAME@ distribution.
  7. #
  8. # Author: Alban Deniz
  9. #
  10. # Copyright (C) 2012 ARM Research Labs, LLC.
  11. # See www.armresearch.com for the copyright terms.
  12. #
  13. #############################################################################
  14. # Look for sources in this directory.
  15. %define _sourcedir @abs_srcdir@/
  16. # Build in this directory
  17. %define _builddir @abs_srcdir@/
  18. # Create the source RPM in this directory.
  19. %define _srcrpmdir @abs_srcdir@/
  20. # Create the binary RPM in this directory.
  21. %define _rpmdir @abs_srcdir@/
  22. # Test install in this directory.
  23. BuildRoot: @abs_srcdir@/scratch/
  24. # Required items.
  25. Name: @PACKAGE_NAME@
  26. Version: @VERSION@
  27. Release: 1
  28. License: Artistic
  29. Group: System Environment/Daemons
  30. Summary: ARM Research Labs Sniffer.
  31. %define manifest %{_builddir}/%{name}-%{version}-%{release}.manifest
  32. # Optional items.
  33. Vendor: ARM Research Labs, Inc.
  34. URL: http://www.armresearch.com/
  35. # Source.
  36. Source: @PACKAGE_NAME@-@VERSION@.tar.gz
  37. # Dependencies.
  38. Requires(pre): /usr/sbin/useradd
  39. Requires: curl
  40. BuildRequires: curl
  41. Provides: snf-engine
  42. %description
  43. @PACKAGE_NAME@ is a plug-in for an MTA (Mail Transport Agent, such as
  44. sendmail or postfix) that does spam detection and IP address scanning.
  45. @PACKAGE_NAME@ must be configured after installation to work with an
  46. MTA.
  47. %group Applications/Communications
  48. %prep
  49. %setup -q -n @PACKAGE_NAME@-@VERSION@
  50. %build
  51. %configure \
  52. --enable-os-type=@SNF_OSTYPE@ \
  53. --sysconfdir=/etc \
  54. --prefix=/usr
  55. make
  56. %pre
  57. # Create the snfuser user and group.
  58. getent group snfuser > /dev/null || /usr/sbin/groupadd -r snfuser
  59. getent passwd snfuser > /dev/null || \
  60. /usr/sbin/useradd -r -g snfuser -s /sbin/nologin \
  61. -c "Sniffer Account" snfuser
  62. exit 0
  63. %install
  64. rm -rf %{buildroot}
  65. make DESTDIR=%{buildroot} install
  66. %post
  67. # Configure with testmode rulebase, no integration.
  68. /usr/sbin/SNFServerConfig -setup
  69. # Add the SFServer service.
  70. /sbin/chkconfig --add snf-server
  71. /sbin/chkconfig snf-server on
  72. # Start the service.
  73. /sbin/service snf-server start
  74. %preun
  75. # Stop the service if it is running.
  76. /sbin/service snf-server status | grep running > /dev/null 2>&1
  77. if [ $? == 0 ]; then
  78. /sbin/service snf-server stop
  79. fi
  80. # Remove the service.
  81. /sbin/chkconfig --del snf-server
  82. # Reload the daemons if the systemctl command exists.
  83. if command -v /usr/bin/systemctl > /dev/null 2>&1; then
  84. /usr/bin/systemctl --system daemon-reload
  85. fi
  86. %clean
  87. rm -rf $RPM_BUILD_ROOT
  88. %files
  89. %defattr(-,root,root)
  90. %{_sbindir}/SNF2Check
  91. %{_sbindir}/SNFClient
  92. %{_sbindir}/getRulebase.sample
  93. %{_sbindir}/SNFServer
  94. %{_sbindir}/SNFDebugServer
  95. %{_sbindir}/SNFServerConfig
  96. %{_sbindir}/SNFDebugServerConfig
  97. %{_sbindir}/snfSniffer.sample
  98. %{_sbindir}/snfSnifferFilter.sample
  99. %{_sbindir}/snfscan-standalone.sample
  100. %doc %{_datadir}/doc/snf-server/COPYING
  101. %doc %{_datadir}/doc/snf-server/INSTALL
  102. %doc %{_datadir}/doc/snf-server/BUGS
  103. %doc %{_datadir}/doc/snf-server/TODO
  104. %doc %{_datadir}/doc/snf-server/ChangeLog
  105. %doc %{_datadir}/doc/snf-server/README
  106. %doc %{_datadir}/doc/snf-server/DebugMode_readme.txt
  107. %doc %{_datadir}/doc/snf-server/SNFClient_readme.txt
  108. %doc %{_datadir}/doc/snf-server/SNFServer_readme.txt
  109. %doc %{_datadir}/doc/snf-server/snf_xci.xml
  110. %{_sysconfdir}/init.d/snf-server
  111. %defattr(-,snfuser,snfuser)
  112. %dir %{_datadir}/@PACKAGE_NAME@
  113. %{_datadir}/@PACKAGE_NAME@/junkmsg.txt
  114. %{_datadir}/@PACKAGE_NAME@/cleanmsg.txt
  115. %{_datadir}/@PACKAGE_NAME@/testmode.snf
  116. %{_datadir}/@PACKAGE_NAME@/GBUdbIgnoreList.txt.sample
  117. %dir %{_sysconfdir}/@PACKAGE_NAME@
  118. %config %{_sysconfdir}/@PACKAGE_NAME@/SNFServer.xml.sample
  119. %config %{_sysconfdir}/@PACKAGE_NAME@/identity.xml.sample
  120. %changelog
  121. * Sat Jan 05 2013 Alban Deniz - 3.0.14-1
  122. - Initial version, copied from snf-milter.spec.