%define dotests 1 Summary: Antivirus Toolkit License: GPL-2.0-only Group: Productivity/Security Name: clamav Version: 0.101.2 Release: 1 Url: http://www.clamav.net Source0: https://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz Source1: http://www.clamav.net/downloads/production/%{name}-%{version}.tar.gz.sig Patch0: clamav-0.101.2-unrar.patch BuildRequires: bzip2-devel >= 1.0.6-2 BuildRequires: curl-devel >= 7.60.0-1 BuildRequires: libgcc >= 6.3.0-1 BuildRequires: libiconv >= 1.14-1 BuildRequires: json-c-devel >= 0.13.1-1 BuildRequires: openldap-devel >= 2.4.45-3 BuildRequires: xz-libs >= 5.2.3-1 BuildRequires: ncurses-devel >= 6.1-1 BuildRequires: pcre-devel >= 8.33-1 BuildRequires: cyrus-sasl-devel >= 2.1.26-3 BuildRequires: libssh2-devel >= 1.8.0-2 BuildRequires: libxml2-devel >= 2.9.5-1 BuildRequires: zlib-devel >= 1.2.11-1 Requires: bzip2 >= 1.0.6-2 Requires: curl >= 7.60.0-1 Requires: libgcc >= 6.3.0-1 Requires: libiconv >= 1.14-1 Requires: json-c >= 0.13.1-1 Requires: openldap >= 2.4.45-3 Requires: xz-libs >= 5.2.3-1 Requires: ncurses >= 6.1-1 Requires: pcre >= 8.33-1 Requires: cyrus-sasl >= 2.1.26-3 Requires: libssh2 >= 1.8.0-2 Requires: libxml2 >= 2.9.5-1 Requires: zlib >= 1.2.11-1 Requires: libstdc++ >= 6.3.0 %define _libdir64 %{_libdir}64 %description ClamAV is an antivirus engine designed for detecting trojans, viruses, malware and other malicious threats. It is the de-facto standard for mail gateway scanning. It provides a multi-threaded scanning daemon, command line utilities for on-demand file scanning, and a tool for automatic signature updates. The core ClamAV library provides numerous file format detection mechanisms, file unpacking support, archive support, and multiple signature languages for detecting threats. %package devel Summary: Header files and libraries for the Clam Antivirus scanner Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel This package contains headerfiles and libraries which are needed to build applications using clamav. %prep %setup -q %patch0 -p1 #This is removed due to legal issue. The files in this directory are for windows and will not be used for building. rm -rf win32 rm -rf /tmp/%{name}-%{version}-32bit cp -pr . /tmp/%{name}-%{version}-32bit rm -fr * mv /tmp/%{name}-%{version}-32bit 32bit cp -pr 32bit 64bit %build export CC="/opt/freeware/bin/gcc" # build on 64bit mode cd 64bit export OBJECT_MODE=64 export CFLAGS="-O2 -maix64" export CXXFLAGS="-O2 -maix64" export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib" #Adding -lbsd in LDFLAGS results in a testcase failure. export LIBS="-lbsd" ./configure --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --mandir=%{_mandir} \ --sysconfdir=%{_sysconfdir} \ --with-xml=%{_prefix} \ --with-pcre=%{_prefix} \ --with-zlib=%{_prefix} \ --with-libbz2-prefix=%{_prefix} \ --with-iconv \ --with-libncurses-prefix=%{_prefix} \ --with-libcurl=%{_prefix} \ --with-libjson=%{_prefix} \ --with-dbdir=/var/lib/clamav gmake V=1 if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi # build on 32bit mode cd ../32bit export OBJECT_MODE=32 export CFLAGS="-O2 -maix32 -D_LARGE_FILES" export CXXFLAGS="-O2 -maix32 -D_LARGE_FILES" export LDFLAGS="-L/opt/freeware/lib -lcurl -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure --prefix=%{_prefix} \ --libdir=%{_libdir} \ --mandir=%{_mandir} \ --sysconfdir=%{_sysconfdir} \ --with-xml=%{_prefix} \ --with-pcre=%{_prefix} \ --with-zlib=%{_prefix} \ --with-libbz2-prefix=%{_prefix} \ --with-iconv \ --with-libncurses-prefix=%{_prefix} \ --with-libcurl=%{_prefix} \ --with-libjson=%{_prefix} \ --with-dbdir=/var/lib/clamav gmake V=1 if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} # install on 64bit mode export OBJECT_MODE=64 cd 64bit gmake DESTDIR=${RPM_BUILD_ROOT} install ( cd ${RPM_BUILD_ROOT}/%{_prefix}/bin for fic in $(ls -1| grep -v -e _32 -e _64) do mv $fic "$fic"_64 done cd ${RPM_BUILD_ROOT}/%{_prefix}/sbin for fic in $(ls -1| grep -v -e _32 -e _64) do mv $fic "$fic"_64 done ) # install on 32bit mode export OBJECT_MODE=32 cd ../32bit gmake DESTDIR=${RPM_BUILD_ROOT} install ( cd ${RPM_BUILD_ROOT}/%{_prefix}/bin for fic in $(ls -1| grep -v -e _32 -e _64) do mv $fic "$fic"_32 ln -sf "$fic"_64 $fic done cd ${RPM_BUILD_ROOT}/%{_prefix}/sbin for fic in $(ls -1| grep -v -e _32 -e _64) do mv $fic "$fic"_32 ln -sf "$fic"_64 $fic done ) mkdir -p ${RPM_BUILD_ROOT}/var/lib/%{name} slibclean /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}/%{_libdir}/libclamav.a ../64bit/libclamav/.libs/libclamav.so.9 /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}/%{_libdir}/libclamunrar.a ../64bit/libclamav/.libs/libclamunrar.so.9 /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}/%{_libdir}/libclamunrar_iface.a ../64bit/libclamav/.libs/libclamunrar_iface.so.9 /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}/%{_libdir}/libclammspack.a ../64bit/libclamav/.libs/libclammspack.so.0 /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* || : %files %defattr(-, root, system) %{_bindir}/* %{_sbindir}/* %{_libdir64}/*.a %{_libdir}/*.a %{_includedir}/* %{_mandir}/*/* %{_sysconfdir}/* %dir /var/lib/%{name} %files devel %defattr(-, root, system) %{_libdir64}/pkgconfig/* %{_libdir}/pkgconfig/* %{_includedir}/* %changelog * Wed Jun 19 2019 Reshma V Kumar - 0.101.2-1 - Update to latest version * Sun Dec 16 2018 Reshma V Kumar 0.100.2-1 - First time port for AIX toolbox