File perl-DBD-Oracle.spec of Package perl-DBD-Oracle
#
# spec file for package perl-DBD-Oracle
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define oracle_version 11.2.0.4.0
%define cpan_name DBD-Oracle
Name: perl-DBD-Oracle
Version: 1.80
Release: 0
Summary: Oracle driver for the Perl5 Database Interface (DBI)
License: GPL-1.0-or-later OR Artistic-1.0
Group: Development/Libraries/Perl
URL: https://search.cpan.org/dist/DBD-Oracle/
Source: https://cpan.metacpan.org/authors/id/M/MJ/MJEVANS/%{cpan_name}-%{version}.tar.gz
BuildRequires: oracle-instantclient
BuildRequires: oracle-instantclient-devel
BuildRequires: oracle-instantclient-sqlplus
BuildRequires: perl
BuildRequires: perl(DBI) >= 1.623
BuildRequires: perl(Data::Dumper)
BuildRequires: perl(Test::NoWarnings)
Requires: oracle-instantclient
Requires: oracle-instantclient-sqlplus
Requires: perl(DBI) >= 1.623
Requires: perl(Data::Dumper)
Requires: perl(Test::NoWarnings)
Conflicts: perl-DBD-Oracle12.1
Conflicts: perl-DBD-Oracle12.2
Conflicts: perl-DBD-Oracle18.3
%{perl_requires}
%if 0%{?rhel_version}
BuildRequires: perl-macros
%endif
%description
DBD::Oracle is the Perl5 Database Interface driver for the Oracle database.
In other words: DBD::Oracle is an interface between the Perl programming
language and the Oracle programming API that comes with the Oracle relational
database management system. Most functions provided by this programming API
are supported. Some rarely used functions are missing, mainly because noone
ever requested them. :-)
%prep
%setup -q -n %{cpan_name}-%{version}
find -type f -exec chmod 0644 {} \;
%build
#export ORACLE_HOME="%%{_libdir}/oracle/%%oracle_version/client/lib"
#export LD_LIBRARY_PATH="$ORACLE_HOME"
ORACLE_HOME=$(find %{_libdir}/oracle -name client | sort -h | tail -1)
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_HOME LD_LIBRARY_PATH
%if 0%{?rhel_version}
MKFILE=$(find %{_datadir}/doc/oracle-instantclient-devel*/ -name demo.mk)
%else
MKFILE=$(find %{_docdir}/oracle-instantclient-devel/ -name demo.mk)
%endif
%ifarch x86_64
export C_INCLUDE_PATH="%{_includedir}/oracle/%{oracle_version}/client"
%endif
perl Makefile.PL -m $MKFILE INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
make %{?_smp_mflags}
%check
make %{?_smp_mflags} test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%license LICENSE
%doc Changes README TODO
%changelog