| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- ##
- ## milter.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- ## SUCH DAMAGE.
- ##
- # package version
- %define V_libmilter 8.14.3
- %define V_sendmail_pmilter 0.95
- %define V_mail_milter 0.07
- # package information
- Name: milter
- Summary: Mail Filtering API
- URL: http://www.sendmail.org/doc/sendmail-current/libmilter/docs/
- Vendor: Eric Allman, Todd Vierling
- Packager: OpenPKG Foundation e.V.
- Distribution: OpenPKG Community
- Class: EVAL
- Group: Mail
- License: BSD/Artistic
- Version: %{V_libmilter}
- Release: 20080504
- # package options
- %option with_perl no
- # list of sources
- Source0: ftp://ftp.sendmail.org/pub/sendmail/sendmail.%{V_libmilter}.tar.gz
- Source1: http://switch.dl.sourceforge.net/sourceforge/pmilter/Sendmail-PMilter-%{V_sendmail_pmilter}.tar.gz
- Source2: http://switch.dl.sourceforge.net/sourceforge/pmilter/Mail-Milter-%{V_mail_milter}.tar.gz
- Source3: milter.pc
- Patch0: milter.patch
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20060823
- PreReq: OpenPKG, openpkg >= 20060823
- %if "%{with_perl}" == "yes"
- BuildPreReq: perl, perl-openpkg
- PreReq: perl
- %endif
- AutoReq: no
- AutoReqProv: no
- %description
- MILTER is the mail and SMTP protocol filtering API developed with
- the Sendmail 8 MTA. This package provides Sendmail's original
- client-side C API (libmilter) and optionally the alternative
- client-side Perl APIs (Sendmail::Milter, Sendmail::PMilter,
- Mail::Milter).
- %track
- prog milter:libmilter = {
- version = %{V_libmilter}
- url = ftp://ftp.sendmail.org/pub/sendmail/
- regex = sendmail.(\d+\.\d+\.\d+)\.tar\.gz
- }
- prog milter:Sendmail-PMilter = {
- version = %{V_sendmail_pmilter}
- url = http://prdownloads.sourceforge.net/pmilter/
- regex = Sendmail-PMilter-(__VER__)\.tar\.gz
- }
- prog milter:Mail-Milter = {
- version = %{V_mail_milter}
- url = http://prdownloads.sourceforge.net/pmilter/
- regex = Mail-Milter-(__VER__)\.tar\.gz
- }
- %prep
- %setup -q -c
- %setup -q -T -D -a 1
- %setup -q -T -D -a 2
- %patch -p0
- %build
- # build C API
- ( cd sendmail-%{V_libmilter}
- extlibs="%{l_fsl_libs} -ldb"
- case "%{l_platform -t}" in
- *-sunos* ) extlibs="$extlibs -lrt" ;;
- esac
- ( echo "define(\`confCC', \`%{l_cc} %{l_cflags}')dnl"
- echo "APPENDDEF(\`confINCDIRS', \`%{l_cppflags}')dnl"
- echo "APPENDDEF(\`confLIBDIRS', \`%{l_ldflags}')dnl"
- echo "APPENDDEF(\`confLIBS', \`$extlibs')dnl"
- echo "define(\`confSTDIO_TYPE', \`portable')dnl"
- echo "APPENDDEF(\`conf_sendmail_ENVDEF', \`-DMILTER=1')dnl"
- echo "APPENDDEF(\`conf_libmilter_ENVDEF', \`-D_FFR_MILTER_ROOT_UNSAFE')dnl"
- ) >devtools/Site/site.config.m4
- ( cd include
- ln -s libmilter milter
- ) || exit $?
- ( cd libmilter
- ./Build
- ) || exit $?
- ) || exit $?
- # build Perl API
- %if "%{with_perl}" == "yes"
- %{l_prefix}/bin/perl-openpkg prepare
- %{l_prefix}/bin/perl-openpkg -d Sendmail-PMilter-%{V_sendmail_pmilter} configure build
- %{l_prefix}/bin/perl-openpkg -d Mail-Milter-%{V_mail_milter} configure build
- %endif
- %install
- rm -rf $RPM_BUILD_ROOT
- # install C API
- ( cd sendmail-%{V_libmilter}
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/include/milter \
- $RPM_BUILD_ROOT%{l_prefix}/lib/milter
- %{l_shtool} install -c -m 644 \
- include/libmilter/*.h \
- $RPM_BUILD_ROOT%{l_prefix}/include/milter/
- %{l_shtool} install -c -m 644 \
- obj.*/libmilter/libmilter.a \
- $RPM_BUILD_ROOT%{l_prefix}/lib/
- ) || exit $?
- libs=`grep "^LDOPTS=" sendmail-%{V_libmilter}/obj.*/libmilter/Makefile | sed -e 's;^LDOPTS=;;'`
- libs="$libs -lmilter"
- case "%{l_platform -t}" in
- *-sunos* ) libs="$libs -lrt" ;;
- esac
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
- %{l_shtool} install -c -m 644 %{l_value -s -a} \
- -e "s;@version@;%{version};" \
- -e "s;@libs@;$libs;" \
- %{SOURCE milter.pc} $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
- # install Perl API
- %if "%{with_perl}" == "yes"
- %{l_prefix}/bin/perl-openpkg -d Sendmail-PMilter-%{V_sendmail_pmilter} install
- %{l_prefix}/bin/perl-openpkg -d Mail-Milter-%{V_mail_milter} install
- %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
- %else
- >perl-openpkg-files
- %endif
- # create parent run-time directory of MILTER application sockets
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/var/milter
- # determine installation files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} `cat perl-openpkg-files`
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
- %post
- # create run-time directory of MILTER application sockets
- # (which are required to have particular user/group ownerships
- # in order to allow all MTAs to access it under run-time)
- mkdir $RPM_INSTALL_PREFIX/var/milter/socket 2>/dev/null || true
- chown %{l_rusr}:%{l_mgrp} $RPM_INSTALL_PREFIX/var/milter/socket
- chmod 2775 $RPM_INSTALL_PREFIX/var/milter/socket
- %preun
- # try to remove run-time directory of MILTER application sockets
- rmdir $RPM_INSTALL_PREFIX/var/milter/socket 2>/dev/null || true
|