| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- ##
- ## perl-dbi.spec -- OpenPKG RPM Specification
- ## Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH
- ## Copyright (c) 2000-2002 The OpenPKG Project <http://www.openpkg.org/>
- ## Copyright (c) 2000-2002 Ralf S. Engelschall <rse@engelschall.com>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- ## SUCH DAMAGE.
- ##
- # versions of individual parts
- %define V_dbi 1.28
- %define V_sql_statement 1.004
- %define V_dbd_anydata 0.05
- %define V_dbd_sprite 0.35
- %define V_dbd_sqlite 0.15
- %define V_dbd_mysql 2.1017
- %define V_dbd_pg 1.13
- %define V_dbd_oracle 1.12
- # package options
- %ifndef with_dbd_mysql
- %define with_dbd_mysql no
- %endif
- %ifndef with_dbd_pg
- %define with_dbd_pg no
- %endif
- %ifndef with_dbd_oracle
- %define with_dbd_oracle no
- %endif
- # package information
- Name: perl-dbi
- Summary: Perl Modules for use with DBI API
- URL: http://www.cpan.org/
- Vendor: Perl Community
- Packager: The OpenPKG Project
- Distribution: OpenPKG [EXP]
- Group: Language
- License: GPL/Artistic
- Version: 20020614
- Release: 20020614
- # list of sources
- Source0: http://www.cpan.org/modules/by-module/DBI/DBI-%{V_dbi}.tar.gz
- Source1: http://www.cpan.org/modules/by-module/SQL/SQL-Statement-%{V_sql_statement}.tar.gz
- Source2: http://www.cpan.org/modules/by-module/DBD/DBD-AnyData-%{V_dbd_anydata}.tar.gz
- Source3: http://www.cpan.org/modules/by-module/DBD/DBD-Sprite-%{V_dbd_sprite}.tar.gz
- Source4: http://www.cpan.org/modules/by-module/DBD/DBD-SQLite-%{V_dbd_sqlite}.tar.gz
- Source5: http://www.cpan.org/modules/by-module/DBD/DBD-mysql-%{V_dbd_mysql}.tar.gz
- Source6: http://www.cpan.org/modules/by-module/DBD/DBD-Pg-%{V_dbd_pg}.tar.gz
- Source7: http://www.cpan.org/modules/by-module/DBD/DBD-Oracle-%{V_dbd_oracle}.tar.gz
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20020206, perl
- PreReq: OpenPKG, openpkg >= 20020206, perl
- %if "%{with_dbd_mysql}" == "yes"
- BuildPreReq: mysql
- PreReq: mysql
- %endif
- %if "%{with_dbd_pg}" == "yes"
- BuildPreReq: postgresql
- PreReq: postgresql
- %endif
- AutoReq: no
- AutoReqProv: no
- %description
- Various modules for using the DBI API of Perl:
- - DBI (%{V_dbi})
- - SQL::Statement (%{V_sql_statement})
- - DBD::AnyData (%{V_dbd_anydata})
- - DBD::Sprite (%{V_dbd_csv})
- - DBD::SQLite (%{V_dbd_sqlite})
- - DBD::mysql (%{V_dbd_mysql}) [with_dbd_mysql=%{V_with_dbd_mysql}]
- - DBD::Pg (%{V_dbd_pg}) [with_dbd_pg=%{V_with_dbd_pg}]
- - DBD::Oracle (%{V_dbd_oracle}) [with_dbd_oracle=%{V_with_dbd_oracle}]
- %prep
- %setup0 -q -c -n %{name}-%{version}
- %setup1 -q -T -D -a 1
- %setup2 -q -T -D -a 2
- %setup3 -q -T -D -a 3
- %setup4 -q -T -D -a 4
- %if "%{with_dbd_mysql}" == "yes"
- %setup5 -q -T -D -a 5
- %endif
- %if "%{with_dbd_pg}" == "yes"
- %setup6 -q -T -D -a 6
- %endif
- %if "%{with_dbd_oracle}" == "yes"
- %setup7 -q -T -D -a 7
- %endif
- %build
- # no-op
- %install
- rm -rf $RPM_BUILD_ROOT
- %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/lib/perl5
- # create a wrapper script which finds the includes
- eval `%{l_prefix}/bin/perl -V:version -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"
- # ensure we can write where we want to
- find . -exec chmod ug+w {} \;
- # make sure our Perl is used
- %{l_shtool} subst \
- -e "s:\$^X:'$perl':g" \
- `find . -name Makefile.PL -print`
- # build DBI modules
- ( cd DBI-%{V_dbi}
- $perl Makefile.PL $perlargs
- $make $makeargs all
- $make $makeargs install
- )
- # build SQL::Statement
- ( cd SQL-Statement-%{V_sql_statement}
- $perl Makefile.PL $perlargs
- $make $makeargs all
- $make $makeargs install
- )
- # build DBD::AnyData
- ( cd DBD-AnyData-%{V_dbd_anydata}
- $perl Makefile.PL $perlargs
- $make $makeargs all
- $make $makeargs install
- )
- # build DBD::Sprite
- ( cd DBD-Sprite-%{V_dbd_sprite}
- $perl Makefile.PL $perlargs
- $make $makeargs all
- $make $makeargs install
- )
- # build DBD::SQLite
- ( cd DBD-SQLite-%{V_dbd_sqlite}
- # (contains a copy of SQLite, so does not depend on "sqlite" package)
- $perl Makefile.PL $perlargs
- $make $makeargs all
- $make $makeargs install
- )
- %if "%{with_dbd_mysql}" == "yes"
- # build DBD::mysql
- ( cd DBD-mysql-%{V_dbd_mysql}
- # (determines MySQL header/lib paths via mysql_config in $PATH)
- $perl Makefile.PL $perlargs
- $make $makeargs all
- $make $makeargs install
- )
- %endif
- %if "%{with_dbd_pg}" == "yes"
- # build DBD::Pg
- ( cd DBD-Pg-%{V_dbd_pg}
- POSTGRES_HOME=%{l_prefix}
- export POSTGRES_HOME
- $perl Makefile.PL $perlargs
- $make $makeargs all
- $make $makeargs install
- )
- %endif
- %if "%{with_dbd_oracle}" == "yes"
- # build DBD::oracle
- ( cd DBD-Oracle-%{V_dbd_oracle}
- ORACLE_HOME=${ORACLE_HOME-%{l_prefix}}
- export ORACLE_HOME
- $perl Makefile.PL $perlargs
- $make $makeargs all
- $make $makeargs install
- )
- %endif
- # clean up
- find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
- find $RPM_BUILD_ROOT%{l_prefix} -name .packlist -print | xargs rm -f
- find $RPM_BUILD_ROOT%{l_prefix} -type d -depth -print | (xargs rmdir >/dev/null 2>&1 || true)
- # avoid conflicts
- eval `$perl -V:installarchlib -V:installprivlib -V:installsitearch -V:installsitelib`
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} \
- '%not %dir %{l_prefix}/lib/perl5' \
- '%not %dir %{l_prefix}/lib/perl5/*' \
- "%not %dir $installarchlib" \
- "%not %dir $installprivlib" \
- "%not %dir $installsitearch" \
- "%not %dir $installsitelib" \
- "%not %dir $installarchlib/auto" \
- "%not %dir $installprivlib/auto" \
- "%not %dir $installsitearch/auto" \
- "%not %dir $installsitelib/auto"
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
|