clamav/clamav.spec

Sat, 24 Mar 2012 21:40:49 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 24 Mar 2012 21:40:49 +0100
changeset 414
fd611cde817f
parent 234
b0dde56e4a08
child 498
c6b0e6c7f67d
permissions
-rw-r--r--

Introduce many changes to the buildconf and source code including:
(01) clean up, update, and partially update default config files,
(02) seems that Melware is unable to perform release engineering so
update chan_capi to new daily snapshot to solve echo problems,
(03) correct Asterisk inadequate hard coded gmime version check,
(04) force postgresql pthreads linkage to solve build problem,
(05) remove buggy hard coded LibXML configure definitions,
(06) remove local architecture specification to allow GCC
internal logic to determine proper CPU type instead,
(07) remove vendor sound install target causing uncontrolled
downloads and non RPM managed file installation,
(08) solve long outstanding bug in tcptls causing Asterisk
to ignore any intermediate CA certificate signatures,
(09) back out Digium engineering team's bright idea of replacing the
very portable and pervasive POSIX rand(1) with ast_random(), and
then not even implementing it causing all references to fail in
platforms not providing the very new POSIX.1-2008 mkdtemp(3)
function only distributed by BSD and some Linux,
(10) withdraw advanced linker symbol manipulations from SVR5 builds
until either Binutils supports hybrid versioned and anonymous
linker scripts or GCC stops hard coding versioned linker scripts,
(11) correct missing library linkage, some tailored to a specific OS,
(12) remove outdated logic for the no longer distributed gmime-config(1),
(13) remove local gmime buildconf hacks now that Asterisk has corrected
their own build configuration to almost portably support gmime,
(14) solve build problems relating to undetected LibXML paths,
(15) correct erroneous out of tree include definitions,
(16) improve some variable and comment naming,
(17) simplify sound language path hierarchy creation,
and correct australian english installation logic.

michael@226 1 ##
michael@226 2 ## clamav.spec -- OpenPKG RPM Package Specification
michael@226 3 ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@226 4 ##
michael@226 5 ## Permission to use, copy, modify, and distribute this software for
michael@226 6 ## any purpose with or without fee is hereby granted, provided that
michael@226 7 ## the above copyright notice and this permission notice appear in all
michael@226 8 ## copies.
michael@226 9 ##
michael@226 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@226 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@226 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@226 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@226 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@226 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@226 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@226 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@226 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@226 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@226 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@226 21 ## SUCH DAMAGE.
michael@226 22 ##
michael@226 23
michael@393 24 # MSvB FIXME:
michael@393 25 # MSvB FIXME: Problem with logging to syslog instead of FSL...
michael@393 26 # MSvB FIXME:
michael@393 27 # MSvB FIXME: Oct 2 10:15:47 host.name.tld clamav-milter[25958]: [ID 909925 user.error] ClamAV: thread_create() failed: 11, try again
michael@393 28 # MSvB FIXME: Oct 2 10:17:28 host.name.tld last message repeated 1 time
michael@393 29 # MSvB FIXME:
michael@393 30
michael@226 31 # package information
michael@226 32 Name: clamav
michael@226 33 Summary: Clam Antivirus
michael@226 34 URL: http://www.clamav.net/
michael@226 35 Vendor: Tomasz Kojm
michael@226 36 Packager: OpenPKG Foundation e.V.
michael@226 37 Distribution: OpenPKG Community
michael@226 38 Class: EVAL
michael@226 39 Group: AntiVirus
michael@226 40 License: GPL
michael@234 41 Version: 0.95.3
michael@234 42 Release: 20091102
michael@226 43
michael@226 44 # package options
michael@226 45 %option with_milter no
michael@226 46
michael@226 47 # list of sources
michael@226 48 Source0: http://switch.dl.sourceforge.net/clamav/clamav-%{version}.tar.gz
michael@226 49 Source1: rc.clamav
michael@226 50 Patch0: clamav.patch
michael@226 51
michael@226 52 # build information
michael@226 53 Prefix: %{l_prefix}
michael@226 54 BuildRoot: %{l_buildroot}
michael@226 55 BuildPreReq: OpenPKG, openpkg >= 20060823, gcc, bzip2, pkgconfig, bc
michael@226 56 PreReq: OpenPKG, openpkg >= 20060823
michael@226 57 BuildPreReq: zlib, bzip2, curl, gmp, libiconv, openssl
michael@226 58 PreReq: zlib, bzip2, curl, gmp, libiconv, openssl
michael@226 59 %if "%{with_milter}" == "yes"
michael@226 60 BuildPreReq: milter
michael@226 61 PreReq: milter
michael@226 62 %endif
michael@226 63 AutoReq: no
michael@226 64 AutoReqProv: no
michael@226 65
michael@226 66 %description
michael@226 67 Clam AntiVirus is an anti-virus toolkit for UNIX. The main
michael@226 68 purpose of this software is the integration with mail servers
michael@226 69 (attachment scanning). The package provides a flexible and scalable
michael@226 70 multi-threaded daemon, a command line scanner, and a tool for
michael@226 71 automatic updating via Internet. The programs are based on a shared
michael@226 72 library distributed with the Clam AntiVirus package, which you can
michael@226 73 use with your own software. The virus database is based on the virus
michael@226 74 database from OpenAntiVirus, but contains additional signatures.
michael@226 75
michael@226 76 %track
michael@226 77 prog clamav = {
michael@226 78 version = %{version}
michael@226 79 url = http://sourceforge.net/projects/clamav/files/
michael@226 80 regex = clamav-(\d+\.\d+(\.\d+)*)\.tar\.gz
michael@226 81 }
michael@226 82
michael@226 83 %prep
michael@226 84 %setup -q
michael@226 85 %patch -p0
michael@226 86
michael@226 87 %build
michael@226 88 # configure package
michael@226 89 CC="%{l_cc}" \
michael@226 90 CFLAGS="%{l_cflags -O}" \
michael@226 91 CPPFLAGS="%{l_cppflags}" \
michael@226 92 LDFLAGS="%{l_ldflags}" \
michael@226 93 GREP="grep" \
michael@226 94 ./configure \
michael@226 95 --prefix=%{l_prefix} \
michael@226 96 --mandir=%{l_prefix}/man \
michael@226 97 --sysconfdir=%{l_prefix}/etc/clamav \
michael@226 98 --with-zlib=%{l_prefix} \
michael@226 99 --with-libcurl \
michael@226 100 --with-user=%{l_rusr} \
michael@226 101 --with-group=%{l_rgrp} \
michael@226 102 --without-tcpwrappers \
michael@226 103 --disable-clamav \
michael@226 104 --disable-clamuko \
michael@226 105 --disable-urandom \
michael@226 106 --disable-cr \
michael@226 107 %if "%{with_milter}" == "yes"
michael@226 108 --enable-milter \
michael@226 109 --with-sendmail=/dev/null \
michael@226 110 %else
michael@226 111 --disable-milter \
michael@226 112 %endif
michael@226 113 --disable-unrar \
michael@226 114 --disable-shared
michael@226 115
michael@226 116 # build package
michael@226 117 %{l_make} %{l_mflags -O}
michael@226 118
michael@226 119 %install
michael@226 120 rm -rf $RPM_BUILD_ROOT
michael@226 121
michael@226 122 # perform standard package installation
michael@226 123 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
michael@226 124
michael@226 125 # install default configuration
michael@226 126 %{l_shtool} mkdir -f -p -m 755 \
michael@226 127 $RPM_BUILD_ROOT%{l_prefix}/etc/clamav
michael@226 128 %{l_shtool} install -c -m 644 \
michael@226 129 -e 's;^\(Example\);#\1;' \
michael@226 130 -e 's;^#\(LogFile\) /.*;\1 %{l_prefix}/var/clamav/clamd.log;' \
michael@226 131 -e 's;^#\(LogTime.*\);\1;' \
michael@226 132 -e 's;^#\(PidFile\).*;\1 %{l_prefix}/var/clamav/clamd.pid;' \
michael@226 133 -e 's;^\(LocalSocket\).*;\1 %{l_prefix}/var/clamav/clamd.sock;' \
michael@226 134 -e 's;^#\(FixStaleSocket.*\);\1;' \
michael@226 135 -e 's;^#\(DatabaseDirectory\).*;\1 %{l_prefix}/share/clamav;' \
michael@226 136 -e 's;^#\(User\).*;\1 %{l_rusr};' \
michael@226 137 etc/clamd.conf \
michael@226 138 $RPM_BUILD_ROOT%{l_prefix}/etc/clamav/
michael@226 139 %{l_shtool} install -c -m 644 \
michael@226 140 -e 's;^\(Example\);#\1;' \
michael@226 141 -e 's;^#\(DatabaseDirectory\).*;\1 %{l_prefix}/share/clamav;' \
michael@226 142 -e 's;^#\(UpdateLogFile\).*;\1 %{l_prefix}/var/clamav/freshclam.log;' \
michael@226 143 -e 's;^#\(NotifyClamd\).*;\1 %{l_prefix}/etc/clamav/clamd.conf;' \
michael@226 144 etc/freshclam.conf \
michael@226 145 $RPM_BUILD_ROOT%{l_prefix}/etc/clamav/
michael@226 146
michael@226 147 # install run-command script
michael@226 148 %{l_shtool} mkdir -f -p -m 755 \
michael@226 149 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
michael@226 150 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@226 151 %{SOURCE rc.clamav} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@226 152
michael@226 153 # strip-down installation hierarchy
michael@226 154 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@226 155 strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
michael@226 156 %if "%{with_milter}" == "no"
michael@226 157 rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/clamav-milter.8
michael@226 158 %endif
michael@226 159
michael@226 160 # create additional installation directory
michael@226 161 %{l_shtool} mkdir -f -p -m 755 \
michael@226 162 $RPM_BUILD_ROOT%{l_prefix}/var/clamav
michael@226 163
michael@226 164 # determine installation files
michael@226 165 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@226 166 %{l_files_std} \
michael@226 167 '%config %{l_prefix}/etc/clamav/*.conf' \
michael@226 168 '%attr(755,%{l_rusr},%{l_mgrp}) %{l_prefix}/var/clamav' \
michael@226 169 '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/share/clamav'
michael@226 170
michael@226 171 %files -f files
michael@226 172
michael@226 173 %clean
michael@226 174 rm -rf $RPM_BUILD_ROOT
michael@226 175
michael@226 176 %pre
michael@226 177 # before upgrade, save status and stop service
michael@226 178 [ $1 -eq 2 ] || exit 0
michael@226 179 eval `%{l_rc} clamav status 2>/dev/null | tee %{l_tmpfile}`
michael@226 180 %{l_rc} clamav stop 2>/dev/null
michael@226 181 exit 0
michael@226 182
michael@226 183 %post
michael@226 184 if [ $1 -eq 2 ]; then
michael@226 185 # after upgrade, restore status
michael@226 186 eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
michael@226 187 [ ".$clamav_active" = .yes ] && %{l_rc} clamav start
michael@226 188 fi
michael@226 189 exit 0
michael@226 190
michael@226 191 %preun
michael@226 192 # before erase, stop service and remove log files
michael@226 193 [ $1 -eq 0 ] || exit 0
michael@226 194 %{l_rc} clamav stop 2>/dev/null
michael@226 195 rm -f $RPM_INSTALL_PREFIX/var/clamav/*.log* >/dev/null 2>&1 || true
michael@226 196 exit 0
michael@226 197

mercurial