# Package User Registry: http://fedoraproject.org/wiki/PackageUserRegistry %define registry_uid 39 %define registry_name tofmipd %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Name: tmda Version: 1.1.12 Release: 5%{?dist} Summary: Tagged Message Delivery Agent Group: Applications/System License: GPLv2+ URL: http://tmda.net Source0: ftp://tmda.net/pub/tmda/releases/%{name}-%{version}.tgz Patch0: tofmipd.init.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: python-devel Requires: python %description TMDA is an open source anti-spam system and local mail delivery agent. %prep %setup -q %patch0 -p1 -b .init-updates %build # fix shbang line in all executable files find . -type f -perm 0755 -print | while read i do sed '1,1s|/usr/bin/env python|%{__python}|g' $i > $i.tmp && mv $i.tmp $i && chmod 0755 $i done # remove x bits from all files in contrib as they will be used in %%doc find contrib -type f -print | xargs chmod a-x # fix dos eol problems on some documents for file in doc/html/attachments/{TmdaFingerprint/tmda-fingerprint,TmdaPostfixPolicy/tmda-postfix-policy.sh}; do sed -i 's/\r//' $file done # zero byte file but not used or linkd rm -f doc/html/error.log %install rm -rf $RPM_BUILD_ROOT # Note: You will notice below that TMDA/pythonlib/email is from the python # libraries. TMDA requires an extremely stable API because of it's extensive # use of these libraries. Experience over many years has shown that even # point releases can destabilize these libraries. Therefore they are included # here. Depending on the TMDA release, there may also be bug fixes that appear # here that are not in the current pythonlib. install -d $RPM_BUILD_ROOT/%{_bindir} install -d $RPM_BUILD_ROOT/%{_datadir}/tmda install -d $RPM_BUILD_ROOT/%{_datadir}/emacs/site-lisp install -d $RPM_BUILD_ROOT/%{python_sitelib}/TMDA/Queue install -d $RPM_BUILD_ROOT/%{python_sitelib}/TMDA/pythonlib/email/mime install -d $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig install -d $RPM_BUILD_ROOT/%{_initrddir} install -p -m 0755 bin/tmda-* $RPM_BUILD_ROOT/%{_bindir} install -p -m 0644 templates/*.txt $RPM_BUILD_ROOT/%{_datadir}/tmda install -p -m 0644 TMDA/*py $RPM_BUILD_ROOT/%{python_sitelib}/TMDA install -p -m 0644 TMDA/Queue/*py $RPM_BUILD_ROOT/%{python_sitelib}/TMDA/Queue install -p -m 0644 TMDA/pythonlib/email/*py $RPM_BUILD_ROOT/%{python_sitelib}/TMDA/pythonlib/email install -p -m 0644 TMDA/pythonlib/email/mime/*py $RPM_BUILD_ROOT/%{python_sitelib}/TMDA/pythonlib/email/mime install -p -m 0755 contrib/print{cdb,dbm} $RPM_BUILD_ROOT/%{_bindir} install -p -m 0755 contrib/collectaddys $RPM_BUILD_ROOT/%{_bindir} install -p -m 0644 contrib/tmda.el $RPM_BUILD_ROOT/%{_datadir}/emacs/site-lisp install -p -m 0755 contrib/tofmipd.init $RPM_BUILD_ROOT/%{_initrddir}/tofmipd install -p -m 0644 contrib/tofmipd.sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/tofmipd %if 0%{?rhel} && "%rhel" < "5" # Conditionally bytecompile if compiling for EL-4 since it does not have # a brp-python-bytecompile - this is essentially ripped off from the FC-6 # /usr/lib/brp-python-bytecompile script # Figure out how deep we need to descend. We could pick an insanely high # number and hope it's enough, but somewhere, somebody's sure to run into it. depth=`(find $RPM_BUILD_ROOT -type f -name "*.py" -print0 ; echo /) | \ xargs -0 -n 1 dirname | sed 's,[^/],,g' | sort -u | tail -n 1 | wc -c` if [ -z "$depth" -o "$depth" -le "1" ]; then exit 0 fi # Generate normal (.pyc) byte-compiled files. %{__python} -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"$depth"', "/", 1)' > /dev/null # Generate optimized (.pyo) byte-compiled files. %{__python} -O -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"$depth"', "/", 1)' > /dev/null %endif %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %{python_sitelib}/* %{_bindir}/* %{_datadir}/%{name} %doc ChangeLog CODENAMES COPYING CRYPTO INSTALL NEWS README THANKS UPGRADE %doc contrib doc %package emacs Summary: Tagged Message Deliver Agent - Emacs Support Files Group: Applications/System Requires: tmda = %{version}-%{release}, emacs %description emacs TMDA is an open source anti-spam system and local mail delivery agent. This module contains useful helper routines for using TMDA from Gnus (and perhaps other Emacs based mail/news readers). %files emacs %defattr(-,root,root,-) %{_datadir}/emacs/site-lisp/tmda.el %package ofmipd Summary: Tagged Message Delivery Agent - ofmipd server Group: System Environment/Daemons Url: http://www.tmda.net/tmda-ofmipd.html Requires: tmda = %{version}-%{release} Requires : initscripts Requires(post): /sbin/chkconfig Requires(preun):/sbin/chkconfig Requires(pre): fedora-usermgmt Requires(postun):fedora-usermgmt %description ofmipd TMDA is an open source anti-spam system and local mail delivery agent. tmda-ofmipd is an async I/O based authenticated ofmip proxy for TMDA. This allows users of any mail client capable of SMTP Authentication to "tag" their outgoing mail in the TMDA-style. %files ofmipd %defattr(0644,root,root) # note that the tmda-ofmipd program is in %{_bindir} - that is because the # program can be run by individual users as well as a system service %attr(0755,root,root) %{_bindir}/tmda-ofmipd %attr(0755,root,root) %{_initrddir}/tofmipd %config(noreplace) %{_sysconfdir}/sysconfig/tofmipd %pre ofmipd /usr/sbin/fedora-groupadd %registry_uid -r %registry_name &> /dev/null || : /usr/sbin/fedora-useradd %registry_uid -r -s /sbin/nologin -d / -M \ -c "TMDA OFMIP Daemon" -g %registry_name %registry_name &> /dev/null || : %post ofmipd if [ "$1" -ge "1" ]; then /sbin/chkconfig --add tofmipd &> /dev/null || : fi %preun ofmipd if [ "$1" -eq "0" ]; then %{_initrddir}/tofmipd stop &> /dev/null || : /sbin/chkconfig --del tofmipd &> /dev/null || : fi %postun ofmipd if [ "$1" -eq "0" ]; then /usr/sbin/fedora-userdel %registry_name &> /dev/null || : /usr/sbin/fedora-groupdel %registry_name &> /dev/null || : else %{_initrddir}/tofmipd condrestart &> /dev/null || : fi %changelog * Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 1.1.12-5 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.12-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.12-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 1.1.12-2 - Rebuild for Python 2.6 * Sun Aug 19 2007 Bernard Johnson <bjohnson@symetrix.com> 1.1.12-1 - 1.1.12 - update license tag - updates to init to be lsb compliant (bz #247075) * Wed Jun 20 2007 Bernard Johnson <bjohnson@symetrix.com> 1.1.11-4 - assign package uid * Fri Apr 06 2007 Bernard Johnson <bjohnson@symetrix.com> 1.1.11-3 - remove versioned python dependencies, no supported python is unsupported - if compiling for EL-4, compile python since there is no brp-python-bytecompile * Thu Mar 01 2007 Bernard Johnson <bjohnson@symetrix.com> 1.1.11-2 - fix source0 line * Sun Feb 25 2007 Bernard Johnson <bjohnson@symetrix.com> 1.1.11-1 - version 1.1.11 - remove option parser patch (upstream) - remove init file patch (upstream) - include INSTALL file now that it represents correct information - fix eol problems on some of the new docs - remove zero byte log file * Sat Feb 24 2007 Bernard Johnson <bjohnson@symetrix.com> 1.1.10-5 - patch option parser to accept multiple -e options * Mon Feb 19 2007 Bernard Johnson <bjohnson@symetrix.com> 1.1.10-4.2 - bump rel * Sun Feb 18 2007 Bernard Johnson <bjohnson@symetrix.com> 1.1.10-4 - missed a %%{version}-%%{release} dependency, fixed it * Sat Feb 17 2007 Bernard Johnson <bjohnson@symetrix.com> 1.1.10-3 - added NEWS to %%doc - macro cleanup - exact version dependency for subpackage * Sat Feb 17 2007 Bernard Johnson <bjohnson@symetrix.com> 1.1.10-2 - consistent start/stop of daemon in scriptlets - move requirements created by scripts to daemon package that requires them - don't include the INSTALL file - it's information can be found elsewhere - %%{python_sitelib}/TMDA/pythonlib/email/mime files were improperly packaged - dependency on initscripts because of use of daemon function - note regarding tmda inclusion of pythonlib/email - change tofmipd user to / home directory * Thu Feb 15 2007 Bernard Johnson <bjohnson@symetrix.com> 1.1.10-1 - version 1.1.10 - substitute RPM_BUILD_ROOT for %%{buildroot} macro - preserve file timestamps - change tofmipd user to /etc home directory - switch to fedora-usermgmt user management - add Require(post,preun) of /sbin/chkconfig * Tue Nov 28 2006 Bernard Johnson <bjohnson@symetrix.com> 1.1.9-1 - initial release