imap/imap.spec

Tue, 29 Mar 2011 20:04:34 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 29 Mar 2011 20:04:34 +0200
changeset 334
4a34d7a82eab
parent 198
8364d0b242cd
child 555
434e5cc73d47
permissions
-rw-r--r--

Rework package yet again, correcting and introducing new buildconf logic:
Conditionally disable bootstrap stage comparison correctly, correct
english grammar, better find system as(1) and ld(1), indotruce detailed
optimization option messages, more completely guess cpu types, allow
profiled bootstrapping without a preinstalled GCC because many other
compilers have long since implemented 64-bit arithmetic, instruct make
to build sequentially (not in sparallel) when building a profiled
bootstrap as GCC online documents recommend, and generally improve
comment blocks.

The single most important correction in this changeset relates to the
GCC changed optimization policy since at least GCC 4.5, in which -march
is always passed and not always correctly guessed. In the case of this
package, allowing GCC to guess the architecture leads to wild build
errors at various subcomponents (zlib, libgcc, libiberty...) and
bootstrap stages. It seems quite platform specific, and the safest
approach to correcting this seems to be explicitly always specifying the
-march argument when bootstrapping GCC. Because the best choice 'native'
is not available when bootstrapping using a foreign (non GCC) compiler,
a guess is made according to rpmmacros l_platform in that case.

It is questionable as to whether these recent optimization changes
on the part of GCC or this package are compatible with each other,
or if either are complete or correct at all. At least applying these
corrections allows this package to build again in most cases test.

     1 ##
     2 ##  imap.spec -- OpenPKG RPM Package Specification
     3 ##  Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
     4 ##
     5 ##  Permission to use, copy, modify, and distribute this software for
     6 ##  any purpose with or without fee is hereby granted, provided that
     7 ##  the above copyright notice and this permission notice appear in all
     8 ##  copies.
     9 ##
    10 ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    11 ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    12 ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    13 ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    14 ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    15 ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    16 ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    17 ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    18 ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    19 ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    20 ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    21 ##  SUCH DAMAGE.
    22 ##
    24 #   package version
    25 %define       V_here   2007e
    26 %define       V_real   2007e
    27 %define       V_subdir 2007e
    29 #   package information
    30 Name:         imap
    31 Summary:      The IMAP Library
    32 URL:          http://www.washington.edu/imap/
    33 Vendor:       University of Washington
    34 Packager:     OpenPKG Foundation e.V.
    35 Distribution: OpenPKG Community
    36 Class:        BASE
    37 Group:        Mail
    38 License:      University of Washington's Free-Fork License
    39 Version:      %{V_here}
    40 Release:      20091030
    42 #   package options
    43 %option       with_ssl      yes
    44 %option       with_pam      no
    45 %option       with_daemons  no
    46 %option       with_mbxdef   no
    48 #   list of sources
    49 Source0:      ftp://ftp.cac.washington.edu/imap/imap-%{V_real}.tar.Z
    50 Patch0:       imap.patch
    52 #   build information
    53 Prefix:       %{l_prefix}
    54 BuildRoot:    %{l_buildroot}
    55 BuildPreReq:  OpenPKG, openpkg >= 20040130, gcc
    56 PreReq:       OpenPKG, openpkg >= 20040130
    57 %if "%{with_pam}" == "yes"
    58 BuildPreReq:  PAM
    59 PreReq:       PAM
    60 %endif
    61 %if "%{with_ssl}" == "yes"
    62 BuildPreReq:  openssl
    63 PreReq:       openssl
    64 %endif
    65 AutoReq:      no
    66 AutoReqProv:  no
    67 %if "%{with_daemons}" == "yes"
    68 Conflicts:    imaputils
    69 %endif
    71 %description
    72     The IMAP library provides a C API for IMAP client access.
    73     It optionally contains the UW IMAP/POP3 daemons, too.
    75 %track
    76     prog imap = {
    77         version   = %{V_real}
    78         url       = ftp://ftp.cac.washington.edu/imap/
    79         regex     = imap-(\d+[a-z]?\d?)\.tar\.Z
    80     }
    82 %prep
    83     %setup -q -n imap-%{V_subdir}
    84     %patch -p0
    86 %build
    87     mflags="%{l_mflags}"
    88     cflags="%{l_cflags}"
    89     ldflags="%{l_ldflags}"
    90 %if "%{with_pam}" == "yes"
    91     case "%{l_platform -t}" in
    92         *-sunos* ) pamtype=pmb ;;
    93         *        ) pamtype=pam ;;
    94     esac
    95     mflags="$mflags PASSWDTYPE=$pamtype"
    96     cflags="$cflags -I`%{l_rc} --query pam_incdir`"
    97     ldflags="$ldflags -L`%{l_rc} --query pam_libdir`"
    98 %endif
    99 %if "%{with_mbxdef}" == "yes"
   100     mflags="$mflags CREATEPROTO=mbxproto"
   101 %endif
   102 %if "%{with_ssl}" == "yes"
   103     cflags="%{l_cppflags openssl .} $cflags"
   104     mflags="$mflags SSLDIR=%{l_prefix}/etc/openssl"
   105     mflags="$mflags SSLCERTS=%{l_prefix}/etc/openssl/certs"
   106     mflags="$mflags SSLKEYS=%{l_prefix}/etc/openssl/private"
   107     mflags="$mflags SSLINCLUDE=%{l_prefix}/include"
   108     mflags="$mflags SSLLIB=%{l_prefix}/lib"
   109 %else
   110     mflags="$mflags SSLTYPE=none"
   111 %endif
   112     case "%{l_platform -t}" in
   113         *-freebsd* ) os=bsf ;;
   114         *-linux*   ) os=slx ;;
   115         *-sunos*   ) os=gso ;;
   116         *-netbsd*  ) os=neb ;;
   117         *-irix*    ) os=gsg ;;
   118         *) echo "Unsupported platform %{l_platform -t}" 1>&2; exit 1 ;;
   119     esac
   120     mflags="$mflags $os"
   121     %{l_make} $mflags \
   122         EXTRACFLAGS="$cflags" \
   123         EXTRALDFLAGS="$ldflags"
   125 %install
   126     rm -rf $RPM_BUILD_ROOT
   127     %{l_shtool} mkdir -f -p -m 755 \
   128         $RPM_BUILD_ROOT%{l_prefix}/include/imap \
   129         $RPM_BUILD_ROOT%{l_prefix}/lib
   130     %{l_shtool} install -c -m 644 \
   131         c-client/*.h \
   132         c-client/linkage.c \
   133         $RPM_BUILD_ROOT%{l_prefix}/include/imap/
   134     rm -f $RPM_BUILD_ROOT%{l_prefix}/include/imap/os_*.h
   135     %{l_shtool} install -c -m 644 c-client/c-client.a \
   136         $RPM_BUILD_ROOT%{l_prefix}/lib/libimap.a
   137 %if "%{with_daemons}" == "yes"
   138     %{l_shtool} mkdir -f -p -m 755 \
   139         $RPM_BUILD_ROOT%{l_prefix}/bin \
   140         $RPM_BUILD_ROOT%{l_prefix}/sbin \
   141         $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
   142         $RPM_BUILD_ROOT%{l_prefix}/man/man8
   143     %{l_shtool} install -c -m 755 \
   144         tmail/tmail dmail/dmail mailutil/mailutil \
   145         $RPM_BUILD_ROOT%{l_prefix}/bin/
   146     %{l_shtool} install -c -m 755 \
   147         imapd/imapd ipopd/ipop3d \
   148         $RPM_BUILD_ROOT%{l_prefix}/sbin/
   149     %{l_shtool} install -c -m 644 \
   150         src/tmail/tmail.1 src/dmail/dmail.1 src/mailutil/mailutil.1 \
   151         $RPM_BUILD_ROOT%{l_prefix}/man/man1/
   152     %{l_shtool} install -c -m 644 \
   153         src/imapd/imapd.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/imapd.8
   154     %{l_shtool} install -c -m 644 \
   155         src/ipopd/ipopd.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/ipopd.8
   156 %endif
   158     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
   160 %files -f files
   162 %clean
   163     rm -rf $RPM_BUILD_ROOT

mercurial