We need pine to support both ssl and ldap. So I obtained the pine version
from the openpkg current site (pine-4.58L-20030919.src.rpm) and modified the
spec file to conditionally (with_ldap=yes) support LDAP as shown in the
extract at the bottom of this message.

The problem comes in building on Solaris 9. Openldap's libldap.a calls
inet_aton(), which on Solaris resides in /usr/lib/libresolv.so (whereas on
RedHat 9 it resides in libc). This is therefore not being automatically
picked up by the pine makefile, so specifying "-lresolv" as part of
EXTRALDFLAGS is required to complete the build successfully. (Interestingly,
openldap is aware of the -lresolv requirement and uses it to test for the
presence of inet_aton() as well as at build time.)

I also added another build option regarding sendmail which you may or may
not want to include. On our systems, sendmail is considered an integral part
of the OS (be it Solaris or Linux) and is installed and configured
appropriately for our mail server on all systems. So we don't want to build
mail clients (such as pine) that default to their own "private" sendmail.
Rather, we need to build pine so that it points to the OS default sendmail
location. My option (default_sendmail=yes) does this.

Note that everything defaults to the way you had it if no options are
explicitly specified with --define.

I have uploaded the new src rpm (pine-4.58L-20031003.src.rpm) built from the
changed pine.spec to the openpkg upload area for your consideration.

Dennis

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
#   package options
%option       with_ssl  no
%option       with_ldap  no
%option       default_sendmail  no

#   list of sources
Source0:      ftp://ftp.cac.washington.edu/pine/pine%{V_real}.tar.bz2
Source1:      pine.conf.fixed
Source2:      pine.conf

#   build information
Prefix:       %{l_prefix}
BuildRoot:    %{l_buildroot}
BuildPreReq:  OpenPKG, openpkg >= 1.3.1, make, gcc
PreReq:       OpenPKG, openpkg >= 1.3.1
%if "%{default_sendmail}" == "no"
BuildPreReq:  MTA
PreReq:       MTA
%endif
%if "%{with_ssl}" == "yes"
BuildPreReq:  openssl
PreReq:       openssl
%endif
%if "%{with_ldap}" == "yes"
BuildPreReq:  openldap
PreReq:       openldap
%endif
AutoReq:      no
AutoReqProv:  no

%description
    Pine - a Program for Internet News & Email - is a tool for reading,
    sending, and managing electronic messages. Pine was developed by
    Computing & Communications at the University of Washington. Though
    originally designed for inexperienced email users, Pine has evolved
    to support many advanced features, and an ever-growing number of
    configuration and personal-preference options.

%prep
    %setup -q -n pine%{V_real}

%build
    #   determine build platform
    OS=""
    OS_DEP_FILE=""
    case "%{l_platform -t}" in
        *-freebsd* ) OS="bsf"; OS_DEP_FILE="pine/osdep/os-bsf.h" ;;
        *-linux*   ) OS="slx"; OS_DEP_FILE="pine/osdep/os-lnx.h" ;;
        *-sunos5.* ) OS="gs5"; OS_DEP_FILE="pine/osdep/os-sol.h" ;;
        *)
            echo "Sorry, unsupported architecture '%{l_platform -t}'" |                
%{l_rpmtool} msg -b -t error 1>&2
            exit 1
            ;;
    esac

    #   adjust paths
    PINE_CONF_FIXED="%{l_prefix}/etc/pine/pine.conf.fixed"
    PINE_CONF="%{l_prefix}/etc/pine/pine.conf"
%if "%{default_sendmail}" == "no"
    SENDMAIL="%{l_prefix}/sbin/sendmail"
%endif
    %{l_shtool} subst          -e "s;^\(#define SYSTEM_PINERC_FIXED[    ]\).*$;\1
\"\";"          -e "s;^\(#define SYSTEM_PINERC[         ]\).*$;\1 \"\";" %if 
"%{default_sendmail}" == "no"
         -e "s;^\(#define SENDMAIL[     ]\).*$;\1 \"\";" %endif
         

    #   clean up before building Pine
    sh ./build clean

    #   set up for LDAP if requested
%if "%{with_ldap}" == "yes"
    mkdir ldap
    ln -s %{l_prefix}/include ldap/include
    ln -s %{l_prefix}/lib ldap/libraries
%endif

    #   build Pine
    sh ./build         CC="%{l_cc}"         EXTRACFLAGS="%{l_cflags -O}" %if 
"%{with_ldap}" == "yes"
        EXTRALDFLAGS="%{l_ldflags} -lresolv" %else
        EXTRALDFLAGS="%{l_ldflags}"         NOLDAP %endif
%if "%{with_ssl}" == "yes"
        SSLDIR="%{l_prefix}"         SSLTYPE="unix" %else
        NOSSL %endif
        
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Dennis McRitchie
Research & Academic Applications Support (RAAS)
Academic Services Department
Office of Information Technology
Princeton University

______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
Developer Communication List                   [EMAIL PROTECTED]

Reply via email to