tripwire.spec 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. ##
  2. ## tripwire.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 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. # 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: 20030918
  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 >= 20030909, make, gcc, perl
  56. PreReq: OpenPKG, openpkg >= 20030909
  57. %if "%{with_fsl}" == "yes"
  58. BuildPreReq: fsl >= 1.2.0
  59. PreReq: fsl >= 1.2.0
  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_platform -t}" in
  71. *-freebsd* ) syspre="i386-unknown-freebsd" ;;
  72. *-linux* ) syspre="i686-pc-linux" ;;
  73. *-sunos* ) syspre="sparc-sunos" ;;
  74. *-netbsd* ) syspre="i386-unknown-openbsd" ;;
  75. *) echo "ERROR: Unsupport platform '%{l_platform -t}'"; 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 %{l_value -s -a} \
  99. core/stdcore.h
  100. %{l_shtool} subst \
  101. -e 's;<malloc\.h>;<stdlib.h>;g' \
  102. `find . -type f -print`
  103. %{l_make} %{l_mflags -O} release \
  104. CC="%{l_cc}" \
  105. CFLAGS="%{l_cflags -O}" \
  106. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  107. LIBS="%{l_fsl_libs}" \
  108. CXX="%{l_cxx}" \
  109. CXXFLAGS="%{l_cxxflags -O} -fpermissive" \
  110. CPPFLAGS="%{l_cppflags}" \
  111. GMAKE="%{l_make}" \
  112. SYSPRE="$syspre" \
  113. STLPORT="No-STLPort"
  114. %install
  115. rm -rf $RPM_BUILD_ROOT
  116. %{l_shtool} mkdir -f -p -m 755 \
  117. $RPM_BUILD_ROOT%{l_prefix}/bin \
  118. $RPM_BUILD_ROOT%{l_prefix}/etc/tripwire \
  119. $RPM_BUILD_ROOT%{l_prefix}/man/man4 \
  120. $RPM_BUILD_ROOT%{l_prefix}/man/man5 \
  121. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  122. $RPM_BUILD_ROOT%{l_prefix}/var/tripwire
  123. for f in bin/*_r/*; do
  124. %{l_shtool} install -c -s -m 755 \
  125. $f $RPM_BUILD_ROOT%{l_prefix}/bin/
  126. done
  127. %{l_shtool} install -c -m 644 \
  128. policy/twpol.txt \
  129. $RPM_BUILD_ROOT%{l_prefix}/etc/tripwire/tw.pol
  130. %{l_shtool} install -c -m 644 \
  131. policy/policyguide.txt \
  132. $RPM_BUILD_ROOT%{l_prefix}/etc/tripwire/policyguide
  133. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  134. %{SOURCE tw.cfg} \
  135. $RPM_BUILD_ROOT%{l_prefix}/etc/tripwire/
  136. for f in man/man[458]/*.[458]; do
  137. %{l_shtool} install -c -m 644 \
  138. $f $RPM_BUILD_ROOT%{l_prefix}/$f
  139. done
  140. # install run-command script
  141. %{l_shtool} mkdir -f -p -m 755 \
  142. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  143. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  144. %{SOURCE rc.tripwire} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  145. # install OSSP fsl configuration
  146. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  147. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  148. %{SOURCE fsl.tripwire} \
  149. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  150. # determine installation files
  151. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  152. %{l_files_std} \
  153. '%not %dir %{l_prefix}/etc/fsl' \
  154. '%config %{l_prefix}/etc/fsl/fsl.tripwire'
  155. %files -f files
  156. %clean
  157. rm -rf $RPM_BUILD_ROOT