%define dotests 1 Summary: Antivirus Toolkit License: GPL-2.0-only Group: Productivity/Security Name: clamav Version: 0.104.2 Release: 2 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.104.2-unrar.patch Patch1: clamav-0.104.2-aix.patch Patch2: clamav-0.104.2-libresolv-aix.patch Patch3: clamav-0.104.2-fmap.patch BuildRequires: bzip2-devel >= 1.0.8-2 BuildRequires: curl-devel >= 7.67.0 BuildRequires: libgcc >= 8.3.0 BuildRequires: libiconv >= 1.16-1 BuildRequires: json-c-devel >= 0.13.1 BuildRequires: openldap-devel >= 2.4.48 BuildRequires: xz-libs >= 5.2.4-1 BuildRequires: ncurses-devel >= 6.2-1 BuildRequires: pcre-devel >= 8.44-2 BuildRequires: cyrus-sasl-devel >= 2.1.26 BuildRequires: libssh2-devel >= 1.8.2 BuildRequires: libxml2-devel >= 2.9.10-1 BuildRequires: zlib-devel >= 1.2.11-2 BuildRequires: krb5-libs >= 1.16.1-5 BuildRequires: libtool-ltdl >= 2.4.6 BuildRequires: cmake >= 3.14.3 Requires: bzip2 >= 1.0.8-2 Requires: curl >= 7.67.0 Requires: libgcc >= 8.3.0 Requires: libiconv >= 1.16-1 Requires: json-c >= 0.13.1 Requires: openldap >= 2.4.48 Requires: xz-libs >= 5.2.4-1 Requires: ncurses >= 6.2-1 Requires: pcre >= 8.44-2 Requires: cyrus-sasl >= 2.1.26 Requires: libssh2 >= 1.8.2 Requires: libxml2 >= 2.9.10-1 Requires: zlib >= 1.2.11-2 Requires: libstdc++ >= 8.3.0 Requires: krb5-libs >= 1.16.1-5 Requires: libtool-ltdl >= 2.4.6 %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 %patch1 %patch2 %patch3 #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 # build on 64bit mode cd 64bit export CC="/opt/freeware/bin/gcc -pthread -maix64 -O2" export CXX="/opt/freeware/bin/g++ -pthread -maix64 -O2" export OBJECT_MODE=64 export CFLAGS="-I`pwd`/include -I/opt/freeware/include -I/usr/include" export CXXFLAGS="-I`pwd`/include -I/opt/freeware/include -I/usr/include" export CPPFLAGS="-I`pwd`/include -I/opt/freeware/include -I/usr/include" export LDFLAGS="-lm -liconv -lxml2 -lbz2 -lcurl -lncurses -lbsd -L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib" cmake . \ -D CMAKE_INSTALL_PREFIX=/opt/freeware \ -D CMAKE_INSTALL_LIBDIR=/opt/freeware/lib64 \ -D CMAKE_INSTALL_FULL_SBINDIR=/opt/freeware/sbin \ -D CMAKE_INSTALL_MANDIR=/opt/freeware/man \ -D CMAKE_INSTALL_SYSCONFDIR=/opt/freeware/etc \ -D APP_CONFIG_DIRECTORY=/opt/freeware/etc/clamav \ -D DATABASE_DIRECTORY=/var/lib/clamav \ -D ENABLE_JSON_SHARED=OFF \ -D JSONC_INCLUDE_DIR=/opt/freeware/include/json-c \ -D JSONC_LIBRARY=/opt/freeware/lib/libjson-c.a \ -D ENABLE_TESTS=OFF \ -D ENABLE_MILTER=OFF # -D ENABLE_LIBCLAMAV_ONLY=ON cmake --build . gmake V=1 ctest # build on 32bit mode cd ../32bit export CC="/opt/freeware/bin/gcc -pthread -maix32 -O2 -D_LARGE_FILES" export CXX="/opt/freeware/bin/g++ -pthread -maix32 -O2 -D_LARGE_FILES" export OBJECT_MODE=32 export CFLAGS="-I`pwd`/include -I/opt/freeware/include -I/usr/include" export CXXFLAGS="-I`pwd`/include -I/opt/freeware/include -I/usr/include" export CPPFLAGS="-I`pwd`/include -I/opt/freeware/include -I/usr/include" export LDFLAGS="-lm -liconv -lxml2 -lbz2 -lcurl -lncurses -lbsd -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" cmake . \ -D CMAKE_INSTALL_PREFIX=/opt/freeware \ -D CMAKE_INSTALL_LIBDIR=/opt/freeware/lib \ -D CMAKE_INSTALL_FULL_SBINDIR=/opt/freeware/sbin \ -D CMAKE_INSTALL_MANDIR=/opt/freeware/man \ -D CMAKE_INSTALL_SYSCONFDIR=/opt/freeware/etc \ -D APP_CONFIG_DIRECTORY=/opt/freeware/etc/clamav \ -D DATABASE_DIRECTORY=/var/lib/clamav \ -D ENABLE_JSON_SHARED=OFF \ -D JSONC_INCLUDE_DIR=/opt/freeware/include/json-c \ -D JSONC_LIBRARY=/opt/freeware/lib/libjson-c.a \ -D ENABLE_TESTS=OFF \ -D ENABLE_MILTER=OFF # -D ENABLE_LIBCLAMAV_ONLY=ON cmake --build . gmake V=1 ctest %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} # install on 64bit mode export OBJECT_MODE=64 cd 64bit make install DESTDIR=${RPM_BUILD_ROOT} ( 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 make install DESTDIR=${RPM_BUILD_ROOT} ( 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/libclamav.so.9 /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}/%{_libdir}/libclamunrar.a ../64bit/libclamunrar/libclamunrar.so.9 /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}/%{_libdir}/libclamunrar_iface.a ../64bit/libclamunrar_iface/libclamunrar_iface.so.9 /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}/%{_libdir}/libclammspack.a ../64bit/libclammspack/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 08 2022 Neha Jain - 0.104.2-2 - Update to version 0.104.2-2 to fix issues found in version 0.104.2-1 * Fri Feb 11 2022 Sushree Das - 0.104.2-1 - Update to version 0.104.2 * Wed May 06 2020 Rishita Saha - 0.102.2-1 - Update to version 0.102.2 * 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