perl/perl.spec

Thu, 02 Aug 2012 01:32:22 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 02 Aug 2012 01:32:22 +0200
changeset 446
85ef9b73028a
parent 358
832ab278201b
child 501
4d4d275a712a
permissions
-rw-r--r--

Correct typical english grammar mistakes in german linguistics.

michael@22 1 ##
michael@22 2 ## perl.spec -- OpenPKG RPM Package Specification
michael@358 3 ## Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@22 4 ##
michael@22 5 ## Permission to use, copy, modify, and distribute this software for
michael@22 6 ## any purpose with or without fee is hereby granted, provided that
michael@22 7 ## the above copyright notice and this permission notice appear in all
michael@22 8 ## copies.
michael@22 9 ##
michael@22 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@22 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@22 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@22 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@22 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@22 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@22 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@22 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@22 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@22 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@22 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@22 21 ## SUCH DAMAGE.
michael@22 22 ##
michael@22 23
michael@22 24 # package information
michael@22 25 Name: perl
michael@22 26 Summary: Practical Extraction and Reporting Language
michael@22 27 URL: http://www.perl.com/
michael@22 28 Vendor: The Perl Project
michael@22 29 Packager: OpenPKG Foundation e.V.
michael@22 30 Distribution: OpenPKG Community
michael@22 31 Class: CORE
michael@22 32 Group: Perl
michael@22 33 License: GPL/Artistic
michael@358 34 Version: 5.14.1
michael@359 35 Release: 20110914
michael@22 36
michael@22 37 # list of sources
michael@358 38 Source0: http://www.cpan.org/src/perl-%{version}.tar.gz
michael@22 39 Patch0: perl.patch
michael@22 40
michael@22 41 # build information
michael@359 42 Prefix: %{l_prefix}
michael@359 43 BuildRoot: %{l_buildroot}
michael@359 44 BuildPreReq: OpenPKG, openpkg >= 20060823, gcc
michael@359 45 PreReq: OpenPKG, openpkg >= 20060823
michael@359 46 AutoReq: no
michael@359 47 AutoReqProv: no
michael@22 48
michael@22 49 %description
michael@22 50 Perl ("Practical Reporting and Extraction Language") is a very
michael@22 51 sophisticated and flexible (but this way also complex) programming
michael@22 52 language. This is the original implementation of the Perl 5
michael@22 53 interpreter from Larry Wall and his community.
michael@22 54
michael@22 55 %track
michael@22 56 prog perl = {
michael@22 57 version = %{version}
michael@358 58 url = http://www.cpan.org/src/
michael@358 59 regex = perl-(5\.(?:[02468]|1[02468])\.\d+)\.tar\.gz
michael@22 60 }
michael@22 61
michael@22 62 %prep
michael@22 63 %setup -q
michael@22 64 %patch -p0
michael@22 65 chmod -R u+w .
michael@22 66
michael@22 67 %build
michael@22 68 # configure the Perl package
michael@22 69 %{l_shtool} subst \
michael@22 70 -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;' \
michael@22 71 -e 's;package=perl5;package=perl;' \
michael@22 72 Configure
michael@22 73 %{l_shtool} subst \
michael@22 74 -e 's; */usr/local/lib;;' \
michael@22 75 hints/freebsd.sh hints/netbsd.sh
michael@22 76 optimize=""
michael@22 77 case "%{l_platform -t}" in
michael@22 78 amd64-* ) optimize="%{l_cflags}" ;;
michael@22 79 *-aix* ) optimize="%{l_cflags}" ;;
michael@22 80 *-* ) optimize="%{l_cflags -O}" ;;
michael@22 81 esac
michael@22 82 if [ ".$optimize" = . ]; then
michael@22 83 optimize="-Uoptimize"
michael@22 84 else
michael@22 85 optimize="-Doptimize=$optimize"
michael@22 86 fi
michael@22 87 libdirs=""
michael@22 88 for dir in %{l_prefix}/lib /lib64 /usr/lib64 /lib /usr/lib /usr/ccs/lib; do
michael@22 89 if [ -d $dir ]; then
michael@22 90 if [ ".$libdirs" = . ]; then
michael@22 91 libdirs="$dir"
michael@22 92 else
michael@22 93 libdirs="$libdirs $dir"
michael@22 94 fi
michael@22 95 fi
michael@22 96 done
michael@22 97 ./Configure \
michael@22 98 -d -e -s \
michael@22 99 -Dcf_by="%{l_openpkg_release}" \
michael@22 100 -Dcf_email="http://www.openpkg.org/" \
michael@22 101 -Dprefix=%{l_prefix} \
michael@22 102 -Dvendorprefix=%{l_prefix} \
michael@22 103 -Dinstallprefix=%{l_prefix} \
michael@22 104 -Dinstallstyle="lib/perl5" \
michael@22 105 -Dman1dir=%{l_prefix}/man/man1 \
michael@22 106 -Dman3dir=%{l_prefix}/man/man3 \
michael@22 107 -Dcc="%{l_prefix}/bin/gcc" "$optimize" \
michael@22 108 -Dlocincpth="%{l_prefix}/include" \
michael@22 109 -Dloclibpth="%{l_prefix}/lib" \
michael@22 110 -Dldflags="%{l_ldflags}" \
michael@22 111 -Dlibpth="$libdirs" \
michael@22 112 -Dglibpth="$libdirs" \
michael@22 113 -Dscriptdir="%{l_prefix}/bin" \
michael@22 114 -Uinstallusrbinperl \
michael@22 115 -Ui_malloc -Ui_iconv -Ui_db \
michael@22 116 -Uusedevel
michael@22 117
michael@22 118 # build the Perl package
michael@22 119 %{l_make} %{l_mflags} -f Makefile
michael@22 120
michael@22 121 %install
michael@359 122 # remove build cruft
michael@359 123 rm -rf $RPM_BUILD_ROOT
michael@22 124
michael@22 125 # install the Perl package via standard procedure
michael@22 126 %{l_make} %{l_mflags} -f Makefile install DESTDIR=$RPM_BUILD_ROOT
michael@22 127
michael@22 128 # allow us to already use the temporary install perl(1)
michael@22 129 PERL5LIB=$RPM_BUILD_ROOT%{l_prefix}/lib/perl
michael@22 130 export PERL5LIB
michael@22 131
michael@22 132 # install Perl versions of system header files
michael@22 133 ( case "%{l_platform -t}" in
michael@22 134 *-darwin* ) export DYLD_LIBRARY_PATH="`pwd`" ;;
michael@22 135 esac
michael@22 136 cd /usr/include
michael@22 137 eval `$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installarchlib`
michael@22 138 echo *.h sys/*.h |\
michael@22 139 xargs $RPM_BUILD_ROOT%{l_prefix}/bin/perl \
michael@22 140 $RPM_BUILD_ROOT%{l_prefix}/bin/h2ph -h -d $RPM_BUILD_ROOT$installarchlib
michael@22 141 ) || exit $?
michael@22 142
michael@22 143 # post-adjustments to installation tree
michael@22 144 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/perl%{version}
michael@22 145 rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
michael@22 146 for name in \
michael@22 147 libnetcfg perlaix perlamiga perlapollo \
michael@22 148 perlbeos perlbs2000 perlcygwin perldgux perlepoc perlfreebsd perlhpux \
michael@22 149 perlhurd perlirix perlmachten perlmacos perlmacosx perlmint perlmpeix \
michael@22 150 perlnetware perlos2 perlos390 perlos400 perlplan9 perlqnx perlsolaris \
michael@22 151 perlvmesa perlvms perlvos perlwin32; do
michael@22 152 rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$name.1
michael@22 153 done
michael@22 154
michael@22 155 # re-adjust configuration as mentioned in Perl's INSTALL document
michael@22 156 ( case "%{l_platform -t}" in
michael@22 157 *-darwin* ) export DYLD_LIBRARY_PATH="`pwd`" ;;
michael@22 158 esac
michael@22 159 $RPM_BUILD_ROOT%{l_prefix}/bin/perl -pi.orig \
michael@22 160 -e "s:$RPM_BUILD_ROOT%{l_prefix}:%{l_prefix}:g" \
michael@22 161 $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/*/Config.pm \
michael@22 162 `find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/%{version}/ \
michael@22 163 -type f -name ".packlist" -print`
michael@22 164 find $RPM_BUILD_ROOT%{l_prefix}/lib/perl/ \
michael@22 165 -name "*.orig" -print | xargs rm -f
michael@22 166 ) || exit $?
michael@22 167
michael@22 168 # assume ownership for various arch/site/vendor install dirs
michael@22 169 ( eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installarchlib`"
michael@22 170 eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installprivlib`"
michael@22 171 eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installsitearch`"
michael@22 172 eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installsitelib`"
michael@22 173 eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installvendorarch`"
michael@22 174 eval "`$RPM_BUILD_ROOT%{l_prefix}/bin/perl -V:installvendorlib`"
michael@22 175 %{l_shtool} mkdir -f -p -m 755 \
michael@22 176 $RPM_BUILD_ROOT$installarchlib/auto \
michael@22 177 $RPM_BUILD_ROOT$installprivlib/auto \
michael@22 178 $RPM_BUILD_ROOT$installsitearch/auto \
michael@22 179 $RPM_BUILD_ROOT$installsitelib/auto \
michael@22 180 $RPM_BUILD_ROOT$installvendorarch/auto \
michael@22 181 $RPM_BUILD_ROOT$installvendorlib/auto
michael@22 182 ) || exit $?
michael@22 183
michael@22 184 # strip binary files
michael@22 185 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
michael@22 186
michael@22 187 # resolve file conflicts (with perl-locale)
michael@22 188 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/enc2xs \
michael@358 189 $RPM_BUILD_ROOT%{l_prefix}/bin/piconv \
michael@358 190 $RPM_BUILD_ROOT%{l_prefix}/man/man1/enc2xs.1 \
michael@358 191 $RPM_BUILD_ROOT%{l_prefix}/man/man1/piconv.1
michael@22 192
michael@22 193 # resolve file conflicts (with perl-module)
michael@22 194 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/corelist \
michael@22 195 $RPM_BUILD_ROOT%{l_prefix}/bin/config_data \
michael@358 196 $RPM_BUILD_ROOT%{l_prefix}/man/man1/config_data.1 \
michael@358 197 $RPM_BUILD_ROOT%{l_prefix}/man/man1/corelist.1 \
michael@358 198 $RPM_BUILD_ROOT%{l_prefix}/man/man1/cpan.1 \
michael@358 199 $RPM_BUILD_ROOT%{l_prefix}/man/man1/instmodsh.1
michael@22 200
michael@22 201 # resolve file conflicts (with perl-sys)
michael@22 202 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/ptar \
michael@22 203 $RPM_BUILD_ROOT%{l_prefix}/bin/ptardiff \
michael@22 204 $RPM_BUILD_ROOT%{l_prefix}/man/man1/ptar.1 \
michael@22 205 $RPM_BUILD_ROOT%{l_prefix}/man/man1/ptardiff.1
michael@22 206
michael@22 207 # resolve file conflicts (with perl-crypto)
michael@22 208 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/shasum \
michael@22 209 $RPM_BUILD_ROOT%{l_prefix}/man/man1/shasum.1
michael@22 210
michael@22 211 # determine installed files
michael@22 212 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
michael@22 213
michael@22 214 %files -f files
michael@22 215
michael@22 216 %clean
michael@359 217 rm -rf $RPM_BUILD_ROOT
michael@22 218

mercurial