tripwire.spec 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. ##
  2. ## tripwire.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.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. # FIXME: thl fsl does not make it into the binary
  26. # package versions
  27. %define V_tripwire 2.3.1
  28. %define V_lvl 2
  29. %define V_openpkg %{V_tripwire}.%{V_lvl}
  30. %define V_vendor %{V_tripwire}-%{V_lvl}
  31. # package information
  32. Name: tripwire
  33. Summary: File and Directory Integrity Checker
  34. URL: http://www.tripwire.org/
  35. Vendor: Tripwire, Inc
  36. Packager: The OpenPKG Project
  37. Distribution: OpenPKG [EVAL]
  38. Group: Security
  39. License: GPL
  40. Version: %{V_openpkg}
  41. Release: 20030708
  42. # package options
  43. %option with_fsl yes
  44. # list of sources
  45. Source0: http://osdn.dl.sourceforge.net/sourceforge/tripwire/tripwire-%{V_vendor}.tar.gz
  46. Source1: tw.cfg
  47. Source2: sparc-solaris.inc
  48. Source3: sparc-solaris.mak
  49. Source4: rc.tripwire
  50. Source5: fsl.tripwire
  51. Patch0: tripwire.patch
  52. # build information
  53. Prefix: %{l_prefix}
  54. BuildRoot: %{l_buildroot}
  55. BuildPreReq: OpenPKG, openpkg >= 20030415, make, gcc, perl
  56. PreReq: OpenPKG, openpkg >= 20030415
  57. %if "%{with_fsl}" == "yes"
  58. BuildPreReq: fsl
  59. PreReq: fsl
  60. %endif
  61. AutoReq: no
  62. AutoReqProv: no
  63. %description
  64. Tripwire is a policy driven file system integrity checking tool that
  65. allows system administrators to verify the integrity of their data.
  66. %prep
  67. %setup -q -n tripwire-%{V_vendor}
  68. %patch -p0
  69. %build
  70. case "%{l_target}" in
  71. *-freebsd* ) syspre="i386-unknown-freebsd" ;;
  72. *-linux* ) syspre="i686-pc-linux" ;;
  73. *-solaris* ) syspre="sparc-solaris" ;;
  74. *-netbsd* ) syspre="i386-unknown-openbsd" ;;
  75. *) echo "ERROR: Unsupport platform '%{l_target}'"; exit 1 ;;
  76. esac
  77. cd src
  78. cp %{SOURCE sparc-solaris.inc} make_include/
  79. cp %{SOURCE sparc-solaris.mak} cryptlib/
  80. %{l_shtool} subst \
  81. -e '/^targets/s/STLport_r//' \
  82. Makefile
  83. touch STLport_r
  84. for f in cryptlib/*.mak make_include/*.inc; do
  85. %{l_shtool} subst \
  86. -e 's;-[IL]../STLPort[^[:blank:]]*;;' \
  87. -e 's;stlport_gcc;stdc++;' \
  88. $f
  89. done
  90. for f in *.pl; do
  91. %{l_shtool} subst \
  92. -e '1s;/usr/bin/perl;%{l_prefix}/bin/perl;' \
  93. $f
  94. done
  95. %{l_shtool} subst \
  96. -e 's;!(IS_SOLARIS && IS_IX86);0;' \
  97. tripwire/smtpmailmessage.cpp
  98. %{l_shtool} subst \
  99. -e 's;@l_prefix@;%{l_prefix};g' \
  100. core/stdcore.h
  101. %{l_shtool} subst \
  102. -e 's;<malloc\.h>;<stdlib.h>;g' \
  103. `find . -type f -print`
  104. %{l_make} %{l_mflags -O} release \
  105. CC="%{l_cc}" \
  106. CFLAGS="%{l_cflags -O}" \
  107. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  108. LIBS="%{l_fsl_libs}" \
  109. CXX="%{l_cxx}" \
  110. CXXFLAGS="%{l_cxxflags -O} -fpermissive" \
  111. CPPFLAGS="%{l_cppflags}" \
  112. GMAKE="%{l_make}" \
  113. SYSPRE="$syspre" \
  114. STLPORT="No-STLPort"
  115. %install
  116. rm -rf $RPM_BUILD_ROOT
  117. %{l_shtool} mkdir -f -p -m 755 \
  118. $RPM_BUILD_ROOT%{l_prefix}/bin \
  119. $RPM_BUILD_ROOT%{l_prefix}/etc/tripwire \
  120. $RPM_BUILD_ROOT%{l_prefix}/man/man4 \
  121. $RPM_BUILD_ROOT%{l_prefix}/man/man5 \
  122. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  123. $RPM_BUILD_ROOT%{l_prefix}/var/tripwire
  124. for f in bin/*_r/*; do
  125. %{l_shtool} install -c -s -m 755 \
  126. $f $RPM_BUILD_ROOT%{l_prefix}/bin/
  127. done
  128. %{l_shtool} install -c -m 644 \
  129. policy/twpol.txt \
  130. $RPM_BUILD_ROOT%{l_prefix}/etc/tripwire/tw.pol
  131. %{l_shtool} install -c -m 644 \
  132. policy/policyguide.txt \
  133. $RPM_BUILD_ROOT%{l_prefix}/etc/tripwire/policyguide
  134. %{l_shtool} install -c -m 644 \
  135. -e 's;@l_prefix@;%{l_prefix};g' \
  136. %{SOURCE tw.cfg} \
  137. $RPM_BUILD_ROOT%{l_prefix}/etc/tripwire/
  138. for f in man/man[458]/*.[458]; do
  139. %{l_shtool} install -c -m 644 \
  140. $f $RPM_BUILD_ROOT%{l_prefix}/$f
  141. done
  142. # install run-command script
  143. %{l_shtool} mkdir -f -p -m 755 \
  144. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  145. %{l_shtool} install -c -m 755 \
  146. -e 's;@l_prefix@;%{l_prefix};g' \
  147. -e 's;@l_susr@;%{l_susr};g' \
  148. -e 's;@l_rusr@;%{l_rusr};g' \
  149. -e 's;@l_rgrp@;%{l_rgrp};g' \
  150. %{SOURCE rc.tripwire} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  151. # install OSSP fsl configuration
  152. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  153. %{l_shtool} install -c -m 644 \
  154. -e 's;@l_prefix@;%{l_prefix};g' \
  155. %{SOURCE fsl.tripwire} \
  156. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  157. # determine installation files
  158. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  159. %{l_files_std} \
  160. '%not %dir %{l_prefix}/etc/fsl' \
  161. '%config %{l_prefix}/etc/fsl/fsl.tripwire'
  162. %files -f files
  163. %clean
  164. rm -rf $RPM_BUILD_ROOT