perl/perl.spec

Mon, 28 Jan 2013 17:37:18 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 28 Jan 2013 17:37:18 +0100
changeset 758
a2c6460cfb16
parent 502
0bdbde429f77
permissions
-rw-r--r--

Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.

     1 ##
     2 ##  perl.spec -- OpenPKG RPM Package Specification
     3 ##  Copyright (c) 2000-2012 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 information
    25 Name:         perl
    26 Summary:      Practical Extraction and Reporting Language
    27 URL:          http://www.perl.com/
    28 Vendor:       The Perl Project
    29 Packager:     OpenPKG Foundation e.V.
    30 Distribution: OpenPKG Community
    31 Class:        CORE
    32 Group:        Perl
    33 License:      GPL/Artistic
    34 Version:      5.16.1
    35 Release:      20120800
    37 #   list of sources
    38 Source0:      http://www.cpan.org/src/perl-%{version}.tar.gz
    39 Patch0:       perl.patch
    41 #   build information
    42 BuildPreReq:  OpenPKG, openpkg >= 20100101, gcc, make
    43 PreReq:       OpenPKG, openpkg >= 20100101
    45 %description
    46     Perl ("Practical Reporting and Extraction Language") is a very
    47     sophisticated and flexible (but this way also complex) programming
    48     language. This is the original implementation of the Perl 5
    49     interpreter from Larry Wall and his community.
    51 %track
    52     prog perl = {
    53         version   = %{version}
    54         url       = http://www.cpan.org/src/
    55         regex     = perl-(5\.(?:[02468]|1[02468])\.\d+)\.tar\.gz
    56     }
    58 %prep
    59     %setup -q
    60     %patch -p0
    61     chmod -R u+w .
    63 %build
    64     #   configure the Perl package
    65     %{l_shtool} subst \
    66         -e 's;\(.*for thislib in $libswanted.*\);libswanted=`echo " $libswanted " | sed -e "s/ bind / /g" -e "s/ db / /g" -e "s/ gdbm / /g" -e "s/ iconv / /g"`\; \1;' \
    67         -e 's;package=perl5;package=perl;' \
    68         Configure
    69     %{l_shtool} subst \
    70         -e 's; */usr/local/lib;;' \
    71         hints/freebsd.sh hints/netbsd.sh
    72     optimize=""
    73     case "%{l_platform -t}" in
    74         amd64-* ) optimize="%{l_cflags}"    ;;
    75         *-aix*  ) optimize="%{l_cflags}"    ;;
    76         *-*     ) optimize="%{l_cflags -O}" ;;
    77     esac
    78     if [ ".$optimize" = . ]; then
    79         optimize="-Uoptimize"
    80     else
    81         optimize="-Doptimize=$optimize"
    82     fi
    83     libdirs=""
    84     for dir in %{l_prefix}/lib /lib64 /usr/lib64 /lib /usr/lib /usr/ccs/lib; do
    85         if [ -d $dir ]; then
    86             if [ ".$libdirs" = . ]; then
    87                 libdirs="$dir"
    88             else
    89                 libdirs="$libdirs $dir"
    90             fi
    91         fi
    92     done
    93     ./Configure \
    94         -d -e -s \
    95         -Dcf_by="%{l_openpkg_release}" \
    96         -Dcf_email="http://www.openpkg.org/" \
    97         -Dprefix=%{l_prefix} \
    98         -Dvendorprefix=%{l_prefix} \
    99         -Dinstallprefix=%{l_prefix} \
   100         -Dinstallstyle="lib/perl5" \
   101         -Dman1dir=%{l_prefix}/man/man1 \
   102         -Dman3dir=%{l_prefix}/man/man3 \
   103         -Dcc="%{l_prefix}/bin/gcc" "$optimize" \
   104         -Dlocincpth="%{l_prefix}/include" \
   105         -Dloclibpth="%{l_prefix}/lib" \
   106         -Dldflags="%{l_ldflags}" \
   107         -Dlibpth="$libdirs" \
   108         -Dglibpth="$libdirs" \
   109         -Dscriptdir="%{l_prefix}/bin" \
   110         -Uinstallusrbinperl \
   111         -Ui_malloc -Ui_iconv -Ui_db \
   112         -Uusedevel
   114     #   build the Perl package
   115     %{l_make} %{l_mflags -O} -f Makefile
   117 %install
   119     #   install the Perl package via standard procedure
   120     %{l_make} %{l_mflags} -f Makefile install DESTDIR=$RPM_BUILD_ROOT
   122     #   allow us to already use the temporary install perl(1)
   123     PERL5LIB=$RPM_BUILD_ROOT%{l_prefix}/lib/perl
   124     export PERL5LIB
   126     #   install Perl versions of system header files
   127     ( case "%{l_platform -t}" in
   128           *-darwin* ) export DYLD_LIBRARY_PATH="`pwd`" ;;
   129       esac
   130       cd /usr/include
   131       eval `$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installarchlib`
   132       echo *.h sys/*.h |\
   133       xargs $RPM_BUILD_ROOT%{l_prefix}/bin/perl \
   134           $RPM_BUILD_ROOT%{l_prefix}/bin/h2ph -h -d $RPM_BUILD_ROOT$installarchlib
   135     ) || exit $?
   137     #   post-adjustments to installation tree
   138     rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/perl%{version}
   139     rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
   140     for name in \
   141         libnetcfg perlaix perlamiga perlapollo \
   142         perlbeos perlbs2000 perlcygwin perldgux perlepoc perlfreebsd perlhpux \
   143         perlhurd perlirix perlmachten perlmacos perlmacosx perlmint perlmpeix \
   144         perlnetware perlos2 perlos390 perlos400 perlplan9 perlqnx perlsolaris \
   145         perlvmesa perlvms perlvos perlwin32; do
   146         rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$name.1
   147     done
   149     #   re-adjust configuration as mentioned in Perl's INSTALL document
   150     ( case "%{l_platform -t}" in
   151           *-darwin* ) export DYLD_LIBRARY_PATH="`pwd`" ;;
   152       esac
   153       $RPM_BUILD_ROOT%{l_prefix}/bin/perl -pi.orig \
   154           -e "s:$RPM_BUILD_ROOT%{l_prefix}:%{l_prefix}:g" \
   155           $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/*/Config.pm \
   156           `find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/ \
   157                 -type f -name ".packlist" -print`
   158       find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/ \
   159            -name "*.orig" -print | xargs rm -f
   160     ) || exit $?
   162     #   assume ownership for various arch/site/vendor install dirs
   163     ( eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installarchlib`"
   164       eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installprivlib`"
   165       eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installsitearch`"
   166       eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installsitelib`"
   167       eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installvendorarch`"
   168       eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installvendorlib`"
   169       %{l_shtool} mkdir -f -p -m 755 \
   170           $RPM_BUILD_ROOT$installarchlib/auto \
   171           $RPM_BUILD_ROOT$installprivlib/auto \
   172           $RPM_BUILD_ROOT$installsitearch/auto \
   173           $RPM_BUILD_ROOT$installsitelib/auto \
   174           $RPM_BUILD_ROOT$installvendorarch/auto \
   175           $RPM_BUILD_ROOT$installvendorlib/auto
   176     ) || exit $?
   178     #   strip binary files
   179     strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
   181     #   resolve file conflicts (with perl-locale)
   182     rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/enc2xs \
   183           $RPM_BUILD_ROOT%{l_prefix}/bin/piconv \
   184           $RPM_BUILD_ROOT%{l_prefix}/man/man1/enc2xs.1 \
   185           $RPM_BUILD_ROOT%{l_prefix}/man/man1/piconv.1
   187     #   resolve file conflicts (with perl-module)
   188     rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/corelist \
   189           $RPM_BUILD_ROOT%{l_prefix}/bin/config_data \
   190           $RPM_BUILD_ROOT%{l_prefix}/man/man1/config_data.1 \
   191           $RPM_BUILD_ROOT%{l_prefix}/man/man1/corelist.1 \
   192           $RPM_BUILD_ROOT%{l_prefix}/man/man1/cpan.1 \
   193           $RPM_BUILD_ROOT%{l_prefix}/man/man1/instmodsh.1
   195     #   resolve file conflicts (with perl-sys)
   196     rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/ptar \
   197           $RPM_BUILD_ROOT%{l_prefix}/bin/ptardiff \
   198           $RPM_BUILD_ROOT%{l_prefix}/bin/ptargrep \
   199           $RPM_BUILD_ROOT%{l_prefix}/man/man1/ptar.1 \
   200           $RPM_BUILD_ROOT%{l_prefix}/man/man1/ptardiff.1 \
   201           $RPM_BUILD_ROOT%{l_prefix}/man/man1/ptargrep.1
   203     #   resolve file conflicts (with perl-crypto)
   204     rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/shasum \
   205           $RPM_BUILD_ROOT%{l_prefix}/man/man1/shasum.1
   207     #   resolve file conflicts (with perl-comp)
   208     rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/zipdetails \
   209           $RPM_BUILD_ROOT%{l_prefix}/man/man1/zipdetails.1
   211     #   determine installed files
   212     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
   214 %files -f files
   216 %clean

mercurial