# Tests by default. No tests: rpmbuild -ba --define 'dotests 0' *.spec %{!?dotests: %define dotests 1} %define path_to_vi /usr/bin/vi %define path_to_sendmail /usr/sbin/sendmail Name: tripwire Version: 2.4.3.7 Release: 1 Summary: IDS (Intrusion Detection System) License: GPLv2+ Group: Applications/System Source0: http://download.sourceforge.net/tripwire/%{name}-open-source-%{version}.tar.gz #Source1: %{name}-%{version}-src.sums Source2: tripwire.cron.in Source3: twcfg.txt.in Source4: tripwire-setup-keyfiles.in Source5: twpol.txt.in URL: http://www.tripwire.org/ BuildRequires: gcc >= 8.3.0, gcc-c++ >= 8.3.0, libstdc++-devel >= 8.3.0 BuildRequires: patch, make, coreutils Requires: libgcc >= 8.3.0, libstdc++ >= 8.3.0 %description Tripwire is a very valuable security tool for Linux systems, if it is installed to a clean system. Tripwire should be installed right after the OS installation, and before you have connected your system to a network (i.e., before any possibility exists that someone could alter files on your system). When Tripwire is initially set up, it creates a database that records certain file information. Then when it is run, it compares a designated set of files and directories to the information stored in the database. Added or deleted files are flagged and reported, as are any files that have changed from their previously recorded state in the database. When Tripwire is run against system files on a regular basis, any file changes will be spotted when Tripwire is run. Tripwire will report the changes, which will give system administrators a clue that they need to enact damage control measures immediately if certain files have been altered. %prep %setup -q -n %{name}-open-source-%{version} %build export OBJECT_MODE=64 export CC=/opt/freeware/bin/gcc export CFLAGS="-DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include -maix64 -O2" export CXX=/opt/freeware/bin/g++ export CXXFLAGS=$CFLAGS export LD=ld export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib" %{__chmod} 755 configure ./configure \ path_to_vi=%{path_to_vi} \ path_to_sendmail=%{path_to_sendmail} \ --prefix=%{_prefix} \ --sysconfdir=/etc/%{name} \ --sbindir=%{_sbindir} \ --libdir=/var/lib \ --mandir=%{_mandir} gmake %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} export PATH=/opt/freeware/bin:$PATH export OBJECT_MODE=64 # Install the binaries. %{__mkdir_p} ${RPM_BUILD_ROOT}%{_sbindir} install -p -m755 bin/siggen ${RPM_BUILD_ROOT}%{_sbindir} install -p -m755 bin/tripwire ${RPM_BUILD_ROOT}%{_sbindir} install -p -m755 bin/twadmin ${RPM_BUILD_ROOT}%{_sbindir} install -p -m755 bin/twprint ${RPM_BUILD_ROOT}%{_sbindir} /usr/bin/strip ${RPM_BUILD_ROOT}%{_sbindir}/* || : # Install the man pages. %{__mkdir_p} ${RPM_BUILD_ROOT}%{_mandir}/man4 %{__mkdir_p} ${RPM_BUILD_ROOT}%{_mandir}/man5 %{__mkdir_p} ${RPM_BUILD_ROOT}%{_mandir}/man8 install -p -m644 man/man4/*.4 ${RPM_BUILD_ROOT}%{_mandir}/man4/ install -p -m644 man/man5/*.5 ${RPM_BUILD_ROOT}%{_mandir}/man5/ install -p -m644 man/man8/*.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/ # Create configuration files from templates. %{__rm} -fr _tmpcfg %{__mkdir} _tmpcfg for infile in %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} ; do outfile=${infile##/*/} outfile=${outfile%.*n} cat ${infile} |\ %{__sed} -e 's|@path_to_vi@|%{path_to_vi}|g' |\ %{__sed} -e 's|@path_to_sendmail@|%{path_to_sendmail}|g' |\ %{__sed} -e 's|@sysconfdir@|/etc|g' |\ %{__sed} -e 's|@sbindir@|%{_sbindir}|g' |\ %{__sed} -e 's|@vardir@|/var|g' >\ _tmpcfg/${outfile} done %{__mv} _tmpcfg/tripwire-setup-keyfiles . # Create the reports directory. install -d -m700 ${RPM_BUILD_ROOT}/var/lib/%{name}/report # Install the file for possible cron job integration install -p -m755 _tmpcfg/tripwire.cron \ ${RPM_BUILD_ROOT}%{_sbindir}/tripwire-check %{__rm} _tmpcfg/tripwire.cron # Install configuration files. %{__mkdir_p} ${RPM_BUILD_ROOT}/etc/%{name} for file in _tmpcfg/* ; do install -p -m644 ${file} ${RPM_BUILD_ROOT}/etc/%{name} done # Install the keyfile setup script install -p -m755 tripwire-setup-keyfiles ${RPM_BUILD_ROOT}%{_sbindir} # Fix permissions on documentation files. %{__chmod} 644 \ ChangeLog COMMERCIAL COPYING TRADEMARK \ policy/policyguide.txt %if %{dotests} %check gmake -k check || true %endif %post # Set the real hostname in twpol.txt cat /etc/%{name}/twpol.txt | \ /usr/bin/sed -e "s|localhost|$HOSTNAME|g" > /etc/%{name}/twpol.txt.tmp /usr/bin/mv -f /etc/%{name}/twpol.txt.tmp /etc/%{name}/twpol.txt %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(0644,root,system,-) %doc ChangeLog COMMERCIAL COPYING TRADEMARK %doc policy/policyguide.txt %attr(0700,root,system) %dir /etc/%{name} %config(noreplace) /etc/%{name}/twcfg.txt %config(noreplace) /etc/%{name}/twpol.txt %attr(0700,root,system) %dir /var/lib/%{name} %attr(0700,root,system) %dir /var/lib/%{name}/report %{_mandir}/man?/* %attr(0755,root,system) %{_sbindir}/* %changelog * Fri May 29 2020 Reshma V Kumar - 2.4.3.7-1 - Initial build for AIX Toolbox * Wed Nov 16 2016 Michael Perzl - 2.4.2.2-3 - recompiled against latest versions * Fri Mar 04 2016 Michael Perzl - 2.4.2.2-2 - recompiled against latest versions * Tue Nov 22 2011 Michael Perzl - 2.4.2.2-1 - updated to version 2.4.2.2 * Tue Aug 09 2011 Michael Perzl - 2.4.2.1-1 - updated to version 2.4.2.1 * Mon May 17 2010 Michael Perzl - 2.4.2-1 - first version for AIX V5.1 and higher