Fedora core changes
This commit is contained in:
+54
-16
@@ -1,21 +1,33 @@
|
|||||||
%define __python python
|
# EL 3,4,5 supported, set to 0 for Fedora
|
||||||
#define __python python2.4
|
%define RHEL 0
|
||||||
|
|
||||||
|
%if %{RHEL} > 0 && %{RHEL} < 5
|
||||||
|
%define __python python2.4
|
||||||
|
%endif
|
||||||
|
|
||||||
%define libdir %{_libdir}/pymilter
|
%define libdir %{_libdir}/pymilter
|
||||||
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||||
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
|
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
|
||||||
|
%define pythonbase %(basename %{__python})
|
||||||
|
|
||||||
Summary: Python interface to sendmail milter API
|
Summary: Python interface to sendmail milter API
|
||||||
Name: pymilter
|
Name: pymilter
|
||||||
Version: 0.9.0
|
Version: 0.9.0
|
||||||
Release: 2%{dist}
|
Release: 4%{dist}
|
||||||
Source: http://downloads.sourceforge.net/pymilter/%{name}-%{version}.tar.gz
|
Source: http://downloads.sourceforge.net/pymilter/%{name}-%{version}.tar.gz
|
||||||
#Patch: %{name}-%{version}.patch
|
Patch: %{name}-smutil.patch
|
||||||
|
Patch1: %{name}-start.patch
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||||
Url: http://www.bmsi.com/python/milter.html
|
Url: http://www.bmsi.com/python/milter.html
|
||||||
Requires: %{__python} >= 2.4, sendmail >= 8.13
|
%if %{RHEL} > 0
|
||||||
BuildRequires: ed, %{__python}-devel >= 2.4, sendmail-devel >= 8.13
|
Requires: %{pythonbase} >= 2.4, sendmail >= 8.13
|
||||||
|
BuildRequires: ed, %{pythonbase}-devel >= 2.4, sendmail-devel >= 8.13
|
||||||
|
%else
|
||||||
|
Requires: %{pythonbase}, sendmail
|
||||||
|
BuildRequires: ed, %{pythonbase}-devel, sendmail-devel
|
||||||
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This is a python extension module to enable python scripts to
|
This is a python extension module to enable python scripts to
|
||||||
@@ -25,18 +37,32 @@ DSNs, and doing CBV.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
#patch -p0 -b .bms
|
%patch -p0 -b .smutil
|
||||||
|
%patch1 -p0 -b .start
|
||||||
|
|
||||||
%build
|
%build
|
||||||
env CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
|
env CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
%{__python} setup.py install --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
|
%{__python} setup.py install --root=$RPM_BUILD_ROOT
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/run/milter
|
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/milter
|
||||||
|
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/milter
|
||||||
mkdir -p $RPM_BUILD_ROOT%{libdir}
|
mkdir -p $RPM_BUILD_ROOT%{libdir}
|
||||||
cp start.sh $RPM_BUILD_ROOT%{libdir}
|
cp start.sh $RPM_BUILD_ROOT%{libdir}
|
||||||
ed $RPM_BUILD_ROOT%{libdir}/start.sh <<'EOF'
|
ed $RPM_BUILD_ROOT%{libdir}/start.sh <<'EOF'
|
||||||
|
/^datadir=/
|
||||||
|
c
|
||||||
|
datadir="%{_localstatedir}/log/milter"
|
||||||
|
.
|
||||||
|
/^piddir=/
|
||||||
|
c
|
||||||
|
piddir="%{_localstatedir}/run/milter"
|
||||||
|
.
|
||||||
|
/^libdir=/
|
||||||
|
c
|
||||||
|
libdir="%{libdir}"
|
||||||
|
.
|
||||||
/^python=/
|
/^python=/
|
||||||
c
|
c
|
||||||
python="%{__python}"
|
python="%{__python}"
|
||||||
@@ -45,43 +71,55 @@ w
|
|||||||
q
|
q
|
||||||
EOF
|
EOF
|
||||||
chmod a+x $RPM_BUILD_ROOT%{libdir}/start.sh
|
chmod a+x $RPM_BUILD_ROOT%{libdir}/start.sh
|
||||||
grep '.pyc$' INSTALLED_FILES | sed -e 's/c$/o/' >>INSTALLED_FILES
|
|
||||||
|
|
||||||
# start.sh is used by spfmilter and milter, and could be used by
|
# start.sh is used by spfmilter and milter, and could be used by
|
||||||
# other milters running on redhat
|
# other milters using pymilter.
|
||||||
%files -f INSTALLED_FILES
|
%files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc README ChangeLog NEWS TODO CREDITS sample.py milter-template.py
|
%doc README ChangeLog NEWS TODO CREDITS sample.py milter-template.py
|
||||||
%dir %{python_sitelib}/Milter
|
%{python_sitearch}/*
|
||||||
%dir %{libdir}
|
%{libdir}
|
||||||
%config %{libdir}/start.sh
|
%dir %attr(0755,mail,mail) %{_localstatedir}/run/milter
|
||||||
%dir %attr(0755,mail,mail) /var/run/milter
|
%dir %attr(0755,mail,mail) %{_localstatedir}/log/milter
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jan 07 2009 Stuart Gathman <stuart@bmsi.com> 0.9.0-4
|
||||||
|
- Stop using INSTALLED_FILES to make Fedora happy
|
||||||
|
- Remove config flag from start.sh glue
|
||||||
|
- Own /var/log/milter
|
||||||
|
- Use %{_localstatedir}
|
||||||
|
|
||||||
* Wed Jan 07 2009 Stuart Gathman <stuart@bmsi.com> 0.9.0-2
|
* Wed Jan 07 2009 Stuart Gathman <stuart@bmsi.com> 0.9.0-2
|
||||||
- Changes to meet Fedora standards
|
- Changes to meet Fedora standards
|
||||||
|
|
||||||
* Mon Nov 24 2008 Stuart Gathman <stuart@bmsi.com> 0.9.0-1
|
* Mon Nov 24 2008 Stuart Gathman <stuart@bmsi.com> 0.9.0-1
|
||||||
- Split pymilter into its own CVS module
|
- Split pymilter into its own CVS module
|
||||||
- Support chgfrom and addrcpt_par
|
- Support chgfrom and addrcpt_par
|
||||||
- Support NS records in Milter.dns
|
- Support NS records in Milter.dns
|
||||||
|
|
||||||
* Mon Aug 25 2008 Stuart Gathman <stuart@bmsi.com> 0.8.10-2
|
* Mon Aug 25 2008 Stuart Gathman <stuart@bmsi.com> 0.8.10-2
|
||||||
- /var/run/milter directory must be owned by mail
|
- /var/run/milter directory must be owned by mail
|
||||||
|
|
||||||
* Mon Aug 25 2008 Stuart Gathman <stuart@bmsi.com> 0.8.10-1
|
* Mon Aug 25 2008 Stuart Gathman <stuart@bmsi.com> 0.8.10-1
|
||||||
- improved parsing into email and fullname (still 2 self test failures)
|
- improved parsing into email and fullname (still 2 self test failures)
|
||||||
- implement no-DSN CBV, reduce full DSNs
|
- implement no-DSN CBV, reduce full DSNs
|
||||||
|
|
||||||
* Mon Sep 24 2007 Stuart Gathman <stuart@bmsi.com> 0.8.9-1
|
* Mon Sep 24 2007 Stuart Gathman <stuart@bmsi.com> 0.8.9-1
|
||||||
- Use ifarch hack to build milter and milter-spf packages as noarch
|
- Use ifarch hack to build milter and milter-spf packages as noarch
|
||||||
- Remove spf dependency from dsn.py, add dns.py
|
- Remove spf dependency from dsn.py, add dns.py
|
||||||
|
|
||||||
* Fri Jan 05 2007 Stuart Gathman <stuart@bmsi.com> 0.8.8-1
|
* Fri Jan 05 2007 Stuart Gathman <stuart@bmsi.com> 0.8.8-1
|
||||||
- move AddrCache, parse_addr, iniplist to Milter package
|
- move AddrCache, parse_addr, iniplist to Milter package
|
||||||
- move parse_header to Milter.utils
|
- move parse_header to Milter.utils
|
||||||
- fix plock for missing source and can't change owner/group
|
- fix plock for missing source and can't change owner/group
|
||||||
- split out pymilter and pymilter-spf packages
|
- split out pymilter and pymilter-spf packages
|
||||||
- move milter apps to /usr/lib/pymilter
|
- move milter apps to /usr/lib/pymilter
|
||||||
|
|
||||||
* Sat Nov 04 2006 Stuart Gathman <stuart@bmsi.com> 0.8.7-1
|
* Sat Nov 04 2006 Stuart Gathman <stuart@bmsi.com> 0.8.7-1
|
||||||
- SPF moved to pyspf RPM
|
- SPF moved to pyspf RPM
|
||||||
|
|
||||||
* Tue May 23 2006 Stuart Gathman <stuart@bmsi.com> 0.8.6-2
|
* Tue May 23 2006 Stuart Gathman <stuart@bmsi.com> 0.8.6-2
|
||||||
- Support CBV timeout
|
- Support CBV timeout
|
||||||
|
|||||||
@@ -2,10 +2,11 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
from distutils.core import setup, Extension
|
from distutils.core import setup, Extension
|
||||||
|
|
||||||
# FIXME: on some versions of sendmail, smutil is renamed to sm
|
# FIXME: on some versions of sendmail, smutil is renamed to sm.
|
||||||
# on slackware and debian, leave it out entirely. It depends
|
# On slackware and debian, leave it out entirely. It depends
|
||||||
# on how libmilter was built by the sendmail package.
|
# on how libmilter was built by the sendmail package.
|
||||||
libs = ["milter", "smutil"]
|
#libs = ["milter", "smutil"]
|
||||||
|
libs = ["milter"]
|
||||||
libdirs = ["/usr/lib/libmilter"] # needed for Debian
|
libdirs = ["/usr/lib/libmilter"] # needed for Debian
|
||||||
|
|
||||||
# patch distutils if it can't cope with the "classifiers" or
|
# patch distutils if it can't cope with the "classifiers" or
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
appname="$1"
|
appname="$1"
|
||||||
script="${2:-${appname}}"
|
script="${2:-${appname}}"
|
||||||
datadir=/var/log/milter
|
datadir="/var/log/milter"
|
||||||
|
piddir="/var/run/milter"
|
||||||
|
libdir="/usr/lib/pymilter"
|
||||||
python="python2.4"
|
python="python2.4"
|
||||||
exec >>${datadir}/${appname}.log 2>&1
|
exec >>${datadir}/${appname}.log 2>&1
|
||||||
if test -s ${datadir}/${script}.py; then
|
if test -s ${datadir}/${script}.py; then
|
||||||
cd ${datadir} # use version in log dir if it exists for debugging
|
cd ${datadir} # use version in log dir if it exists for debugging
|
||||||
else
|
else
|
||||||
cd /usr/lib/pymilter
|
cd ${libdir}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${python} ${script}.py &
|
${python} ${script}.py &
|
||||||
echo $! >/var/run/milter/${appname}.pid
|
echo $! >${piddir}/${appname}.pid
|
||||||
|
|||||||
Reference in New Issue
Block a user