You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
165 lines
5.5 KiB
165 lines
5.5 KiB
## |
|
## sav.spec -- OpenPKG RPM Specification |
|
## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/> |
|
## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com> |
|
## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/> |
|
## |
|
## Permission to use, copy, modify, and distribute this software for |
|
## any purpose with or without fee is hereby granted, provided that |
|
## the above copyright notice and this permission notice appear in all |
|
## copies. |
|
## |
|
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
|
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
|
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
|
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
|
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
|
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
|
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
## SUCH DAMAGE. |
|
## |
|
|
|
# package version |
|
%define V_engine 2.18 |
|
%define V_ides 3.78 |
|
|
|
# package information |
|
Name: sav |
|
Summary: Sophos Anti-Virus |
|
URL: http://www.sophos.com/products/sav/ |
|
Vendor: Sophos Plc. |
|
Packager: The OpenPKG Project |
|
Distribution: OpenPKG [EVAL] |
|
Group: System |
|
License: Commercial/Free-Trial |
|
Version: %{V_engine}+%{V_ides} |
|
Release: 20040127 |
|
|
|
# list of sources |
|
Source0: http://downloads.sophos.com/dp/full/freebsd.elf.tar.Z |
|
Source1: http://downloads.sophos.com/dp/full/linux.intel.libc6.tar.Z |
|
Source2: http://downloads.sophos.com/dp/full/solaris.sparc.tar.Z |
|
Source3: rc.sav |
|
Source4: sav.conf |
|
Source5: sweep.sh |
|
Source6: sweep.c |
|
Source7: sweep.mk |
|
%NoSource 0 |
|
%NoSource 1 |
|
%NoSource 2 |
|
|
|
# build information |
|
Prefix: %{l_prefix} |
|
BuildRoot: %{l_buildroot} |
|
BuildPreReq: OpenPKG, openpkg >= 20031117, gcc |
|
PreReq: OpenPKG, openpkg >= 20031117, curl, infozip |
|
AutoReq: no |
|
AutoReqProv: no |
|
|
|
%description |
|
This is the free-trail version of the Sophos Anti-Virus virus |
|
scanner for Unix. |
|
|
|
%prep |
|
%setup -q -T -c |
|
|
|
# select and decompress platform specific anti-virus engine |
|
case "%{l_platform -t}" in |
|
*-freebsd* ) engine="%{SOURCE freebsd.elf.tar.Z}" ;; |
|
*-linux* ) engine="%{SOURCE linux.intel.libc6.tar.Z}" ;; |
|
*-sunos* ) engine="%{SOURCE solaris.sparc.tar.Z}" ;; |
|
* ) echo "Sorry, platform %{l_platform -t} not supported" 1>&2; exit 1 ;; |
|
esac |
|
%{l_gzip} -d -c $engine | %{l_tar} xf - |
|
|
|
%build |
|
# build open(2) wrapper DSO |
|
# (for mapping hard-coded /etc/sav.conf to %{l_prefix}/etc/sav/sav.conf) |
|
%{l_shtool} install -c -m 644 %{l_value -s -a} \ |
|
%{SOURCE sweep.c} %{SOURCE sweep.mk} ./ |
|
case "%{l_platform -t}" in |
|
*-freebsd* ) target="freebsd" ;; |
|
*-linux* ) target="linux" ;; |
|
*-sunos* ) target="solaris" ;; |
|
esac |
|
%{l_make} %{l_mflags} -f sweep.mk $target |
|
|
|
%install |
|
rm -rf $RPM_BUILD_ROOT |
|
|
|
# create directory structure |
|
%{l_shtool} mkdir -f -p -m 755 \ |
|
$RPM_BUILD_ROOT%{l_prefix}/bin \ |
|
$RPM_BUILD_ROOT%{l_prefix}/etc/sav \ |
|
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ |
|
$RPM_BUILD_ROOT%{l_prefix}/lib/sav \ |
|
$RPM_BUILD_ROOT%{l_prefix}/libexec/sav \ |
|
$RPM_BUILD_ROOT%{l_prefix}/man/man1 \ |
|
$RPM_BUILD_ROOT%{l_prefix}/var/sav/data |
|
|
|
# install open(2) wrapper library |
|
%{l_shtool} install -c -m 755 \ |
|
sweep.so \ |
|
$RPM_BUILD_ROOT%{l_prefix}/libexec/sav/ |
|
|
|
# install binary wrapper script |
|
%{l_shtool} install -c -m 755 %{l_value -s -a} \ |
|
%{SOURCE sweep.sh} \ |
|
$RPM_BUILD_ROOT%{l_prefix}/bin/sweep |
|
|
|
# install run-command script |
|
%{l_shtool} install -c -m 755 %{l_value -s -a} \ |
|
%{SOURCE rc.sav} \ |
|
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
|
|
|
# install default configuration |
|
%{l_shtool} install -c -m 644 %{l_value -s -a} \ |
|
%{SOURCE sav.conf} \ |
|
$RPM_BUILD_ROOT%{l_prefix}/etc/sav/ |
|
|
|
# install SAVI library and add compatibility links |
|
%{l_shtool} install -c -m 755 \ |
|
sav-install/libsavi.so* \ |
|
$RPM_BUILD_ROOT%{l_prefix}/lib/sav/ |
|
( cd $RPM_BUILD_ROOT%{l_prefix}/lib/sav |
|
%{l_shtool} mkln -s -f libsavi.so.3.* libsavi.so.3 |
|
%{l_shtool} mkln -s -f libsavi.so.3.* libsavi.so |
|
) || exit $? |
|
|
|
# install original binary |
|
%{l_shtool} install -c -m 755 \ |
|
sav-install/sweep \ |
|
$RPM_BUILD_ROOT%{l_prefix}/libexec/sav/sweep |
|
|
|
# install man page |
|
%{l_shtool} install -c -m 644 \ |
|
sav-install/sweep.1 \ |
|
$RPM_BUILD_ROOT%{l_prefix}/man/man1/ |
|
|
|
# install virus description and identity files |
|
%{l_shtool} install -c -m 644 \ |
|
sav-install/vdl-%{V_ides}.dat \ |
|
$RPM_BUILD_ROOT%{l_prefix}/var/sav/data/vdl.dat |
|
%{l_shtool} install -c -m 644 \ |
|
sav-install/vdl*.vdb \ |
|
$RPM_BUILD_ROOT%{l_prefix}/var/sav/data/ |
|
|
|
# install message catalog |
|
%{l_shtool} install -c -m 644 \ |
|
sav-install/swpmess.dat \ |
|
$RPM_BUILD_ROOT%{l_prefix}/var/sav/data/ |
|
|
|
# determine installation files |
|
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
|
%{l_files_std} \ |
|
'%config %{l_prefix}/etc/sav/*' |
|
|
|
%files -f files |
|
|
|
%clean |
|
rm -rf $RPM_BUILD_ROOT |
|
|
|
|