Ralf S. Engelschall 24 éve
szülő
commit
e7ceef54dd
1 módosított fájl, 56 hozzáadás és 31 törlés
  1. 56 31
      perl-www/perl-www.spec

+ 56 - 31
perl-www/perl-www.spec

@@ -23,6 +23,11 @@
 ##  SUCH DAMAGE. 
 ##  
 
+#   versions of individual parts
+%define       V_libwww_perl       5.64
+%define       V_cgi               2.80
+%define       V_uri               1.18
+
 #   package information
 Name:         perl-www
 Summary:      Perl Module for WWW client and server behavior
@@ -32,11 +37,13 @@ Packager:     The OpenPKG Project
 Distribution: OpenPKG [REL]
 Group:        Language
 License:      GPL/Artistic
-Version:      20020306
-Release:      20020306
+Version:      20020311
+Release:      20020311
 
 #   list of sources
-Source0:      ftp://ftp.cpan.org/pub/CPAN/modules/by-module/WWW/libwww-perl-5.64.tar.gz
+Source0:      http://www.cpan.org/modules/by-module/WWW/libwww-perl-%{V_libwww_perl}.tar.gz
+Source1:      http://www.cpan.org/modules/by-module/CGI/CGI.pm-%{V_cgi}.tar.gz
+Source2:      http://www.cpan.org/modules/by-module/URI/URI-%{V_uri}.tar.gz
 
 #   build information
 Prefix:       %{l_prefix}
@@ -47,23 +54,15 @@ AutoReq:      no
 AutoReqProv:  no
 
 %description
-    The libwww-perl collection is a set of Perl modules which provides
-    a simple and consistent application programming interface to the
-    World-Wide Web.
-
-#   The following modules are included, but many will be taken out
-#   URI::Attr           HTTP::Cookies      HTTP::Request::Common
-#   URI::Escape         HTTP::Daemon       WWW::RobotRules
-#   URI::URL            HTTP::Date         LWP::Conn
-#   HTML::Entities      HTTP::Headers      LWP::MediaTypes
-#   HTML::Formatter     HTTP::Message      LWP::Protocol
-#   HTML::HeadParser    HTTP::Negotiate    LWP::RobotUA
-#   HTML::LinkExtor     HTTP::Request      LWP::Simple
-#   HTML::Parser        HTTP::Response     LWP::UA
-#   HTML::TokeParser    HTTP::Status       LWP::UserAgent
+    Various Perl modules related to World Wide Web (WWW):
+    - libwww-perl (%{V_libwww_perl})
+    - CGI (%{V_cgi})
+    - URI (%{V_uri})
 
 %prep
-    %setup -q -c -n %{name}-%{version}
+    %setup0  -q -c -n %{name}-%{version}
+    %setup1  -q -T -D -a 1
+    %setup2  -q -T -D -a 2
 
 %build
 
@@ -71,27 +70,52 @@ AutoReqProv:  no
     rm -rf $RPM_BUILD_ROOT
     %{l_shtool} mkdir -f -p -m 755 \
         $RPM_BUILD_ROOT%{l_prefix}/lib/perl5 \
-        $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
         $RPM_BUILD_ROOT%{l_prefix}/man/man3
 
-    #   we only have one library and therefore one subdirectory
-    cd `echo "%{SOURCE0}" | sed -e 's;^.*/\([^/]*\)\.tar\.gz$;\1;'`
+    #   create a wrapper script which finds the includes
+    eval `$perl -V:archname`
+    perl=$RPM_BUILD_ROOT/perl
+    echo "#!/bin/sh" >$perl
+    echo "exec %{l_prefix}/bin/perl \\" >>$perl
+    echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/%{version} \\" >>$perl
+    echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/%{version}/${archname} \\" >>$perl
+    echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl \\" >>$perl
+    echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/%{version} \\" >>$perl
+    echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/%{version}/${archname} \\" >>$perl
+    echo " \"\$@\"" >>$perl
+    chmod a+x $perl
+
+    #   determine general tools and arguments
+    perlargs="PREFIX=$RPM_BUILD_ROOT%{l_prefix} PERL=$perl FULLPERL=$perl"
+    make="%{l_make} %{l_mflags}"
+    makeargs="PERL=$perl FULLPERL=$perl"
 
     #   make sure our Perl is used
-    perl=%{l_prefix}/bin/perl
+    chmod -R u+w .
     %{l_shtool} subst \
         -e "s:\$^X:'$perl':g" \
         `find . -name Makefile.PL -print`
 
-    #   build LWP
-    ( echo "INCLUDE = %{l_prefix}/include"
-      echo "LIB = %{l_prefix}/lib"
-    ) >config.in
-    perlargs="PREFIX=$RPM_BUILD_ROOT%{l_prefix} PERL=$perl FULLPERL=$perl"
-    $perl Makefile.PL $perlargs </dev/null
-    %{l_make} %{l_mflags} PERL=$perl FULLPERL=$perl all
-    %{l_make} %{l_mflags} PERL=$perl FULLPERL=$perl install
-    cd ..
+    #   build libwww-perl
+    ( cd libwww-perl-%{V_libwww_perl}
+      $perl Makefile.PL $perlargs </dev/null
+      $make $makeargs all
+      $make $makeargs install
+    )
+
+    #   build CGI
+    ( cd CGI.pm-%{V_cgi}
+      $perl Makefile.PL $perlargs
+      $make $makeargs all
+      $make $makeargs install
+    )
+
+    #   build URI
+    ( cd URI-%{V_uri}
+      $perl Makefile.PL $perlargs
+      $make $makeargs all
+      $make $makeargs install
+    )
 
     #   strip down installation tree
     find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
@@ -113,6 +137,7 @@ AutoReqProv:  no
         "%not %dir $installsitearch/auto" \
         "%not %dir $installsitelib/auto"
 
+
 %files -f files
 
 %clean