Mail-MIMEDefang

 view release on metacpan or  search on metacpan

redhat/mimedefang-spec.in  view on Meta::CPAN

willingness of your e-mail users to commit to security, or they will
complain loudly about MIMEDefang.

%prep
%setup -q -n Mail-MIMEDefang-%{version}%{?prerelease}
perl Makefile.PL INSTALLDIRS=vendor \
     MIMEDEFANG_PL=%{_bindir}/mimedefang.pl \
     INSTALLVENDORLIB=%{perl_vendorlib}
%build
make DONT_STRIP=1

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{dir_log}
make DESTDIR=$RPM_BUILD_ROOT \
     BINDIR=%{_bindir} MANDIR=%{_mandir} \
     INSTALL='install -p' INSTALL_STRIP_FLAG='' install-redhat
rm -f %{buildroot}%{_libdir}/perl5/perllocal.pod
rm -f %{buildroot}%{_libdir}/perl5/vendor_perl/auto/Mail/MIMEDefang/.packlist
# Turn off execute bit on scripts in contrib
find contrib -type f -print0 | xargs -0 chmod a-x

%clean
HERE=`pwd`
cd ..
rm -rf $HERE
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc Changelog README* examples SpamAssassin
%dir %{dir_spool}
%dir %{dir_log}
%dir %{dir_quarantine}
%{_bindir}/*
%{perl_vendorlib}/*
%{_mandir}/*
%config(noreplace) /etc/mail/mimedefang-filter
%config(noreplace) /etc/mail/sa-mimedefang.cf
%config(noreplace) /etc/mail/sa-mimedefang.cf.example
%config(noreplace) /etc/sysconfig/%{name}
/etc/rc.d/init.d/%{name}
/etc/logrotate.d/%{name}

%pre
# Backward-compatibility
if test -d /var/spool/mimedefang -a ! -d /var/spool/MIMEDefang ; then
	mv /var/spool/mimedefang /var/spool/MIMEDefang || true
fi

if test -d /var/spool/quarantine -a ! -d /var/spool/MD-Quarantine ; then
	mv /var/spool/quarantine /var/spool/MD-Quarantine || true
fi

# Add user
useradd -M -r -d %{dir_spool} -s /bin/false -c "MIMEDefang User" %{user} > /dev/null 2>&1 || true

%post
# Tighten permissions
chown %{user} %{dir_spool}
chgrp %{user} %{dir_spool}
chmod 750 %{dir_spool}
chown %{user} %{dir_quarantine}
chgrp %{user} %{dir_quarantine}
chmod 750 %{dir_quarantine}
chown %{user} %{dir_log}
chgrp %{user} %{dir_log}
chmod 755 %{dir_log}

cat << EOF

In order to complete the installation of mimedefang, you will need to add the 
following line to your sendmail mc file:

   INPUT_MAIL_FILTER(\`mimedefang', \`S=unix:/var/spool/MIMEDefang/mimedefang.sock, F=T, T=S:1m;R:1m;E:5m')

Use the sendmail-cf package to rebuild your /etc/mail/sendmail.cf file and 
restart your sendmail daemon.

EOF
%if 0%{?rhel} > 6 || 0%{?fedora} > 23
%systemd_preun %{name}.service
%else
/sbin/chkconfig --add mimedefang
%endif

%preun
%if 0%{?rhel} > 6 || 0%{?fedora} > 23
%systemd_preun %{name}.service
%else
if [ $1 -eq 0 ]; then
  /sbin/service %{name} stop > /dev/null 2>&1 || :
  /sbin/chkconfig --del %{name}
fi
%endif

%package contrib
Summary:	Contributed software that works with MIMEDefang
Version:	#VERSION#
Release:	#RELEASE#
Group:          Networking/Mail

%description contrib
This package contains contributed software that works with MIMEDefang,
such as the graphdefang graphing package and a sample filter.

%files contrib
%defattr(-,root,root)
%doc contrib

%changelog
* Sun Apr 16 2023 Giovanni Bechis <g.bechis@snb.it>
- update Perl module requirements
* Wed May 29 2002 Dianne Skoll <dfs@roaringpenguin.com>
- Put pid files and sockets in /var/spool/MIMEDefang so we can
  drop privileges early.
* Wed May 15 2002 Dianne Skoll <dfs@roaringpenguin.com>
- Change log directory to /var/log/mimedefang/ to more easily accommodate
  -U flag.
* Tue May 14 2002 Michael McLagan <Michael.McLagan@linux.org>
- Fixed preinstall script
* Thu May 09 2002 Dianne Skoll <dfs@roaringpenguin.com>
- Install SpamAssassin config file
- Changed spool dir to /var/spool/MIMEDefang and quarantine dir
  to /var/spool/MD-Quarantine
* Thu May 09 2002 Michael McLagan <Michael.McLagan@linux.org>



( run in 0.913 second using v1.01-cache-2.11-cpan-92ad3014f07 )