File perl-DBD-ODBC.spec of Package perl-DBD-ODBC

# spec file for package perl-DBD-ODBC
# Copyright (c) 2014 SUSE LINUX Products 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

%bcond_with test

Name:           perl-DBD-ODBC
Version:        1.48
Release:        0
%define cpan_name DBD-ODBC
Summary:        ODBC Driver for DBI
License:        GPL-1.0+ or Artistic-1.0
Group:          Development/Libraries/Perl
Patch0:         %{name}-1.29-Makefile.diff
BuildRequires:  perl
BuildRequires:  perl-macros
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  unixODBC-devel
BuildRequires:  perl(DBI) >= 1.609
BuildRequires:  perl(Test::Simple) >= 0.90
Requires:       unixODBC
Requires:       perl(DBI) >= 1.609

This module is needed to access ODBC databases from within Perl. The
module uses the unixODBC manager to connect to the database.

%setup -q -n %{cpan_name}-%{version}
find . -type f -print0 | xargs -0 chmod 644

#rpmlint: wrong-file-end-of-line-encoding
for file in README.unicode; do
  perl -p -i -e "s|\r\n|\n|" "$file"

pushd examples
#rpmlint: wrong-file-end-of-line-encoding
find -type f -exec perl -p -i -e "s|\r\n|\n|" {} \;
#rpmlint: wrong-script-interpreter
for ex in $(ls -1); do
  sed -i -e 's,#[!|#]perl\(.*\),#!perl\1,' "$ex"
  sed -i -e 's,perl.exe -w,perl -w,' "$ex"

perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
make %{?_smp_mflags}

make test


rm -rf %{buildroot}

%files -f %{name}.files
%doc Changes FAQ if_you_are_taking_over_this_code.txt
%doc README README.adabas README.informix README.sqlserver README.unicode
%doc test_results.txt examples

openSUSE Build Service is sponsored by