aide.spec 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. ##
  2. ## aide.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: aide
  27. Summary: Advanced Intrusion Detection Environment
  28. URL: http://aide.sourceforge.net/
  29. Vendor: R. Lehti & P. Virolainen
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: PLUS
  33. Group: Security
  34. License: GPL
  35. Version: 0.10
  36. Release: 20040210
  37. # package options
  38. %option with_fsl yes
  39. # list of sources
  40. Source0: http://osdn.dl.sourceforge.net/sourceforge/aide/aide-%{version}.tar.gz
  41. Source1: aide.conf
  42. Source2: rc.aide
  43. Source3: fsl.aide
  44. Patch0: aide.patch
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20040130, make, bison, flex, gcc
  49. BuildPreReq: mhash, zlib
  50. PreReq: OpenPKG, openpkg >= 20040130
  51. PreReq: mhash, zlib
  52. %if "%{with_fsl}" == "yes"
  53. BuildPreReq: fsl >= 1.2.0
  54. PreReq: fsl >= 1.2.0
  55. %endif
  56. AutoReq: no
  57. AutoReqProv: no
  58. %description
  59. Aide is an intrusion detection system for checking the integrity of
  60. files.
  61. %track
  62. prog aide = {
  63. version = %{version}
  64. url = http://prdownloads.sourceforge.net/aide/
  65. regex = aide-(__VER__)\.tar\.gz
  66. }
  67. %prep
  68. %setup -q
  69. %patch -p1
  70. case "%{l_platform -t}" in
  71. *-freebsd* )
  72. %{l_shtool} subst -e 's;^\(#define AIDE_BLKCNT_TYPE\) blkcnt_t.*$;\1 int64_t;' config.h.in
  73. echo "#define HAVE_STRNSTR 1" >>config.h.in
  74. ;;
  75. esac
  76. %build
  77. # marvelling about its beauty
  78. for i in src/*.c; do
  79. %{l_shtool} subst -e 's;//\(.*\);/*\1*/;g' $i
  80. done
  81. CC="%{l_cc}" \
  82. CFLAGS="%{l_cflags -O}" \
  83. CPPFLAGS="%{l_cppflags}" \
  84. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  85. LIBS="%{l_fsl_libs}" \
  86. ./configure \
  87. --prefix=%{l_prefix} \
  88. --sysconfdir=%{l_prefix}/etc/aide \
  89. --with-dbhmactype=sha1 \
  90. --with-dbhmackey=T3BlblBLRyBNYWludGFpbmVy \
  91. --with-zlib=%{l_prefix}
  92. %{l_make} %{l_mflags -O}
  93. %install
  94. rm -rf $RPM_BUILD_ROOT
  95. %{l_shtool} mkdir -f -p -m 755 \
  96. $RPM_BUILD_ROOT%{l_prefix}/etc/aide \
  97. $RPM_BUILD_ROOT%{l_prefix}/var/aide
  98. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  99. # supply empty default configuration (just in order to tag it as config)
  100. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  101. %{SOURCE aide.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/aide/
  102. # install run-command script
  103. %{l_shtool} mkdir -f -p -m 755 \
  104. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  105. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  106. %{SOURCE rc.aide} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  107. # install OSSP fsl configuration
  108. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  109. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  110. %{SOURCE fsl.aide} \
  111. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  112. # strip installation
  113. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/locale >/dev/null 2>&1 || true
  114. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  115. # determine installation files
  116. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  117. '%config %{l_prefix}/etc/aide/*' \
  118. '%not %dir %{l_prefix}/etc/fsl' \
  119. '%config %{l_prefix}/etc/fsl/fsl.aide'
  120. %files -f files
  121. %clean
  122. rm -rf $RPM_BUILD_ROOT