Projects
Kolab:3.4:Updates
clamav
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 4
View file
clamav.spec
Changed
@@ -1,16 +1,10 @@ #global prerelease rc1 -%if 0%{?opensuse_bs} < 1 -## Fedora Extras specific customization below... -%bcond_without fedora -%bcond_without upstart -%bcond_with systemd -%bcond_with sysv -%bcond_without tmpfiles -%bcond_with unrar -%bcond_without noarch -%bcond_without bytecode -## +%if 0%{?suse_version} || 0%{?fedora} > 17 || 0%{?rhel} > 6 +%global with_systemd 1 +%{!?_unitdir: %global _unitdir /usr/lib/systemd/system/} +%else +%global with_systemd 0 %endif %global _hardened_build 1 @@ -21,63 +15,60 @@ %global have_ocaml 0 %endif -%global username clamupdate -%global homedir %_var/lib/clamav -%global freshclamlog %_var/log/freshclam.log -%global milteruser clamilt -%global milterlog %_var/log/clamav-milter.log -%global milterstatedir %_var/run/clamav-milter -%global pkgdatadir %_datadir/%name +%global username clamupdate +%global homedir %{_var}/lib/clamav +%global freshclamlog %{_var}/log/freshclam.log +%global milteruser clamilt +%global milterlog %{_var}/log/clamav-milter.log +%global milterstatedir %{_var}/run/clamav-milter +%global pkgdatadir %{_datadir}/%{name} %global scanuser clamscan %global scanstatedir %_var/run/clamd.scan -%{?with_noarch:%global noarch BuildArch: noarch} -%{!?_unitdir:%global _unitdir /lib/systemd/system} +%{!?_unitdir:%global _unitdir /usr/lib/systemd/system} %{!?_initrddir:%global _initrddir /etc/rc.d/init.d} %{!?release_func:%global release_func() %%{?prerelease:0.}%1%%{?prerelease:.%%prerelease}%%{?dist}} %{!?apply:%global apply(p:n:b:) %patch%%{-n:%%{-n*}} %%{-p:-p %%{-p*}} %%{-b:-b %%{-b*}} \ %nil} -%{!?systemd_reqs:%global systemd_reqs \ -Requires(post): /bin/systemctl\ -Requires(preun): /bin/systemctl\ -Requires(postun): /bin/systemctl\ -%nil} -Summary: End-user tools for the Clam Antivirus scanner -Name: clamav -Version: 0.98.4 -Release: 1%{?dist} -License: %{?with_unrar:proprietary}%{!?with_unrar:GPLv2} -Group: Applications/File -URL: http://www.clamav.net +Summary: End-user tools for the Clam Antivirus scanner +Name: clamav +Version: 0.98.4 +Release: 1%{?dist} +License: %{?with_unrar:proprietary}%{!?with_unrar:GPLv2} +Group: Applications/File +URL: http://www.clamav.net + %if 0%{?with_unrar:1} -Source0: http://download.sourceforge.net/sourceforge/clamav/%name-%version%{?prerelease}.tar.gz -Source999: http://download.sourceforge.net/sourceforge/clamav/%name-%version%{?prerelease}.tar.gz.sig +Source0: http://download.sourceforge.net/sourceforge/clamav/%{name}-%{version}%{?prerelease}.tar.gz +Source999: http://download.sourceforge.net/sourceforge/clamav/%{name}-%{version}%{?prerelease}.tar.gz.sig %else # Unfortunately, clamav includes support for RAR v3, derived from GPL # incompatible unrar from RARlabs. We have to pull this code out. # tarball was created by # make clean-sources NAME=clamav VERSION=<version> TARBALL=clamav-<version>.tar.gz TARBALL_CLEAN=clamav-<version>-norar.tar.xz -Source0: %name-%version%{?prerelease}-norar.tar.xz +Source0: %{name}-%{version}%{?prerelease}-norar.tar.xz %endif # To download the *.cvd, go to http://www.clamav.net and use the links # there (I renamed the files to add the -version suffix for verifying). -Source10: http://db.local.clamav.net/main-55.cvd -Source11: http://db.local.clamav.net/daily-19120.cvd +Source10: http://db.local.clamav.net/main-55.cvd +Source11: http://db.local.clamav.net/daily-19120.cvd -Patch24: clamav-0.92-private.patch -Patch26: clamav-0.98-cliopts.patch -Patch27: clamav-0.98-umask.patch +Patch24: clamav-0.92-private.patch +Patch26: clamav-0.98-cliopts.patch +Patch27: clamav-0.98-umask.patch # https://bugzilla.redhat.com/attachment.cgi?id=403775&action=diff&context=patch&collapsed=&headers=1&format=raw -Patch29: clamav-0.98.3-jitoff.patch +Patch29: clamav-0.98.3-jitoff.patch # https://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp?r1=128086&r2=137567 -Patch30: llvm-glibc.patch -BuildRoot: %_tmppath/%name-%version-%release-root -Requires: clamav-lib = %version-%release -Requires: data(clamav) -BuildRequires: zlib-devel bzip2-devel gmp-devel curl-devel -BuildRequires: ncurses-devel openssl-devel libxml2-devel +Patch30: llvm-glibc.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root +Requires: clamav-lib = %{version}-%{release} +Requires: data(clamav) +BuildRequires: zlib-devel bzip2-devel gmp-devel curl-devel +BuildRequires: ncurses-devel openssl-devel libxml2-devel +BuildRequires: bc tcl groff graphviz +BuildRequires: ocaml %if 0%{?suse_version} BuildRequires: tcpd-devel @@ -85,61 +76,56 @@ BuildRequires: tcp_wrappers-devel %endif -%{?with_bytecode:BuildRequires: bc tcl groff graphviz} -%if %{have_ocaml} -%{?with_bytecode:BuildRequires: ocaml} -%endif - %package filesystem -Summary: Filesystem structure for clamav -Group: Applications/File -Provides: user(%username) = 4 -Provides: group(%username) = 4 +Summary: Filesystem structure for clamav +Group: Applications/File +Provides: user(%username) = 4 +Provides: group(%username) = 4 # Prevent version mix -Conflicts: %name < %version-%release -Conflicts: %name > %version-%release -Requires(pre): shadow-utils +Conflicts: %{name} < %{version}-%{release} +Conflicts: %{name} > %{version}-%{release} +Requires(pre): shadow-utils %{?noarch} %package lib -Summary: Dynamic libraries for the Clam Antivirus scanner -Group: System Environment/Libraries -Requires: data(clamav) +Summary: Dynamic libraries for the Clam Antivirus scanner +Group: System Environment/Libraries +Requires: data(clamav) %package devel -Summary: Header files and libraries for the Clam Antivirus scanner -Group: Development/Libraries -Source100: clamd-gen -Requires: clamav-lib = %version-%release -Requires: clamav-filesystem = %version-%release +Summary: Header files and libraries for the Clam Antivirus scanner +Group: Development/Libraries +Source100: clamd-gen +Requires: clamav-lib = %{version}-%{release} +Requires: clamav-filesystem = %{version}-%{release} %package data -Summary: Virus signature data for the Clam Antivirus scanner -Group: Applications/File -Requires(pre): clamav-filesystem = %version-%release -Requires(postun): clamav-filesystem = %version-%release -Provides: data(clamav) = full -Conflicts: data(clamav) < full -Conflicts: data(clamav) > full +Summary: Virus signature data for the Clam Antivirus scanner +Group: Applications/File +Requires(pre): clamav-filesystem = %{version}-%{release} +Requires(postun): clamav-filesystem = %{version}-%{release} +Provides: data(clamav) = full +Conflicts: data(clamav) < full +Conflicts: data(clamav) > full %{?noarch} %package data-empty -Summary: Empty data package for the Clam Antivirus scanner -Group: Applications/File -Provides: data(clamav) = empty -Conflicts: data(clamav) < empty -Conflicts: data(clamav) > empty +Summary: Empty data package for the Clam Antivirus scanner +Group: Applications/File +Provides: data(clamav) = empty +Conflicts: data(clamav) < empty +Conflicts: data(clamav) > empty %{?noarch} %package update -Summary: Auto-updater for the Clam Antivirus scanner data-files -Group: Applications/File -Source200: freshclam-sleep -Source201: freshclam.sysconfig -Source202: clamav-update.crond -Source203: clamav-update.logrotate -Requires: clamav-filesystem = %version-%release -Requires: crontabs +Summary: Auto-updater for the Clam Antivirus scanner data-files +Group: Applications/File +Source200: freshclam-sleep +Source201: freshclam.sysconfig +Source202: clamav-update.crond +Source203: clamav-update.logrotate +Requires: clamav-filesystem = %{version}-%{release} +Requires: crontabs Requires(pre): /etc/cron.d Requires(postun): /etc/cron.d Requires(post): %__chown %__chmod @@ -148,143 +134,163 @@ %endif %package server -Summary: Clam Antivirus scanner server -Group: System Environment/Daemons -Source2: clamd.sysconfig -Source3: clamd.logrotate -Source5: clamd-README -Source7: clamd.SERVICE.init -Source8: clamav-notify-servers -Requires: data(clamav) -Requires: clamav-filesystem = %version-%release -Requires: clamav-lib = %version-%release -Requires: nc coreutils - +Summary: Clam Antivirus scanner server +Group: System Environment/Daemons +Source2: clamd.sysconfig +Source3: clamd.logrotate +Source5: clamd-README +Source7: clamd.SERVICE.init +Source8: clamav-notify-servers +Requires: data(clamav) +Requires: clamav-filesystem = %{version}-%{release} +Requires: clamav-lib = %{version}-%{release} +Requires: nc coreutils + +%if 0%{?with_systemd} < 1 %package server-sysvinit -Summary: SysV initscripts for clamav server -Group: System Environment/Daemons -Provides: init(clamav-server) = sysv -Requires: clamav-server = %version-%release -Requires(pre): %_initrddir -Requires(postun): %_initrddir -Provides: clamav-server-sysv = %version-%release -Obsoletes: clamav-server-sysv < %version-%release -Source520: clamd-wrapper +Summary: SysV initscripts for clamav server +Group: System Environment/Daemons +Provides: init(clamav-server) = sysv +Requires: clamav-server = %{version}-%{release} +Requires(pre): %{_initrddir} +Requires(postun): %{_initrddir} +Provides: clamav-server-sysv = %{version}-%{release} +Obsoletes: clamav-server-sysv < %{version}-%{release} +Source520: clamd-wrapper %{?noarch} - +%else %package server-systemd -Summary: SysV initscripts for clamav server -Group: System Environment/Daemons -Provides: init(clamav-server) = systemd -Requires: clamav-server = %version-%release -Source530: clamd@.service -%{?systemd_reqs} +Summary: SysV initscripts for clamav server +Group: System Environment/Daemons +Provides: init(clamav-server) = systemd +Requires: clamav-server = %{version}-%{release} +Source530: clamd@.service +%if 0%{?opensuse_bs} < 1 +Requires(post): /bin/systemctl +Requires(preun): /bin/systemctl +Requires(postun): /bin/systemctl +%endif %{?noarch} - +%endif %package scanner -Summary: Clamav scanner daemon -Group: System Environment/Daemons -Requires: init(clamav-scanner) -Provides: user(%scanuser) = 49 -Provides: group(%scanuser) = 49 -Requires: clamav-server = %version-%release +Summary: Clamav scanner daemon +Group: System Environment/Daemons +Requires: init(clamav-scanner) +Provides: user(%scanuser) = 49 +Provides: group(%scanuser) = 49 +Requires: clamav-server = %{version}-%{release} %{?noarch} -# Remove me after EOL of RHEL5 +%if 0%{?with_systemd} < 1 && 0%{?with_upstart} < 1 %package scanner-sysvinit -Summary: SysV initscripts for clamav scanner daemon -Group: System Environment/Daemons -Provides: init(clamav-scanner) = sysv -Requires: clamav-server-sysvinit = %version-%release -Requires: clamav-scanner = %version-%release -Requires(pre): %_initrddir -Requires(postun): %_initrddir initscripts +Summary: SysV initscripts for clamav scanner daemon +Group: System Environment/Daemons +Provides: init(clamav-scanner) = sysv +Requires: clamav-server-sysvinit = %{version}-%{release} +Requires: clamav-scanner = %{version}-%{release} +Requires(pre): %{_initrddir} +Requires(postun): %{_initrddir} initscripts Requires(post): chkconfig Requires(preun): chkconfig initscripts %{?noarch} +%endif -# Remove me after EOL of RHEL6 +%if 0%{?with_upstart} %package scanner-upstart -Summary: Upstart initscripts for clamav scanner daemon -Group: System Environment/Daemons -Source410: clamd.scan.upstart -Provides: init(clamav-scanner) = upstart -Requires: clamav-scanner = %version-%release +Summary: Upstart initscripts for clamav scanner daemon +Group: System Environment/Daemons +Source410: clamd.scan.upstart +Provides: init(clamav-scanner) = upstart +Requires: clamav-scanner = %{version}-%{release} Requires(pre): /etc/init Requires(post): /usr/bin/killall Requires(preun): /sbin/initctl %{?noarch} +%endif +%if 0%{?with_systemd} %package scanner-systemd -Summary: Systemd initscripts for clamav scanner daemon -Group: System Environment/Daemons -Source430: clamd@scan.service -Provides: init(clamav-scanner) = systemd -Requires: clamav-scanner = %version-%release -Requires: clamav-server-systemd = %version-%release -%{?systemd_reqs} +Summary: Systemd initscripts for clamav scanner daemon +Group: System Environment/Daemons +Source430: clamd@scan.service +Provides: init(clamav-scanner) = systemd +Requires: clamav-scanner = %{version}-%{release} +Requires: clamav-server-systemd = %{version}-%{release} +%if 0%{?opensuse_bs} < 1 +Requires(post): /bin/systemctl +Requires(preun): /bin/systemctl +Requires(postun): /bin/systemctl +%endif %{?noarch} +%endif %package milter -Summary: Milter module for the Clam Antivirus scanner -Group: System Environment/Daemons -Source300: README.fedora -Requires: init(clamav-milter) -BuildRequires: sendmail-devel -Provides: user(%milteruser) = 5 -Provides: group(%milteruser) = 5 -Requires(post): coreutils -Requires(pre): shadow-utils - -Provides: milter(clamav) = sendmail -Provides: milter(clamav) = postfix - -Provides: clamav-milter-core = %version-%release -Obsoletes: clamav-milter-core < %version-%release -Provides: clamav-milter-sendmail = %version-%release -Obsoletes: clamav-milter-sendmail < %version-%release - -# Remove me after EOL of RHEL5 +Summary: Milter module for the Clam Antivirus scanner +Group: System Environment/Daemons +Source300: README.fedora +Requires: init(clamav-milter) +BuildRequires: sendmail-devel +Provides: user(%{milteruser}) = 5 +Provides: group(%{milteruser}) = 5 +Requires(post): coreutils +Requires(pre): shadow-utils + +Provides: milter(clamav) = sendmail +Provides: milter(clamav) = postfix + +Provides: clamav-milter-core = %{version}-%{release} +Obsoletes: clamav-milter-core < %{version}-%{release} +Provides: clamav-milter-sendmail = %{version}-%{release} +Obsoletes: clamav-milter-sendmail < %{version}-%{release} + +%if 0%{?with_systemd} < 1 && 0%{?with_upstart} < 1 %package milter-sysvinit -Summary: SysV initscripts for the clamav sendmail-milter -Group: System Environment/Daemons -Source320: clamav-milter.sysv -Provides: init(clamav-milter) = sysvinit -Requires: clamav-milter = %version-%release +Summary: SysV initscripts for the clamav sendmail-milter +Group: System Environment/Daemons +Source320: clamav-milter.sysv +Provides: init(clamav-milter) = sysvinit +Requires: clamav-milter = %{version}-%{release} %if 0%{?opensuse_bs} < 1 -Requires(post): user(%milteruser) -Requires(preun): user(%milteruser) +Requires(post): user(%{milteruser}) +Requires(preun): user(%{milteruser}) %endif -Requires(pre): %_initrddir -Requires(postun): %_initrddir initscripts +Requires(pre): %{_initrddir} +Requires(postun): %{_initrddir} initscripts Requires(post): chkconfig clamav-milter Requires(preun): chkconfig initscripts clamav-milter -Provides: clamav-milter-sysv = %version-%release -Obsoletes: clamav-milter-sysv < %version-%release +Provides: clamav-milter-sysv = %{version}-%{release} +Obsoletes: clamav-milter-sysv < %{version}-%{release} %{?noarch} +%endif -# Remove me after EOL of RHEL6 +%if 0%{?with_upstart} %package milter-upstart -Summary: Upstart initscripts for the clamav sendmail-milter -Group: System Environment/Daemons -Source310: clamav-milter.upstart -Provides: init(clamav-milter) = upstart -Requires: clamav-milter = %version-%release +Summary: Upstart initscripts for the clamav sendmail-milter +Group: System Environment/Daemons +Source310: clamav-milter.upstart +Provides: init(clamav-milter) = upstart +Requires: clamav-milter = %{version}-%{release} Requires(pre): /etc/init Requires(post): /usr/bin/killall Requires(preun): /sbin/initctl %{?noarch} +%endif +%if 0%{?with_systemd} %package milter-systemd -Summary: Systemd initscripts for the clamav sendmail-milter -Group: System Environment/Daemons -Source330: clamav-milter.systemd -Provides: init(clamav-milter) = systemd -Requires: clamav-milter = %version-%release -%{?systemd_reqs} +Summary: Systemd initscripts for the clamav sendmail-milter +Group: System Environment/Daemons +Source330: clamav-milter.systemd +Provides: init(clamav-milter) = systemd +Requires: clamav-milter = %{version}-%{release} +%if 0%{?opensuse_bs} < 1 +Requires(post): /bin/systemctl +Requires(preun): /bin/systemctl +Requires(postun): /bin/systemctl +%endif %{?noarch} - +%endif %description Clam AntiVirus is an anti-virus toolkit for UNIX. The main purpose of this @@ -322,7 +328,6 @@ do not want to download a >5MB sized rpm-package with outdated virus definitions. - %description data-empty This is an empty package to fulfill inter-package dependencies of the clamav suite. This package and the 'clamav-data' package are mutually @@ -335,7 +340,6 @@ do not want to download a >5MB sized rpm-package with outdated virus definitions. - %description update This package contains programs which can be used to update the clamav anti-virus database automatically. It uses the freshclam(1) utility for @@ -352,39 +356,52 @@ See the README file how this can be done with a minimum of effort. - +%if 0%{?with_systemd} < 1 %description server-sysvinit SysV initscripts template for the clamav server +%endif +%if 0%{?with_systemd} %description server-systemd Systemd template for the clamav server - +%endif %description scanner This package contains a generic system wide clamd service which is e.g. used by the clamav-milter package. +%if 0%{?with_systemd} < 1 && 0%{?with_upstart} < 1 %description scanner-sysvinit The SysV initscripts for clamav-scanner. +%endif +%if 0%{?with_upstart} %description scanner-upstart The Upstart initscripts for clamav-scanner. +%endif +%if 0%{?with_systemd} %description scanner-systemd The systemd initscripts for clamav-scanner. - +%endif %description milter This package contains files which are needed to run the clamav-milter. +%if 0%{?with_systemd} < 1 && 0%{?with_upstart} < 1 %description milter-sysvinit The SysV initscripts for clamav-milter. +%endif +%if 0%{?with_upstart} %description milter-upstart The Upstart initscripts for clamav-milter. +%endif +%if 0%{?with_systemd} %description milter-systemd The systemd initscripts for clamav-scanner. +%endif ## ------------------------------------------------------------ @@ -409,7 +426,7 @@ -e 's!^(#?PidFile ).*!\1/var/run/clamd.<SERVICE>/clamd.pid!g' \ -e 's!^#?(User ).*!\1<USER>!g' \ -e 's!^#?(AllowSupplementaryGroups|LogSyslog).*!\1 yes!g' \ - -e 's! /usr/local/share/clamav,! %homedir,!g' \ + -e 's! /usr/local/share/clamav,! %{homedir},!g' \ etc/clamd.conf.sample sed -ri \ @@ -457,15 +474,15 @@ ## ------------------------------------------------------------ %install -rm -rf "$RPM_BUILD_ROOT" _doc* -make DESTDIR="$RPM_BUILD_ROOT" install +rm -rf "%{buildroot}/" _doc* +make DESTDIR="%{buildroot}/" install function smartsubst() { local tmp local regexp=$1 shift - tmp=$(mktemp /tmp/%name-subst.XXXXXX) + tmp=$(mktemp /tmp/%{name}-subst.XXXXXX) for i; do sed -e "$regexp" "$i" >$tmp cmp -s $tmp "$i" || cat $tmp >"$i" @@ -475,23 +492,22 @@ install -d -m 0755 \ - $RPM_BUILD_ROOT%_sysconfdir/{mail,clamd.d,logrotate.d,tmpfiles.d} \ - $RPM_BUILD_ROOT%_var/{log,run} \ - $RPM_BUILD_ROOT%milterstatedir \ - $RPM_BUILD_ROOT%pkgdatadir/template \ - $RPM_BUILD_ROOT%_initrddir \ - $RPM_BUILD_ROOT%homedir \ - $RPM_BUILD_ROOT%scanstatedir - -rm -f $RPM_BUILD_ROOT%_sysconfdir/clamd.conf.sample \ - $RPM_BUILD_ROOT%_libdir/*.la + %{buildroot}/%{_sysconfdir}/{mail,clamd.d,logrotate.d,tmpfiles.d} \ + %{buildroot}/%_var/{log,run} \ + %{buildroot}/%milterstatedir \ + %{buildroot}/%{pkgdatadir}/template \ + %{buildroot}/%{_initrddir} \ + %{buildroot}/%{homedir} \ + %{buildroot}/%scanstatedir +rm -f %{buildroot}/%{_sysconfdir}/clamd.conf.sample \ + %{buildroot}/%_libdir/*.la -touch $RPM_BUILD_ROOT%homedir/daily.cld -touch $RPM_BUILD_ROOT%homedir/main.cld +touch %{buildroot}/%{homedir}/daily.cld +touch %{buildroot}/%{homedir}/main.cld -install -D -m 0644 -p %SOURCE10 $RPM_BUILD_ROOT%homedir/main.cvd -install -D -m 0644 -p %SOURCE11 $RPM_BUILD_ROOT%homedir/daily.cvd +install -D -m 0644 -p %SOURCE10 %{buildroot}/%{homedir}/main.cvd +install -D -m 0644 -p %SOURCE11 %{buildroot}/%{homedir}/daily.cvd ## prepare the server-files install -D -m 0644 -p %SOURCE2 _doc_server/clamd.sysconfig @@ -500,78 +516,96 @@ install -D -m 0644 -p %SOURCE5 _doc_server/README install -D -m 0644 -p etc/clamd.conf.sample _doc_server/clamd.conf -install -m 0644 -p %SOURCE520 $RPM_BUILD_ROOT%pkgdatadir/ -install -m 0755 -p %SOURCE100 $RPM_BUILD_ROOT%pkgdatadir/ -cp -pa _doc_server/* $RPM_BUILD_ROOT%pkgdatadir/template - -smartsubst 's!/usr/share/clamav!%pkgdatadir!g' $RPM_BUILD_ROOT%pkgdatadir/clamd-wrapper -install -D -p -m 0644 %SOURCE530 $RPM_BUILD_ROOT%_unitdir/clamd@.service +%if 0%{?with_systemd} +install -d -m 0755 %{buildroot}/%{_unitdir} +install -D -p -m 0644 %SOURCE530 %{buildroot}/%{_unitdir}/clamd@.service +%else +install -m 0644 -p %SOURCE520 %{buildroot}/%{pkgdatadir}/ +smartsubst 's!/usr/share/clamav!%{pkgdatadir}!g' %{buildroot}/%{pkgdatadir}/clamd-wrapper +%endif +install -m 0755 -p %SOURCE100 %{buildroot}/%{pkgdatadir}/ +cp -pa _doc_server/* %{buildroot}/%{pkgdatadir}/template ## prepare the update-files -install -D -m 0644 -p %SOURCE203 $RPM_BUILD_ROOT%_sysconfdir/logrotate.d/clamav-update -install -D -m 0755 -p %SOURCE8 $RPM_BUILD_ROOT%_sbindir/clamav-notify-servers -touch $RPM_BUILD_ROOT%freshclamlog +install -D -m 0644 -p %SOURCE203 %{buildroot}/%{_sysconfdir}/logrotate.d/clamav-update +install -D -m 0755 -p %SOURCE8 %{buildroot}/%{_sbindir}/clamav-notify-servers +touch %{buildroot}/%freshclamlog -install -D -p -m 0755 %SOURCE200 $RPM_BUILD_ROOT%pkgdatadir/freshclam-sleep -install -D -p -m 0644 %SOURCE201 $RPM_BUILD_ROOT%_sysconfdir/sysconfig/freshclam -install -D -p -m 0600 %SOURCE202 $RPM_BUILD_ROOT%_sysconfdir/cron.d/clamav-update -mv -f $RPM_BUILD_ROOT%_sysconfdir/freshclam.conf{.sample,} +install -D -p -m 0755 %SOURCE200 %{buildroot}/%{pkgdatadir}/freshclam-sleep +install -D -p -m 0644 %SOURCE201 %{buildroot}/%{_sysconfdir}/sysconfig/freshclam +install -D -p -m 0600 %SOURCE202 %{buildroot}/%{_sysconfdir}/cron.d/clamav-update +mv -f %{buildroot}/%{_sysconfdir}/freshclam.conf{.sample,} smartsubst 's!webmaster,clamav!webmaster,%username!g; - s!/usr/share/clamav!%pkgdatadir!g; - s!/usr/bin!%_bindir!g; - s!/usr/sbin!%_sbindir!g;' \ - $RPM_BUILD_ROOT%_sysconfdir/cron.d/clamav-update \ - $RPM_BUILD_ROOT%pkgdatadir/freshclam-sleep - + s!/usr/share/clamav!%{pkgdatadir}!g; + s!/usr/bin!%{_bindir}!g; + s!/usr/sbin!%{_sbindir}!g;' \ + %{buildroot}/%{_sysconfdir}/cron.d/clamav-update \ + %{buildroot}/%{pkgdatadir}/freshclam-sleep ### The scanner stuff sed -e 's!<SERVICE>!scan!g;s!<USER>!%scanuser!g' \ - etc/clamd.conf.sample > $RPM_BUILD_ROOT%_sysconfdir/clamd.d/scan.conf + etc/clamd.conf.sample > %{buildroot}/%{_sysconfdir}/clamd.d/scan.conf + +%if 0%{?with_systemd} < 1 && 0%{?with_upstart} < 1 +sed -e 's!<SERVICE>!scan!g;' %{buildroot}/%{pkgdatadir}/template/clamd.init \ + > %{buildroot}/%{_initrddir}/clamd.scan +%endif -sed -e 's!<SERVICE>!scan!g;' $RPM_BUILD_ROOT%pkgdatadir/template/clamd.init \ - > $RPM_BUILD_ROOT%_initrddir/clamd.scan +%if 0%{?with_upstart} +install -D -p -m 0644 %SOURCE410 %{buildroot}/%{_sysconfdir}/init/clamd.scan.conf +%endif -install -D -p -m 0644 %SOURCE410 $RPM_BUILD_ROOT%_sysconfdir/init/clamd.scan.conf -install -D -p -m 0644 %SOURCE430 $RPM_BUILD_ROOT%_unitdir/clamd@scan.service +%if 0%{?with_systemd} +install -D -p -m 0644 %SOURCE430 %{buildroot}/%{_unitdir}/clamd@scan.service +%endif -cat << EOF > $RPM_BUILD_ROOT%_sysconfdir/tmpfiles.d/clamd.scan.conf +cat << EOF > %{buildroot}/%{_sysconfdir}/tmpfiles.d/clamd.scan.conf d %scanstatedir 0710 %scanuser %scanuser EOF -touch $RPM_BUILD_ROOT%scanstatedir/clamd.{sock,pid} - +touch %{buildroot}/%scanstatedir/clamd.{sock,pid} ### The milter stuff sed -r \ - -e 's!^#?(User).*!\1 %milteruser!g' \ + -e 's!^#?(User).*!\1 %{milteruser}!g' \ -e 's!^#?(AllowSupplementaryGroups|LogSyslog) .*!\1 yes!g' \ -e 's! /tmp/clamav-milter.socket! %milterstatedir/clamav-milter.socket!g' \ -e 's! /var/run/clamav-milter.pid! %milterstatedir/clamav-milter.pid!g' \ -e 's! /tmp/clamav-milter.log! %milterlog!g' \ - etc/clamav-milter.conf.sample > $RPM_BUILD_ROOT%_sysconfdir/mail/clamav-milter.conf + etc/clamav-milter.conf.sample > %{buildroot}/%{_sysconfdir}/mail/clamav-milter.conf -install -D -p -m 0644 %SOURCE310 $RPM_BUILD_ROOT%_sysconfdir/init/clamav-milter.conf -install -D -p -m 0755 %SOURCE320 $RPM_BUILD_ROOT%_initrddir/clamav-milter -install -D -p -m 0644 %SOURCE330 $RPM_BUILD_ROOT%_unitdir/clamav-milter.service +%if 0%{?with_systemd} < 1 && 0%{?with_upstart} < 1 +install -D -p -m 0755 %SOURCE320 %{buildroot}/%{_initrddir}/clamav-milter +%endif -cat << EOF > $RPM_BUILD_ROOT%_sysconfdir/tmpfiles.d/clamav-milter.conf -d %milterstatedir 0710 %milteruser %milteruser +%if 0%{?with_upstart} +install -D -p -m 0644 %SOURCE310 %{buildroot}/%{_sysconfdir}/init/clamav-milter.conf +%endif + +%if 0%{?with_systemd} +install -D -p -m 0644 %SOURCE330 %{buildroot}/%{_unitdir}/clamav-milter.service +%endif + +cat << EOF > %{buildroot}/%{_sysconfdir}/tmpfiles.d/clamav-milter.conf +d %milterstatedir 0710 %{milteruser} %{milteruser} EOF -rm -f $RPM_BUILD_ROOT%_sysconfdir/clamav-milter.conf.sample -touch $RPM_BUILD_ROOT{%milterstatedir/clamav-milter.{socket,pid},%milterlog} +rm -f %{buildroot}/%{_sysconfdir}/clamav-milter.conf.sample +touch %{buildroot}/{%milterstatedir/clamav-milter.{socket,pid},%milterlog} -%{!?with_upstart: rm -rf $RPM_BUILD_ROOT%_sysconfdir/init} -%{!?with_systemd: rm -rf $RPM_BUILD_ROOT%_unitdir} -%{!?with_sysv: rm -f $RPM_BUILD_ROOT%_initrddir/*} -%{!?with_sysv: rm -rf $RPM_BUILD_ROOT%_var/run/*/*.pid} -%{!?with_tmpfiles: rm -rf $RPM_BUILD_ROOT%_sysconfdir/tmpfiles.d} +%{!?with_upstart: rm -rf %{buildroot}/%{_sysconfdir}/init} +%{!?with_systemd: rm -rf %{buildroot}/%{_unitdir}} +%{!?with_sysv: rm -f %{buildroot}/%{_initrddir}/*} +%{!?with_sysv: rm -rf %{buildroot}/%_var/run/*/*.pid} +%{!?with_tmpfiles: rm -rf %{buildroot}/%{_sysconfdir}/tmpfiles.d} +%if 0%{?with_systemd} < 1 # keep clamd-wrapper in every case because it might be needed by other # packages -ln -s %pkgdatadir/clamd-wrapper $RPM_BUILD_ROOT%_initrddir/clamd-wrapper +ln -s %{pkgdatadir}/clamd-wrapper %{buildroot}/%{_initrddir}/clamd-wrapper +%endif ## ------------------------------------------------------------ @@ -581,7 +615,7 @@ ## ------------------------------------------------------------ %clean -rm -rf "$RPM_BUILD_ROOT" +rm -rf "%{buildroot}/" ## ------------------------------------------------------------ @@ -603,7 +637,7 @@ %{?with_tmpfiles: %post scanner -%{?with_systemd:/bin/systemd-tmpfiles --create %_sysconfdir/tmpfiles.d/clamd.scan.conf || :}} +%{?with_systemd:/bin/systemd-tmpfiles --create %{_sysconfdir}/tmpfiles.d/clamd.scan.conf || :}} %post server-systemd @@ -612,26 +646,36 @@ %postun server-systemd /bin/systemctl daemon-reload >/dev/null 2>&1 || : - +%if 0%{?with_systemd} < 1 && 0%{?with_upstart} < 1 %post scanner-sysvinit /sbin/chkconfig --add clamd.scan %preun scanner-sysvinit -test "$1" != 0 || %_initrddir/clamd.scan stop &>/dev/null || : +test "$1" != 0 || %{_initrddir}/clamd.scan stop &>/dev/null || : test "$1" != 0 || /sbin/chkconfig --del clamd.scan %postun scanner-sysvinit -test "$1" = 0 || %_initrddir/clamd.scan condrestart >/dev/null || : - +test "$1" = 0 || %{_initrddir}/clamd.scan condrestart >/dev/null || : +%endif +%if 0%{?with_upstart} %post scanner-upstart /usr/bin/killall -u %scanuser clamd 2>/dev/null || : %preun scanner-upstart test "$1" != "0" || /sbin/initctl -q stop clamd.scan || : +%endif +%if 0%{?with_systemd} +%post scanner-systemd +%systemd_post clamd@scan.service -%systemd_install scanner-systemd clamd@scan.service +%preun scanner-systemd +%systemd_preun clamd@scan.service + +%postun scanner-systemd +%systemd_postun_with_restart clamd@scan.service +%endif %post update @@ -642,7 +686,7 @@ ! test -x /sbin/restorecon || /sbin/restorecon %freshclamlog } -%triggerin update -- %name-update < 0.97.3-1704 +%triggerin update -- %{name}-update < 0.97.3-1704 # remove me after F19 ! test -x /sbin/restorecon || /sbin/restorecon %freshclamlog &>/dev/null || : @@ -650,7 +694,7 @@ %triggerin milter -- clamav-scanner # Add the milteruser to the scanuser group; this is required when # milter and clamd communicate through local sockets -/usr/sbin/groupmems -g %scanuser -a %milteruser &>/dev/null || : +/usr/sbin/groupmems -g %scanuser -a %{milteruser} &>/dev/null || : %pre milter getent group %{milteruser} >/dev/null || groupadd -r %{milteruser} @@ -664,50 +708,58 @@ test -e %milterlog || { touch %milterlog chmod 0620 %milterlog - chown root:%milteruser %milterlog + chown root:%{milteruser} %milterlog ! test -x /sbin/restorecon || /sbin/restorecon %milterlog } -%{?with_systemd:/bin/systemd-tmpfiles --create %_sysconfdir/tmpfiles.d/clamav-milter.conf || :} +%{?with_systemd:/bin/systemd-tmpfiles --create %{_sysconfdir}/tmpfiles.d/clamav-milter.conf || :} -%triggerin milter -- %name-milter < 0.97.3-1704 +%triggerin milter -- %{name}-milter < 0.97.3-1704 # remove me after F19 ! test -x /sbin/restorecon || /sbin/restorecon %milterlog &>/dev/null || : - +%if 0%{?with_systemd} < 1 && 0%{?with_upstart} < 1 %post milter-sysvinit /sbin/chkconfig --add clamav-milter %preun milter-sysvinit -test "$1" != 0 || %_initrddir/clamav-milter stop &>/dev/null || : +test "$1" != 0 || %{_initrddir}/clamav-milter stop &>/dev/null || : test "$1" != 0 || /sbin/chkconfig --del clamav-milter %postun milter-sysvinit -test "$1" = 0 || %_initrddir/clamav-milter condrestart >/dev/null || : - +test "$1" = 0 || %{_initrddir}/clamav-milter condrestart >/dev/null || : +%endif +%if 0%{?with_upstart} %post milter-upstart -/usr/bin/killall -u %milteruser clamav-milter 2>/dev/null || : +/usr/bin/killall -u %{milteruser} clamav-milter 2>/dev/null || : %preun milter-upstart test "$1" != "0" || /sbin/initctl -q stop clamav-milter || : +%endif +%if 0%{?with_systemd} +%post milter-systemd +%systemd_post clamav-milter.service -%systemd_install milter-systemd clamav-milter.service +%preun milter-systemd +%systemd_preun clamav-milter.service +%postun milter-systemd +%systemd_postun_with_restart clamav-milter.service +%endif %post lib -p /sbin/ldconfig %postun lib -p /sbin/ldconfig - %files %defattr(-,root,root,-) %doc AUTHORS BUGS COPYING ChangeLog FAQ NEWS README UPGRADE %doc docs/*.pdf -%_bindir/* +%{_bindir}/* %_mandir/man[15]/* -%exclude %_bindir/clamav-config -%exclude %_bindir/freshclam +%exclude %{_bindir}/clamav-config +%exclude %{_bindir}/freshclam %exclude %_mandir/*/freshclam* ## ----------------------- @@ -722,16 +774,16 @@ %defattr(-,root,root,-) %_includedir/* %_libdir/*.so -%pkgdatadir/template -%pkgdatadir/clamd-gen +%{pkgdatadir}/template +%{pkgdatadir}/clamd-gen %_libdir/pkgconfig/* -%_bindir/clamav-config +%{_bindir}/clamav-config ## ----------------------- %files filesystem -%attr(-,%username,%username) %dir %homedir -%attr(-,root,root) %dir %pkgdatadir +%attr(-,%username,%username) %dir %{homedir} +%attr(-,root,root) %dir %{pkgdatadir} ## ----------------------- @@ -740,28 +792,28 @@ # use %%config to keep files which were updated by 'freshclam' # already. Without this tag, they would be overridden with older # versions whenever a new -data package is installed. -%config %verify(not size md5 mtime) %homedir/*.cvd +%config %verify(not size md5 mtime) %{homedir}/*.cvd %files data-empty %defattr(-,%username,%username,-) -%ghost %attr(0664,%username,%username) %homedir/*.cvd +%ghost %attr(0664,%username,%username) %{homedir}/*.cvd ## ----------------------- %files update %defattr(-,root,root,-) -%_bindir/freshclam +%{_bindir}/freshclam %_mandir/*/freshclam* -%pkgdatadir/freshclam-sleep -%config(noreplace) %verify(not mtime) %_sysconfdir/freshclam.conf -%config(noreplace) %verify(not mtime) %_sysconfdir/logrotate.d/* -%config(noreplace) %_sysconfdir/cron.d/clamav-update -%config(noreplace) %_sysconfdir/sysconfig/freshclam +%{pkgdatadir}/freshclam-sleep +%config(noreplace) %verify(not mtime) %{_sysconfdir}/freshclam.conf +%config(noreplace) %verify(not mtime) %{_sysconfdir}/logrotate.d/* +%config(noreplace) %{_sysconfdir}/cron.d/clamav-update +%config(noreplace) %{_sysconfdir}/sysconfig/freshclam %ghost %attr(0664,root,%username) %verify(not size md5 mtime) %freshclamlog -%ghost %attr(0664,%username,%username) %homedir/*.cld +%ghost %attr(0664,%username,%username) %{homedir}/*.cld ## ----------------------- @@ -770,54 +822,56 @@ %defattr(-,root,root,-) %doc _doc_server/* %_mandir/man[58]/clamd* -%_sbindir/* -%dir %_sysconfdir/clamd.d +%{_sbindir}/* +%dir %{_sysconfdir}/clamd.d -%exclude %_sbindir/*milter* +%exclude %{_sbindir}/*milter* %exclude %_mandir/man8/clamav-milter* - +%if 0%{?with_systemd} < 1 %files server-sysvinit %defattr(-,root,root,-) -%_initrddir/clamd-wrapper -%pkgdatadir/clamd-wrapper - -%if 0%{?with_systemd:1} +%{_initrddir}/clamd-wrapper +%{pkgdatadir}/clamd-wrapper +%else %files server-systemd - %defattr(-,root,root,-) - %_unitdir/clamd@.service +%defattr(-,root,root,-) +%if 0%{?suse_version} +%dir %{_unitdir} +%endif +%{_unitdir}/clamd@.service %endif ## ----------------------- %files scanner %defattr(-,root,root,-) -%config(noreplace) %_sysconfdir/clamd.d/scan.conf +%config(noreplace) %{_sysconfdir}/clamd.d/scan.conf %ghost %scanstatedir/clamd.sock %if 0%{?with_tmpfiles:1} - %_sysconfdir/tmpfiles.d/clamd.scan.conf + %{_sysconfdir}/tmpfiles.d/clamd.scan.conf %ghost %dir %attr(0710,%scanuser,%scanuser) %scanstatedir %else %dir %attr(0710,%scanuser,%scanuser) %scanstatedir %endif -%if 0%{?with_sysv:1} +%if 0%{?with_systemd} < 1 && 0%{?with_upstart} < 1 %files scanner-sysvinit - %attr(0755,root,root) %config %_initrddir/clamd.scan - %ghost %scanstatedir/clamd.pid +%attr(0755,root,root) %config %{_initrddir}/clamd.scan +%ghost %scanstatedir/clamd.pid %endif -%if 0%{?with_upstart:1} +%if 0%{?with_upstart} %files scanner-upstart - %defattr(-,root,root,-) - %config(noreplace) %_sysconfdir/init/clamd.scan* +%defattr(-,root,root,-) +%config(noreplace) %{_sysconfdir}/init/clamd.scan* %endif -%if 0%{?with_systemd:1} +%if 0%{?with_systemd} %files scanner-systemd - %defattr(-,root,root,-) - %_unitdir/clamd@scan.service +%defattr(-,root,root,-) +%{_unitdir}/clamd@scan.service %endif ## ----------------------- @@ -825,36 +879,36 @@ %files milter %defattr(-,root,root,-) %doc clamav-milter/README.fedora -%_sbindir/*milter* +%{_sbindir}/*milter* %_mandir/man8/clamav-milter* -%config(noreplace) %_sysconfdir/mail/clamav-milter.conf -%ghost %attr(0620,root,%milteruser) %verify(not size md5 mtime) %milterlog +%config(noreplace) %{_sysconfdir}/mail/clamav-milter.conf +%ghost %attr(0620,root,%{milteruser}) %verify(not size md5 mtime) %milterlog %ghost %milterstatedir/clamav-milter.socket %if 0%{?with_tmpfiles:1} - %_sysconfdir/tmpfiles.d/clamav-milter.conf - %ghost %dir %attr(0710,%milteruser,%milteruser) %milterstatedir + %{_sysconfdir}/tmpfiles.d/clamav-milter.conf + %ghost %dir %attr(0710,%{milteruser},%{milteruser}) %milterstatedir %else - %dir %attr(0710,%milteruser,%milteruser) %milterstatedir + %dir %attr(0710,%{milteruser},%{milteruser}) %milterstatedir %endif -%if 0%{?with_sysv:1} +%if 0%{?with_systemd} < 1 && 0%{?with_upstart} < 1 %files milter-sysvinit - %defattr(-,root,root,-) - %config %_initrddir/clamav-milter - %ghost %milterstatedir/clamav-milter.pid +%defattr(-,root,root,-) +%config %{_initrddir}/clamav-milter +%ghost %milterstatedir/clamav-milter.pid %endif -%if 0%{?with_upstart:1} +%if 0%{?with_upstart} %files milter-upstart - %defattr(-,root,root,-) - %config(noreplace) %_sysconfdir/init/clamav-milter* +%defattr(-,root,root,-) +%config(noreplace) %{_sysconfdir}/init/clamav-milter* %endif -%if 0%{?with_systemd:1} +%if 0%{?with_systemd} %files milter-systemd - %defattr(-,root,root,-) - %_unitdir/clamav-milter.service +%defattr(-,root,root,-) +%{_unitdir}/clamav-milter.service %endif @@ -1056,7 +1110,7 @@ * Sat Aug 8 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.95.2-4 - renamed 'clamav' user/group to 'clamupdate' -- add the '%milteruser' user to the '%scanuser' group when the -scanner +- add the '%{milteruser}' user to the '%scanuser' group when the -scanner subpackage is installed * Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.95.2-2
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.