perl/perl.spec

changeset 22
0d4f475bfc81
child 23
1eecce5d3fe6
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/perl/perl.spec	Wed Jan 07 14:58:25 2009 +0100
     1.3 @@ -0,0 +1,212 @@
     1.4 +##
     1.5 +##  perl.spec -- OpenPKG RPM Package Specification
     1.6 +##  Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.7 +##
     1.8 +##  Permission to use, copy, modify, and distribute this software for
     1.9 +##  any purpose with or without fee is hereby granted, provided that
    1.10 +##  the above copyright notice and this permission notice appear in all
    1.11 +##  copies.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +#   package information
    1.28 +Name:         perl
    1.29 +Summary:      Practical Extraction and Reporting Language
    1.30 +URL:          http://www.perl.com/
    1.31 +Vendor:       The Perl Project
    1.32 +Packager:     OpenPKG Foundation e.V.
    1.33 +Distribution: OpenPKG Community
    1.34 +Class:        CORE
    1.35 +Group:        Perl
    1.36 +License:      GPL/Artistic
    1.37 +Version:      5.10.0
    1.38 +Release:      20081225
    1.39 +
    1.40 +#   list of sources
    1.41 +Source0:      ftp://ftp.cpan.org/pub/CPAN/src/perl-%{version}.tar.gz
    1.42 +Patch0:       perl.patch
    1.43 +
    1.44 +#   build information
    1.45 +Prefix:       %{l_prefix}
    1.46 +BuildRoot:    %{l_buildroot}
    1.47 +BuildPreReq:  OpenPKG, openpkg >= 20040130, gcc
    1.48 +PreReq:       OpenPKG, openpkg >= 20040130
    1.49 +AutoReq:      no
    1.50 +AutoReqProv:  no
    1.51 +
    1.52 +%description
    1.53 +    Perl ("Practical Reporting and Extraction Language") is a very
    1.54 +    sophisticated and flexible (but this way also complex) programming
    1.55 +    language. This is the original implementation of the Perl 5
    1.56 +    interpreter from Larry Wall and his community.
    1.57 +
    1.58 +%track
    1.59 +    prog perl = {
    1.60 +        version   = %{version}
    1.61 +        url       = ftp://ftp.cpan.org/pub/CPAN/src/
    1.62 +        regex     = perl-(5\.10\.\d+)\.tar\.gz
    1.63 +    }
    1.64 +
    1.65 +%prep
    1.66 +    %setup -q
    1.67 +    %patch -p0
    1.68 +    chmod -R u+w .
    1.69 +
    1.70 +%build
    1.71 +    #   configure the Perl package
    1.72 +    %{l_shtool} subst \
    1.73 +        -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;' \
    1.74 +        -e 's;package=perl5;package=perl;' \
    1.75 +        Configure
    1.76 +    %{l_shtool} subst \
    1.77 +        -e 's; */usr/local/lib;;' \
    1.78 +        hints/freebsd.sh hints/netbsd.sh
    1.79 +    optimize=""
    1.80 +    case "%{l_platform -t}" in
    1.81 +        amd64-* ) optimize="%{l_cflags}"    ;;
    1.82 +        *-aix*  ) optimize="%{l_cflags}"    ;;
    1.83 +        *-*     ) optimize="%{l_cflags -O}" ;;
    1.84 +    esac
    1.85 +    if [ ".$optimize" = . ]; then
    1.86 +        optimize="-Uoptimize"
    1.87 +    else
    1.88 +        optimize="-Doptimize=$optimize"
    1.89 +    fi
    1.90 +    libdirs=""
    1.91 +    for dir in %{l_prefix}/lib /lib64 /usr/lib64 /lib /usr/lib /usr/ccs/lib; do
    1.92 +        if [ -d $dir ]; then
    1.93 +            if [ ".$libdirs" = . ]; then
    1.94 +                libdirs="$dir"
    1.95 +            else
    1.96 +                libdirs="$libdirs $dir"
    1.97 +            fi
    1.98 +        fi
    1.99 +    done
   1.100 +    ./Configure \
   1.101 +        -d -e -s \
   1.102 +        -Dcf_by="%{l_openpkg_release}" \
   1.103 +        -Dcf_email="http://www.openpkg.org/" \
   1.104 +        -Dprefix=%{l_prefix} \
   1.105 +        -Dvendorprefix=%{l_prefix} \
   1.106 +        -Dinstallprefix=%{l_prefix} \
   1.107 +        -Dinstallstyle="lib/perl5" \
   1.108 +        -Dman1dir=%{l_prefix}/man/man1 \
   1.109 +        -Dman3dir=%{l_prefix}/man/man3 \
   1.110 +        -Dcc="%{l_prefix}/bin/gcc" "$optimize" \
   1.111 +        -Dlocincpth="%{l_prefix}/include" \
   1.112 +        -Dloclibpth="%{l_prefix}/lib" \
   1.113 +        -Dldflags="%{l_ldflags}" \
   1.114 +        -Dlibpth="$libdirs" \
   1.115 +        -Dglibpth="$libdirs" \
   1.116 +        -Dscriptdir="%{l_prefix}/bin" \
   1.117 +        -Uinstallusrbinperl \
   1.118 +        -Ui_malloc -Ui_iconv -Ui_db \
   1.119 +        -Uusedevel
   1.120 +
   1.121 +    #   build the Perl package
   1.122 +    %{l_make} %{l_mflags} -f Makefile
   1.123 +
   1.124 +%install
   1.125 +    rm -rf $RPM_BUILD_ROOT
   1.126 +
   1.127 +    #   install the Perl package via standard procedure
   1.128 +    %{l_make} %{l_mflags} -f Makefile install DESTDIR=$RPM_BUILD_ROOT
   1.129 +
   1.130 +    #   allow us to already use the temporary install perl(1)
   1.131 +    PERL5LIB=$RPM_BUILD_ROOT%{l_prefix}/lib/perl
   1.132 +    export PERL5LIB
   1.133 +
   1.134 +    #   install Perl versions of system header files
   1.135 +    ( case "%{l_platform -t}" in
   1.136 +          *-darwin* ) export DYLD_LIBRARY_PATH="`pwd`" ;;
   1.137 +      esac
   1.138 +      cd /usr/include
   1.139 +      eval `$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installarchlib`
   1.140 +      echo *.h sys/*.h |\
   1.141 +      xargs $RPM_BUILD_ROOT%{l_prefix}/bin/perl \
   1.142 +          $RPM_BUILD_ROOT%{l_prefix}/bin/h2ph -h -d $RPM_BUILD_ROOT$installarchlib
   1.143 +    ) || exit $?
   1.144 +
   1.145 +    #   post-adjustments to installation tree
   1.146 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/perl%{version}
   1.147 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
   1.148 +    for name in \
   1.149 +        libnetcfg perlaix perlamiga perlapollo \
   1.150 +        perlbeos perlbs2000 perlcygwin perldgux perlepoc perlfreebsd perlhpux \
   1.151 +        perlhurd perlirix perlmachten perlmacos perlmacosx perlmint perlmpeix \
   1.152 +        perlnetware perlos2 perlos390 perlos400 perlplan9 perlqnx perlsolaris \
   1.153 +        perlvmesa perlvms perlvos perlwin32; do
   1.154 +        rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$name.1
   1.155 +    done
   1.156 +
   1.157 +    #   re-adjust configuration as mentioned in Perl's INSTALL document
   1.158 +    ( case "%{l_platform -t}" in
   1.159 +          *-darwin* ) export DYLD_LIBRARY_PATH="`pwd`" ;;
   1.160 +      esac
   1.161 +      $RPM_BUILD_ROOT%{l_prefix}/bin/perl -pi.orig \
   1.162 +          -e "s:$RPM_BUILD_ROOT%{l_prefix}:%{l_prefix}:g" \
   1.163 +          $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/*/Config.pm \
   1.164 +          `find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/ \
   1.165 +                -type f -name ".packlist" -print`
   1.166 +      find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/ \
   1.167 +           -name "*.orig" -print | xargs rm -f
   1.168 +    ) || exit $?
   1.169 +
   1.170 +    #   assume ownership for various arch/site/vendor install dirs
   1.171 +    ( eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installarchlib`"
   1.172 +      eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installprivlib`"
   1.173 +      eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installsitearch`"
   1.174 +      eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installsitelib`"
   1.175 +      eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installvendorarch`"
   1.176 +      eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installvendorlib`"
   1.177 +      %{l_shtool} mkdir -f -p -m 755 \
   1.178 +          $RPM_BUILD_ROOT$installarchlib/auto \
   1.179 +          $RPM_BUILD_ROOT$installprivlib/auto \
   1.180 +          $RPM_BUILD_ROOT$installsitearch/auto \
   1.181 +          $RPM_BUILD_ROOT$installsitelib/auto \
   1.182 +          $RPM_BUILD_ROOT$installvendorarch/auto \
   1.183 +          $RPM_BUILD_ROOT$installvendorlib/auto
   1.184 +    ) || exit $?
   1.185 +
   1.186 +    #   strip binary files
   1.187 +    strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
   1.188 +
   1.189 +    #   resolve file conflicts (with perl-locale)
   1.190 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/enc2xs \
   1.191 +          $RPM_BUILD_ROOT%{l_prefix}/bin/piconv
   1.192 +
   1.193 +    #   resolve file conflicts (with perl-module)
   1.194 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/corelist \
   1.195 +          $RPM_BUILD_ROOT%{l_prefix}/bin/config_data \
   1.196 +          $RPM_BUILD_ROOT%{l_prefix}/man/man1/config_data.1
   1.197 +
   1.198 +    #   resolve file conflicts (with perl-sys)
   1.199 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/ptar \
   1.200 +          $RPM_BUILD_ROOT%{l_prefix}/bin/ptardiff \
   1.201 +          $RPM_BUILD_ROOT%{l_prefix}/man/man1/ptar.1 \
   1.202 +          $RPM_BUILD_ROOT%{l_prefix}/man/man1/ptardiff.1
   1.203 +
   1.204 +    #   resolve file conflicts (with perl-crypto)
   1.205 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/shasum \
   1.206 +          $RPM_BUILD_ROOT%{l_prefix}/man/man1/shasum.1
   1.207 +
   1.208 +    #   determine installed files
   1.209 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
   1.210 +
   1.211 +%files -f files
   1.212 +
   1.213 +%clean
   1.214 +    rm -rf $RPM_BUILD_ROOT
   1.215 +

mercurial