Quote:
From where? Official site or elsewhere?
|
Official site, of course.
Thanks for the tip... since I've installed and updated all the software so far using yum, I very rarely came across the need to build an .rpm
Quote:
%setup should work in the directory "$RPM_BUILD_ROOT/lynis-1.1.5" (since that's the root of the tarball). An error in the spec (post it?).
|
The .spec file content:
##################################################################
#
# Lynis spec file
#
# Usage:
# - Adjust version number (Version
# - rpmbuild -ba lynis.spec
#
##################################################################
%define _includedir /usr/share/lynis/include
%define _pluginsdir /usr/share/lynis/plugins
%define _dbdir /usr/share/lynis/db
%define _bindir /usr/bin
Summary: Security and system auditing tool.
Name: lynis
Version: 1.1.5
Release: 1
License: GPL
Group: Applications/System
Source: lynis-%{version}.tar.gz
BuildRoot: /tmp/lynis-root
URL:
http://www.rootkit.nl/
Vendor: Michael Boelen
Packager: Michael Boelen <michael@rootkit.nl>
BuildArch: noarch
%description
Lynis is a security and system auditing tool. It scans a system on the
most interesting parts useful for audits, like:
- Security enhancements
- Logging and auditing options
- Banner identification
- Software availability
Lynis is released as a GPL licensed project and free for everyone to use.
See
http://www.rootkit.nl for a full description and documentation.
%prep
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
mkdir $RPM_BUILD_ROOT
# Make directory with our name, instead of with version
%setup -n lynis
#%patch
%build
%install
# Install profile
install -d ${RPM_BUILD_ROOT}/etc/lynis
install default.prf ${RPM_BUILD_ROOT}/etc/lynis
# Install binary
install -d ${RPM_BUILD_ROOT}/%{_bindir}
install lynis ${RPM_BUILD_ROOT}/%{_bindir}
# Install man page
install -d ${RPM_BUILD_ROOT}/%{_mandir}/man8
install lynis.8 ${RPM_BUILD_ROOT}/%{_mandir}/man8
# Install functions/includes
install -d ${RPM_BUILD_ROOT}%{_includedir}
install include/* ${RPM_BUILD_ROOT}%{_includedir}
# Install plugins
install -d ${RPM_BUILD_ROOT}%{_pluginsdir}
install plugins/* ${RPM_BUILD_ROOT}%{_pluginsdir}
# Install database files
install -d ${RPM_BUILD_ROOT}%{_dbdir}
install db/* ${RPM_BUILD_ROOT}%{_dbdir}
# Patch default paths (not required for 1.1.2+)
#sed -i -e 's#INCLUDEDIR="include"#INCLUDEDIR="%{_includedir}"#g' ${RPM_BUILD_ROOT}/usr/bin/lynis
#sed -i -e 's#PROFILE="default.prf"#PROFILE="/etc/lynis/default.prf"#g' ${RPM_BUILD_ROOT}/usr/bin/lynis
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
%files
%defattr(-,root,root)
# Binaries
%{_bindir}/lynis
# Man page and docs
%doc CHANGELOG FAQ LICENSE README TODO
%doc %{_mandir}/man8/lynis.8.gz
# Default profile
/etc/lynis/default.prf
# Databases, functions, plugins
%{_db}/*
%{_includedir}/*
%{_pluginsdir}/*
%changelog
* Sat May 31 2008 Michael Boelen - 1.1.4-1
- Added _dbdir
* Sun May 11 2008 Michael Boelen - 1.1.2-1
- Added _pluginsdir, disabled patches
* Sat Mar 08 2008 Michael Boelen - 1.0.8-1
- initial .spec file
Quote:
Please don't say "didn't work" but provide commandline and (error) output instead.
|
Sorry about this... It's been a while since I've tried this, not just before posting a problem here. I figured, I'll send the output if the first way of building a package doesn't work eventually.