Browse Source

builds on FreeBSD,Linux,Solaris. Added manpages, config files, policyguide

Michael van Elst 23 years ago
parent
commit
bba54f99c0
5 changed files with 300 additions and 5 deletions
  1. 47 0
      tripwire/sparc-solaris.inc
  2. 138 0
      tripwire/sparc-solaris.mak
  3. 55 0
      tripwire/tripwire.patch
  4. 35 5
      tripwire/tripwire.spec
  5. 25 0
      tripwire/tw.cfg

+ 47 - 0
tripwire/sparc-solaris.inc

@@ -0,0 +1,47 @@
+#
+# sparc-linux.inc
+#
+# Makefile definitions for Linux Intel, Redhat executables and libraries
+# Modified to use gcc 2.95.2  and STLport 4.0 beta 5
+#
+LIBDIR=../../lib
+LIBPRE=$(LIBDIR)/$(SYSPRE)
+
+BINDIR=../../bin
+BINPRE=$(BINDIR)/$(SYSPRE)
+
+#
+# General variable definitions
+#
+
+GMAKE = /usr/bin/gmake
+CC = g++
+CXX = $(CC)
+AR = ar
+SYSDEF=-D_SOLARIS -D_UNIX -D_SPARC -D_GCC
+STLPORT=../STLport-4.0b5
+
+#
+# release flags
+#
+
+CXXFLAGS_R = -I.. -I$(STLPORT)/stlport
+DEFINES_R = -DNDEBUG $(SYSDEF)
+LINKFLAGS_R =
+LIBRARYFLAGS_R = -L$(STLPORT)/lib -lm -lstlport_gcc -lsocket -lnsl
+ARFLAGS_R = crv
+
+#
+# debug flags
+#
+
+CXXFLAGS_D = -I.. -I$(STLPORT)/stlport -g
+DEFINES_D = -D_DEBUG -D_DEBUG_DB $(SYSDEF)
+LINKFLAGS_D =
+LIBRARYFLAGS_D = -L$(STLPORT)/lib -lm -lstlport_gcc -lsocket -lnsl -lw
+
+#
+# depend flags
+#
+
+DEPEND_FLAGS = -M -w -I.. -I$(STLPORT)/stlport -DNDEBUG $(SYSDEF)

+ 138 - 0
tripwire/sparc-solaris.mak

@@ -0,0 +1,138 @@
+###############################################################################
+# crypto++ library makefile
+# "sparc-solaris.mak"
+#
+# Use the targets 'debug' and 'release' to build this library.
+# Be sure to 'make clean' when switching between debug and release modes.
+#
+#
+# include a null char so VSS treats this as a binary file --> " #"
+#
+
+# -----------------------------------------------------------------
+# ----------------- BEGIN CONFIGURABLE DEFINES --------------------
+
+# ---------------------------
+# --- Makefile --------------
+# ---------------------------
+# Change this if the name of this makefile changes, i.e. when porting
+SYSPRE = sparc-solaris
+MAKEFILE = $(SYSPRE).mak
+
+# ---------------------------
+# --- Program definitions ---
+# ---------------------------
+# 
+CC = g++
+CXX = $(CC)
+AR = ar crv
+RANLIB = ranlib
+
+# ----------------------------
+# --- Platform definitions ---
+# ----------------------------
+SOLARIS_SPARC = -D_SOLARIS -D_UNIX -D_SPARC -D_GCC
+
+# Set platform to one of the above definitions
+PLATFORM = $(SOLARIS_SPARC)
+ 
+DEBUG_FLAGS = -g -D_DEBUG
+NDEBUG_FLAGS = -DNDEBUG
+OFLAGS =  
+MAKE_FLAGS = -M
+
+# Note: D_FLAGS will be set in the "debug" or "release" target
+D_FLAGS = !!!ERROR!!!
+LD_FLAGS = !!!ERROR!!!
+
+# ----------------------
+# --- Compiler flags ---
+# ----------------------
+
+# The crypto++ web page says that 3.2 builds properly with gcc 2.95.2 (without any STL help), so
+# linking with STLport here is probably unnecessary.  We haven't tested it though, so
+# we'll leave it the way it is for now.
+CXXFLAGS = $(PLATFORM) $(D_FLAGS) -w -I../STLport-4.0/stlport
+DEBUG_LDFLAGS = -L../../lib/$(SYSPRE)_d -lstlport_gcc
+NDEBUG_LDFLAGS = -L../../lib/$(SYSPRE)_r -lstlport_gcc
+
+# ----------------- END OF CONFIGURABLE DEFINES --------------------
+# ------------------------------------------------------------------
+
+
+SRCS = $(wildcard *.cpp)
+OBJS = $(SRCS:.cpp=.o)
+TESTOBJS = test.o bench.o validat1.o validat2.o validat3.o
+LIBOBJS = $(filter-out $(TESTOBJS), $(OBJS))
+
+###############################################################################
+# Debug/Release targets
+#
+# Recusively call make defining the appropriate $(D_FLAGS) var
+
+debug:
+	gmake -f $(MAKEFILE) cryptlib_d.a "D_FLAGS=$(DEBUG_FLAGS)" "LDFLAGS=DEBUG_LDFLAGS"
+#	gmake -f $(MAKEFILE) cryptest_d "D_FLAGS=$(DEBUG_FLAGS)" "LDFLAGS=DEBUG_LDFLAGS"
+
+release: 
+	gmake -f $(MAKEFILE) cryptlib.a "D_FLAGS=$(NDEBUG_FLAGS)" "LDFLAGS=NDEBUG_LDFLAGS"
+#	gmake -f $(MAKEFILE) cryptest "D_FLAGS=$(NDEBUG_FLAGS)" "LDFLAGS=NDEBUG_LDFLAGS"
+
+ 
+###############################################################################
+# make cryptlib.a
+
+cryptlib.a: $(LIBOBJS)
+	- rm -f $@
+	$(AR) $@ $(LIBOBJS)
+
+cryptlib_d.a: $(LIBOBJS)
+	- rm -f $@
+	$(AR) $@ $(LIBOBJS)
+
+###############################################################################
+# make crypttest
+
+cryptest: $(TESTOBJS) cryptlib.a
+	$(CXX) -o $@ $(NDEBUG_FLAGS) $(TESTOBJS) cryptlib.a $(NDEBUG_LDFLAGS) -lm
+
+cryptest_d: $(TESTOBJS) cryptlib_d.a
+	$(CXX) -o $@ $(DEBUG_FLAGS) $(TESTOBJS) cryptlib_d.a $(DEBUG_LDFLAGS) -lm
+
+###############################################################################
+# other makes
+
+all: cryptlib.a cryptest 
+ 
+clean:
+	- rm -f $(OBJS) 
+	- rm -f crypto++.$(SYSPRE).dep
+
+clobber: clean
+	- rm -f cryptlib.a cryptlib_d.a
+	- rm -f cryptest cryptest_d
+ 
+.SUFFIXES: .cpp
+ 
+.cpp.o:
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(PLATFORM) $(DEBUG) -c $<
+
+###############################################################################
+# make depends
+
+depend: crypto++.$(SYSPRE).dep
+
+crypto++.$(SYSPRE).dep: $(SRCS)
+	${CC} ${MAKE_FLAGS} ${PLATFORM} ${NDEBUG_FLAGS} *.cpp > crypto++.$(SYSPRE).dep
+
+# Do not Delete
+
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),clobber)
+
+include crypto++.$(SYSPRE).dep
+
+endif
+endif
+
+# Do not Delete

+ 55 - 0
tripwire/tripwire.patch

@@ -284,3 +284,58 @@
  	
  	
  	size_t numChars = _tcsftime( szDate, countof( szDate ), szFormat, tm );
  	size_t numChars = _tcsftime( szDate, countof( szDate ), szFormat, tm );
  	
  	
+--- src/core/stdcore.h.dist	Tue Jan 28 14:10:57 2003
++++ src/core/stdcore.h	Tue Jan 28 16:30:56 2003
+@@ -46,6 +46,9 @@
+ #include "platform.h"
+ 
+ //--Where the configuration file is to be found
++#if 0
++#define CONFIG_FILE_ROOT    "@l_prefix@/etc/tripwire"
++#else
+ #if IS_BSD
+ # define CONFIG_FILE_ROOT	"/usr/local/etc/tripwire"
+ #elif defined(USE_FHS)
+@@ -53,6 +56,7 @@
+ #else
+ # undef CONFIG_FILE_ROOT	// Nowhere, just try current directoy
+ #endif
++#endif
+ 
+ //--Disable some level 4 warnings
+ 
+--- src/core/platform.h.dist	Tue Jan 28 15:39:55 2003
++++ src/core/platform.h	Tue Jan 28 15:42:30 2003
+@@ -128,10 +128,18 @@
+ #elif defined(_SOLARIS)
+     #define OS                  OS_SOLARIS
+     #if defined(_IX86)
+-        #define COMP            COMP_SUNPRO
++        #if defined(_GCC)
++            #define COMP            COMP_GCC
++        #else
++            #define COMP            COMP_SUNPRO
++        #endif
+         #define ARCH            ARCH_IX86
+     #else
+-        #define COMP            COMP_KAI_SUNPRO
++        #if defined(_GCC)
++            #define COMP            COMP_GCC
++        #else
++            #define COMP            COMP_KAI_SUNPRO
++        #endif
+         #define ARCH            ARCH_SPARC
+     #endif
+ 
+--- src/tw/twstrings.cpp.dist	Tue Jan 28 15:58:00 2003
++++ src/tw/twstrings.cpp	Tue Jan 28 15:59:22 2003
+@@ -258,6 +258,9 @@
+ #elif IS_BSD
+ 		TSS_StringEntry( tw::STR_VERSION,       TSS_PRODUCT_NAME BUILD_NUM UNICODE_STR DEBUG_STR _T(" for BSD\n\n") TSS_COPYRIGHT_NOTICE  ),
+ 		TSS_StringEntry( tw::STR_VERSION_LONG,  TSS_PRODUCT_NAME BUILD_NUM UNICODE_STR DEBUG_STR _T(" for BSD\n\n") TSS_COPYRIGHT_NOTICE_LONG  ),
++#elif IS_SOLARIS
++		TSS_StringEntry( tw::STR_VERSION,       TSS_PRODUCT_NAME BUILD_NUM UNICODE_STR DEBUG_STR _T(" for SOLARIS\n\n") TSS_COPYRIGHT_NOTICE  ),
++		TSS_StringEntry( tw::STR_VERSION_LONG,  TSS_PRODUCT_NAME BUILD_NUM UNICODE_STR DEBUG_STR _T(" for SOLARIS\n\n") TSS_COPYRIGHT_NOTICE_LONG  ),
+ #else
+ #	error Who the hell am I?
+ #endif

+ 35 - 5
tripwire/tripwire.spec

@@ -39,10 +39,13 @@ Distribution: OpenPKG [EVAL]
 Group:        Security
 Group:        Security
 License:      GPL
 License:      GPL
 Version:      %{V_openpkg}
 Version:      %{V_openpkg}
-Release:      20030127
+Release:      20030128
 
 
 #   list of sources
 #   list of sources
 Source0:      http://osdn.dl.sourceforge.net/sourceforge/tripwire/tripwire-%{V_vendor}.tar.gz
 Source0:      http://osdn.dl.sourceforge.net/sourceforge/tripwire/tripwire-%{V_vendor}.tar.gz
+Source1:      tw.cfg
+Source2:      sparc-solaris.inc
+Source3:      sparc-solaris.mak
 Patch0:       tripwire.patch
 Patch0:       tripwire.patch
 
 
 #   build information
 #   build information
@@ -65,11 +68,13 @@ AutoReqProv:  no
     case "%{l_target}" in
     case "%{l_target}" in
         *-freebsd* ) syspre="i386-unknown-freebsd" ;;
         *-freebsd* ) syspre="i386-unknown-freebsd" ;;
         *-linux*   ) syspre="i686-pc-linux"        ;;
         *-linux*   ) syspre="i686-pc-linux"        ;;
-        *-solaris* ) syspre="sparc-linux"          ;;
+        *-solaris* ) syspre="sparc-solaris"        ;;
         *-netbsd*  ) syspre="i386-unknown-openbsd" ;;
         *-netbsd*  ) syspre="i386-unknown-openbsd" ;;
         *) echo "ERROR: Unsupport platform '%{l_target}'"; exit 1 ;;
         *) echo "ERROR: Unsupport platform '%{l_target}'"; exit 1 ;;
     esac
     esac
     cd src
     cd src
+    cp %{SOURCE sparc-solaris.inc} make_include/
+    cp %{SOURCE sparc-solaris.mak} cryptlib/
     %{l_shtool} subst \
     %{l_shtool} subst \
         -e '/^targets/s/STLport_r//' \
         -e '/^targets/s/STLport_r//' \
         Makefile
         Makefile
@@ -88,6 +93,9 @@ AutoReqProv:  no
     %{l_shtool} subst \
     %{l_shtool} subst \
         -e 's;!(IS_SOLARIS && IS_IX86);0;' \
         -e 's;!(IS_SOLARIS && IS_IX86);0;' \
         tripwire/smtpmailmessage.cpp
         tripwire/smtpmailmessage.cpp
+    %{l_shtool} subst \
+        -e 's;@l_prefix@;%{l_prefix};g' \
+        core/stdcore.h
     %{l_make} %{l_mflags -O} release \
     %{l_make} %{l_mflags -O} release \
         CC="%{l_cc}" \
         CC="%{l_cc}" \
         CFLAGS="%{l_cflags -O}" \
         CFLAGS="%{l_cflags -O}" \
@@ -102,12 +110,34 @@ AutoReqProv:  no
 %install
 %install
     rm -rf $RPM_BUILD_ROOT
     rm -rf $RPM_BUILD_ROOT
     %{l_shtool} mkdir -p -m 755 \
     %{l_shtool} mkdir -p -m 755 \
-        $f $RPM_BUILD_ROOT%{l_prefix}/bin
+        $RPM_BUILD_ROOT%{l_prefix}/bin
+    %{l_shtool} mkdir -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/tripwire
+    %{l_shtool} mkdir -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/share/man/man4 \
+        $RPM_BUILD_ROOT%{l_prefix}/share/man/man5 \
+        $RPM_BUILD_ROOT%{l_prefix}/share/man/man8
+    %{l_shtool} mkdir -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/var/tripwire
+
     for f in bin/*_r/*; do
     for f in bin/*_r/*; do
-        %{l_shtool} install -c -m 755 \
+        %{l_shtool} install -c -s -m 755 \
             $f $RPM_BUILD_ROOT%{l_prefix}/bin/
             $f $RPM_BUILD_ROOT%{l_prefix}/bin/
     done
     done
-    strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
+    %{l_shtool} install -c -m 644 \
+        policy/twpol.txt \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/tripwire/tw.pol
+    %{l_shtool} install -c -m 644 \
+        policy/policyguide.txt \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/tripwire/policyguide
+    %{l_shtool} install -c -m 644 \
+            -e 's;@l_prefix@;%{l_prefix};g' \
+            %{SOURCE tw.cfg} \
+            $RPM_BUILD_ROOT%{l_prefix}/etc/tripwire
+    for f in man/man[458]/*.[458]; do
+        %{l_shtool} install -c -m 644 \
+            $f $RPM_BUILD_ROOT%{l_prefix}/share/$f
+    done
     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
 
 
 %files -f files
 %files -f files

+ 25 - 0
tripwire/tw.cfg

@@ -0,0 +1,25 @@
+# HOSTNAME/DATE are predefined
+#
+POLFILE                = @l_prefix@/etc/tripwire/tw.pol
+DBFILE                 = @l_prefix@/var/tripwire/$(HOSTNAME).twd
+REPORTFILE             = @l_prefix@/var/tripwire/$(HOSTNAME)-$(DATE).twr
+SITEKEYFILE            = @l_prefix@/etc/tripwire/site.key
+LOCALKEYFILE           = @l_prefix@/etc/tripwire/$(HOSTNAME)-local.key
+#
+EDITOR                 = /bin/vi
+TEMPDIRECTORY          = /tmp
+GLOBALEMAIL            =
+LATEPROMPTING          = false
+LOOSEDIRECTORYCHECKING = false
+SYSLOGREPORTING        = true
+REPORTLEVEL            = 3
+#
+#MAILMETHOD             = SMTP
+#SMTPHOST               = mailhost
+#SMTPPORT               = 25
+#
+MAILMETHOD             = SENDMAIL
+MAILPROGRAM            = @l_prefix@/sbin/sendmail -oi -t
+EMAILREPORTLEVEL       = 3
+MAILNOVIOLATIONS       = true
+#