# NOTE THAT THE TEST SUITE IS CURRENTLY BROKEN # USE rpmbuild --with checks TO SEE THIS FOR YOURSELF # Set to 1 for a compat-libspf2 package %define compat 0 # Use rpmbuild --with checks to try running the broken test suite (disabled by default) %{!?_without_checks: %{!?_with_checks: %define _without_checks --without-checks}} %{?_with_checks: %define enable_checks 1} %{?_without_checks: %define enable_checks 0} %if %{compat} Name: compat-libspf2 %else Name: libspf2 %endif Version: 1.2.5 Release: 3.zid Packager: Johann Klasek Summary: An implementation of the SPF specification License: BSD & LGPL Group: System Environment/Libraries Url: http://www.libspf2.org/ Source0: http://www.libspf2.org/spf/libspf2-%{version}.tar.gz Patch0: libspf2-1.2.5-bogus-header.patch Patch1: libspf2-1.2.5-64bit.patch Patch2: libspf2-1.2.5-res_ninit.patch Patch3: libspf2-1.2.5-malloc.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if %{enable_checks} BuildRequires: perl %endif %if %{compat} Provides: spf, libspf2 = %{version}-%{release} %else Provides: spf %endif %description libspf2 is an implementation of the SPF (Sender Policy Framework) specification as found at: http://www.ietf.org/internet-drafts/draft-mengwong-spf-00.txt SPF allows email systems to check SPF DNS records and make sure that an email is authorized by the administrator of the domain name that it is coming from. This prevents email forgery, commonly used by spammers, scammers, and email viruses/worms. A lot of effort has been put into making it secure by design, and a great deal of effort has been put into the regression tests. %if ! %{compat} %package devel Summary: Development tools needed to build programs that use libspf2 Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel The libspf2-devel package contains the header files and static libraries necessary for developing programs using the libspf2 (Sender Policy Framework) library. If you want to develop programs that will look up and process SPF records, you should install libspf2-devel. You also need to install the libspf2 package. %package progs Summary: Programs for making SPF queries using libspf2 Group: Applications/Internet Requires: %{name} = %{version}-%{release} Requires(post): /usr/sbin/alternatives Requires(preun): /usr/sbin/alternatives Requires(postun): /usr/sbin/alternatives, /usr/bin/readlink %description progs Programs for making SPF queries and checking their results using libspf2. %endif %prep %setup -q -n libspf2-%{version} # Remove bogus reference to spf_dns_internal.h %patch0 -p1 -b .bogus-header # Don't segfault on 64-bit architectures %patch1 -p1 -b .64bit # Don't segfault on resolver usage (e.g. on Solaris) %patch2 -p1 -b .res_ninit # Don't segfault on failed malloc calls %patch3 -p1 -b .malloc %build # The configure script checks for the existence of __ns_get16 and uses the # system-supplied version if found, otherwise one from src/libreplace. # However, this function is marked GLIBC_PRIVATE in recent versions of glibc # and shouldn't be called even if the configure script finds it. So we make # sure that the configure script always uses the version in src/libreplace. # This prevents us getting an unresolvable dependency in the built RPM. ac_cv_func___ns_get16=no export ac_cv_func___ns_get16 ./configure --prefix=%{_prefix} --libdir=%{_libdir} --bindir=%{_bindir} --includedir=%{_includedir} %{__make} %{?_smp_mflags} %install %{__rm} -rf %{buildroot} %{__make} DESTDIR=%{buildroot} install %{__rm} -f %{buildroot}/%{_bindir}/spf*_static %{__mv} -f %{buildroot}/%{_bindir}/spfquery %{buildroot}/%{_bindir}/spfquery.libspf2 %{__mv} -f %{buildroot}/%{_bindir}/spfd %{buildroot}/%{_bindir}/spfd.libspf2 # Remove files not needed for compat package %if %{compat} %{__rm} -rf %{buildroot}/%{_bindir} %{__rm} -rf %{buildroot}/%{_includedir}/spf2 %{__rm} -rf %{buildroot}/%{_libdir}/*.a %{__rm} -rf %{buildroot}/%{_libdir}/*.la %{__rm} -rf %{buildroot}/%{_libdir}/*.so %endif %if %{enable_checks} %check || : %{__make} check %endif %clean %{__rm} -rf %{buildroot} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %if ! %{compat} %post progs /usr/sbin/alternatives --install %{_bindir}/spfquery spf %{_bindir}/spfquery.libspf2 20 \ --slave %{_bindir}/spfd spf-daemon %{_bindir}/spfd.libspf2 exit 0 %preun progs if [ $1 = 0 ]; then /usr/sbin/alternatives --remove spf %{_bindir}/spfquery.libspf2 fi exit 0 %postun progs if [ "$1" -ge "1" ]; then spf=`readlink /etc/alternatives/spf` if [ "$spf" == "%{_bindir}/spfquery.libspf2" ]; then /usr/sbin/alternatives --set spf %{_bindir}/spfquery.libspf2 fi fi exit 0 %triggerpostun -- libspf2-progs <= 1.0.4-3 /usr/sbin/alternatives --auto spf %endif %files %defattr(-,root,root,-) %{_libdir}/libspf2.so.* %doc README Changelog docs/*.txt INSTALL LICENSES TODO %if ! %{compat} %files devel %defattr(-,root,root,-) %{_includedir}/spf2/spf*.h %{_libdir}/libspf2.a %{_libdir}/libspf2.so %exclude %{_libdir}/libspf2.la %doc docs/API %files progs %defattr(-,root,root,-) %{_bindir}/spfd.libspf2 %{_bindir}/spfquery.libspf2 %{_bindir}/spftest %{_bindir}/spf_example %endif %changelog * Sat Oct 20 2007 Johann Klasek 1.2.5-3.zid - Correcting resolver setup with res_ninit(). * Mon Feb 12 2007 Paul Howarth 1.2.5-3 - Cosmetic spec file cleanup - Use patch instead of scripted edit to remove bogus include file reference - Patch to make 64-bit clean (http://permalink.gmane.org/gmane.mail.spam.spf.devel/1212) - Remove buildroot unconditionally in %%clean and %%install - Don't include libtool archive in -devel package - Disable running of test suite by default * Wed Aug 3 2005 Paul Howarth 1.2.5-2 - Workaround for %%check with rpm-build <= 4.1.1 - Remove reference to not-installed spf_dns_internal.h in spf_server.h - Minimize rpmlint issues * Thu Feb 24 2005 Paul Howarth 1.2.5-1 - Update to 1.2.5 - Patches removed; now included upstream * Sun Feb 20 2005 Paul Howarth 1.2.1-1 - Update to 1.2.1 - Remove case-sensitivity patch - spf_example_2mx no longer included * Sun Feb 20 2005 Paul Howarth 1.0.4-9 - Enhance detection of Mandrake build system - Add support for building compat-libspf2 package - alternatives is a prerequisite for the -progs subpackage only * Thu Oct 28 2004 Paul Howarth 1.0.4-8 - Downgrade alternatives priority to 20 so that other implementations of spfquery will be preferred; there is still a case-sensitivity bug in libspf2 and no sign of an imminent fix * Mon Aug 16 2004 Paul Howarth 1.0.4-7 - Configure fix to find -lresolv on x64_64 - Portability fixes for x64_64 * Sun Aug 1 2004 Paul Howarth 1.0.4-6 - Fix case-sensitivity bug. * Wed Jul 28 2004 Paul Howarth 1.0.4-5 - Revert -pthread option as it didn't improve anything. * Tue Jul 27 2004 Paul Howarth 1.0.4-4 - Use `alternatives' so that the spfquery and spfd programs can co-exist with versions from other implementations. - Ensure thread-safe operation by building with -pthread. * Thu Jul 15 2004 Paul Howarth 1.0.4-3 - Install the libtool library in the devel package so that dependent libraries are found properly. - Use the libtool supplied with the package rather than the system libtool. * Tue Jul 13 2004 Paul Howarth 1.0.4-2 - Cosmetic changes for building on Mandrake Linux - Require rpm-build >= 4.1.1 for building to avoid strange error messages from old versions of rpm when they see %%check - Require glibc-devel and make for building - Require perl for building with checks enabled - Improved description text for the packages * Fri Jul 09 2004 Paul Howarth 1.0.4-1 - Update to 1.0.4 - Added facility to build without running test suite (rpmbuild --without checks) * Sat Jul 03 2004 Paul Howarth 1.0.3-1 - Initial RPM build.