Split out files into SCM instead of in spec
This commit is contained in:
parent
9650322a3c
commit
b6a2788bdb
4
clamav-milter.sysconfig
Normal file
4
clamav-milter.sysconfig
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
### Simple config file for clamav-milter, you should
|
||||||
|
### read the documentation and tweak it as you wish.
|
||||||
|
|
||||||
|
CLAMAV_FLAGS=""
|
74
clamav.spec
74
clamav.spec
@ -5,7 +5,7 @@
|
|||||||
Summary: Anti-virus software
|
Summary: Anti-virus software
|
||||||
Name: clamav
|
Name: clamav
|
||||||
Version: 0.97.3
|
Version: 0.97.3
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
Group: Applications/System
|
Group: Applications/System
|
||||||
URL: http://www.clamav.net/
|
URL: http://www.clamav.net/
|
||||||
@ -16,6 +16,12 @@ Source0: clamav-0.97.3-norar.tar.xz
|
|||||||
Source1: clamav.init
|
Source1: clamav.init
|
||||||
Source2: clamav-milter.init
|
Source2: clamav-milter.init
|
||||||
Source3: clamd-wrapper.tar.bz2
|
Source3: clamd-wrapper.tar.bz2
|
||||||
|
|
||||||
|
Source7: freshclam.cron
|
||||||
|
Source8: freshclam.logrotate
|
||||||
|
Source9: clamd.logrotate
|
||||||
|
Source10: clamav-milter.sysconfig
|
||||||
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
|
|
||||||
BuildRequires: bzip2-devel, zlib-devel, gmp-devel, curl-devel, xz
|
BuildRequires: bzip2-devel, zlib-devel, gmp-devel, curl-devel, xz
|
||||||
@ -171,53 +177,6 @@ xz -dc %{SOURCE0} | (cd .. ; tar xvvf -)
|
|||||||
s|^#(ClamdSocket) .+$|$1 unix:%{_localstatedir}/run/clamav/clamd.sock|;
|
s|^#(ClamdSocket) .+$|$1 unix:%{_localstatedir}/run/clamav/clamd.sock|;
|
||||||
' etc/clamav-milter.conf
|
' etc/clamav-milter.conf
|
||||||
|
|
||||||
|
|
||||||
cat <<EOF >clamd.logrotate
|
|
||||||
%{_localstatedir}/log/clamav/clamd.log {
|
|
||||||
missingok
|
|
||||||
notifempty
|
|
||||||
create 644 clam clam
|
|
||||||
postrotate
|
|
||||||
killall -HUP clamd 2>/dev/null || :
|
|
||||||
endscript
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat <<EOF >freshclam.logrotate
|
|
||||||
%{_localstatedir}/log/clamav/freshclam.log {
|
|
||||||
missingok
|
|
||||||
notifempty
|
|
||||||
create 644 clam clam
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat <<'EOF' >freshclam.cron
|
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
### A simple update script for the clamav virus database.
|
|
||||||
### This could as well be replaced by a SysV script.
|
|
||||||
|
|
||||||
### fix log file if needed
|
|
||||||
LOG_FILE="%{_localstatedir}/log/clamav/freshclam.log"
|
|
||||||
if [ ! -f "$LOG_FILE" ]; then
|
|
||||||
touch "$LOG_FILE"
|
|
||||||
chmod 644 "$LOG_FILE"
|
|
||||||
chown clam.clam "$LOG_FILE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
%{_bindir}/freshclam \
|
|
||||||
--quiet \
|
|
||||||
--datadir="%{_localstatedir}/lib/clamav" \
|
|
||||||
--log="$LOG_FILE"
|
|
||||||
EOF
|
|
||||||
|
|
||||||
%{__cat} <<EOF >clamav-milter.sysconfig
|
|
||||||
### Simple config file for clamav-milter, you should
|
|
||||||
### read the documentation and tweak it as you wish.
|
|
||||||
|
|
||||||
CLAMAV_FLAGS=""
|
|
||||||
EOF
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%configure \
|
%configure \
|
||||||
--program-prefix="%{?_program_prefix}" \
|
--program-prefix="%{?_program_prefix}" \
|
||||||
@ -241,13 +200,21 @@ rm -rf %{buildroot}
|
|||||||
make install DESTDIR="%{buildroot}"
|
make install DESTDIR="%{buildroot}"
|
||||||
|
|
||||||
install -Dp -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/clamd
|
install -Dp -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/clamd
|
||||||
install -Dp -m0755 freshclam.cron %{buildroot}%{_sysconfdir}/cron.daily/freshclam
|
install -Dp -m0755 %{SOURCE7} %{buildroot}%{_sysconfdir}/cron.daily/freshclam
|
||||||
install -Dp -m0644 freshclam.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/freshclam
|
install -Dp -m0644 %{SOURCE8} %{buildroot}%{_sysconfdir}/logrotate.d/freshclam
|
||||||
install -Dp -m0644 clamd.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/clamav
|
install -Dp -m0644 %{SOURCE9} %{buildroot}%{_sysconfdir}/logrotate.d/clamav
|
||||||
|
|
||||||
|
# now rewrite scripts and config files in-place
|
||||||
|
sed -i \
|
||||||
|
-e 's!%%{_sbindir}!%{_sbindir}!g' \
|
||||||
|
-e 's!%%{_bindir}!%{_bindir}!g' \
|
||||||
|
-e 's!%%{_localstatedir}!%{_localstatedir}!g' \
|
||||||
|
%{buildroot}%{_sysconfdir}/cron.daily/freshclam \
|
||||||
|
%{buildroot}%{_sysconfdir}/logrotate.d/*
|
||||||
|
|
||||||
%if %{!?_without_milter:1}0
|
%if %{!?_without_milter:1}0
|
||||||
install -Dp -m0755 %{SOURCE2} %{buildroot}%{_initrddir}/clamav-milter
|
install -Dp -m0755 %{SOURCE2} %{buildroot}%{_initrddir}/clamav-milter
|
||||||
install -Dp -m0644 clamav-milter.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/clamav-milter
|
install -Dp -m0644 %{SOURCE10} %{buildroot}%{_sysconfdir}/sysconfig/clamav-milter
|
||||||
%else
|
%else
|
||||||
rm %{buildroot}%{_mandir}/man8/clamav-milter.8*
|
rm %{buildroot}%{_mandir}/man8/clamav-milter.8*
|
||||||
%endif
|
%endif
|
||||||
@ -409,6 +376,9 @@ rm -rf %{buildroot}
|
|||||||
%exclude %{_libdir}/libclamav.la
|
%exclude %{_libdir}/libclamav.la
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jan 19 2012 Nick Bebout <nb@fedoraproject.org> - 0.97.3-4
|
||||||
|
- Split files out into SCM instead of in the spec
|
||||||
|
|
||||||
* Sun Jan 1 2012 Nick Bebout <nb@fedoraproject.org> - 0.97.3-3
|
* Sun Jan 1 2012 Nick Bebout <nb@fedoraproject.org> - 0.97.3-3
|
||||||
- Revert patch from 0.97.3-2
|
- Revert patch from 0.97.3-2
|
||||||
|
|
||||||
|
8
clamd.logrotate
Normal file
8
clamd.logrotate
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
%{_localstatedir}/log/clamav/clamd.log {
|
||||||
|
missingok
|
||||||
|
notifempty
|
||||||
|
create 644 clam clam
|
||||||
|
postrotate
|
||||||
|
killall -HUP clamd 2>/dev/null || :
|
||||||
|
endscript
|
||||||
|
}
|
17
freshclam.cron
Normal file
17
freshclam.cron
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
### A simple update script for the clamav virus database.
|
||||||
|
### This could as well be replaced by a SysV script.
|
||||||
|
|
||||||
|
### fix log file if needed
|
||||||
|
LOG_FILE="%{_localstatedir}/log/clamav/freshclam.log"
|
||||||
|
if [ ! -f "$LOG_FILE" ]; then
|
||||||
|
touch "$LOG_FILE"
|
||||||
|
chmod 644 "$LOG_FILE"
|
||||||
|
chown clam.clam "$LOG_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
%{_bindir}/freshclam \
|
||||||
|
--quiet \
|
||||||
|
--datadir="%{_localstatedir}/lib/clamav" \
|
||||||
|
--log="$LOG_FILE"
|
5
freshclam.logrotate
Normal file
5
freshclam.logrotate
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
%{_localstatedir}/log/clamav/freshclam.log {
|
||||||
|
missingok
|
||||||
|
notifempty
|
||||||
|
create 644 clam clam
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user