[suggest] request for multiple perl modules

Peter Willis pwillis at cbs.com
Wed Jun 18 21:40:23 CEST 2008


Dag Wieers wrote:
> On Wed, 18 Jun 2008, Peter Willis wrote:
>
>> Ralph Angenendt wrote:
>>> Peter Willis wrote:
>>>
>>>> DBD::Oracle                        1.21 
>>>> P/PY/PYTHIAN/DBD-Oracle-1.21.tar.gz
>>>>
>>>
>>> AFAIR that one needs liboci.so (at least). So I don't think it can be
>>> packaged for rpmforge, can it?
>>
>> I currently package the oracle instantclient libraries (free 
>> download) and link against those. I know it works with 10.2.0.x 
>> instantclient versions anyway... It's a bit of a bastard to set up so 
>> if you wanted to skip that one I could maintain it myself, or I could 
>> post my .spec and Makefile.PL patches for both.
>
> This we could ship as a nosrc RPM package and I can make it available 
> in my build environment. If you have more information (link, 
> procedure, SPEC file), please send it to me...
>
> Kind regards,
Attached are my .specs for the instantclient and DBD::Oracle and some 
source files to build DBD::Oracle (patched Makefile.PL and a perlreq 
filter). The makefile there may be a much better way of working around, 
but I use this patch... You'll want to modify it so "/usr/local" becomes 
"/usr" (a relic from my solaris build)
-------------- next part --------------
%define pkgname perl-DBD-Oracle
%define filelist %{pkgname}-%{version}-filelist
%define NVR %{pkgname}-%{version}-%{release}
%define maketest 0
# user definitions


name:      perl-DBD-Oracle
summary:   perl-DBD-Oracle - Oracle database driver for the DBI module
version:   1.20
release:   6
epoch:     2
vendor:    pwillis at cbs.com
packager:  Arix International <cpan2rpm at arix.com>
license:   Artistic
group:     Applications/CPAN
url:       http://www.cpan.org
buildroot: %{_tmppath}/%{name}-%{version}
prefix:    %(echo %{_prefix})
requires:   perl >= 1:5.8.8
source:    DBD-Oracle-1.20.tar.gz
source99:  dbdoracle-filter-perlreq.sh
Patch0:    DBD-Oracle-120-makefile.patch

%if "%{_os}" == "linux"
requires: fedora-release >= 3
buildarch: i386
%endif

%description
DBD::Oracle is a Perl module which works with the DBI module to provide
access to Oracle databases.

#
# This package was generated automatically with the cpan2rpm
# utility.  To get this software or for more information
# please visit: http://perl.arix.com/
#

%define __perl_requires %{SOURCE99}

%prep
%setup -q -n DBD-Oracle-%{version} 
%patch0 -p1 -b .oldmf
chmod -R u+w %{_builddir}/DBD-Oracle-%{version}

%build
find . -type f -exec grep -sl '^#!.*perl' {} | grep -v '.bak$' |xargs \
%__perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)'
CFLAGS="$RPM_OPT_FLAGS"
%{__perl} Makefile.PL INSTALLDIRS=vendor
%{__make} CCFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO" OPTIMIZE="-O3"
%if %maketest
%{__make} test
%endif

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%{makeinstall} `%{__perl} -MExtUtils::MakeMaker -e ' print \$ExtUtils::MakeMaker::VERSION <= 6.05 ? qq|PREFIX=%{buildroot}%{_prefix}| : qq|DESTDIR=%{buildroot}| '`

cmd=/usr/share/spec-helper/compress_files
[ -x $cmd ] || cmd=/usr/lib/rpm/brp-compress
[ -x $cmd ] && $cmd

# remove special files
find %{buildroot} -name "perllocal.pod" \
    -o -name ".packlist"                \
    -o -name "*.bs"                     \
    |xargs -i rm -f {}

# no empty directories
[ -d "%{buildroot}%{_prefix}" ] && find "%{buildroot}%{_prefix}" -type d -depth -exec rmdir {} \; 2>/dev/null


%{__perl} -MFile::Find -le '
    find({ wanted => \&wanted, no_chdir => 1}, "%{buildroot}");
    print "%doc  Todo README.login.txt README hints README.sec.txt README.macosx.txt README.aix.txt Oracle.ex README.wingcc.txt README.explain.txt Changes README.help.txt README.java.txt README.win32.txt README.hpux.txt README-files README.clients.txt README.vms.txt README.linux.txt README.longs.txt";
    for my $x (sort @dirs, @files) {
        push @ret, $x unless indirs($x);
        }
    print join "\n", sort @ret;

    sub wanted {
        return if /auto$/;

        local $_ = $File::Find::name;
        my $f = $_; s|^\Q%{buildroot}\E||;
        return unless length;
        return $files[@files] = $_ if -f $f;

        $d = $_;
        /\Q$d\E/ && return for reverse sort @INC;
        $d =~ /\Q$_\E/ && return
            for qw|/etc %_prefix/man %_prefix/bin %_prefix/share|;

        $dirs[@dirs] = $_;
        }

    sub indirs {
        my $x = shift;
        $x =~ /^\Q$_\E\// && $x ne $_ && return 1 for @dirs;
        }
    ' > %filelist

[ -z %filelist ] && {
    echo "ERROR: empty %files listing"
    exit -1
    }

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files -f %filelist
%defattr(-,root,root)

%changelog
* Thu Jun 05 2008 pwillis at cbs.com
- Support solaris

* Tue Mar 11 2008 pwillis at buildfc3.dev.sportsline.com
- Initial build.
- Add makefile patch
-------------- next part --------------
%define name    oracle-instantclient
%define base    oracle-instantclient-basic
%define version 10.2.0.3
%define release 4
%define epoch   1
%define user_buildroot %{name}-%{version}-%{release}

Name: %{name}
Version: %{version}
Release: %{release}
Epoch: %{epoch}
Summary: Instant Client for Oracle Database 10g.
URL: http://www.oracle.com/
Vendor: Oracle
License: Oracle
Packager: %{current_packager}
Group: System Environment/Libraries
BuildRoot: %{_tmppath}/%{user_buildroot}

%if "%{_os}" == "linux"
Source: instantclient-basiclite-linux32.zip
Requires: fedora-release >= 3
%endif

%if "%{_os}" == "solaris"
#Source: instantclient-basiclite-solaris64-%{version}-20070101.zip
Source: instantclient-basiclite-solaris6432-%{version}-20070101.zip
%define _prefix /usr/local
%endif

# DO NOT PLACE .so LIB REQUIRES HERE.  Let rpmbuild figure those out, it's
# better at it than you. ;)
Provides: oracle-instantclient-basic = %{epoch}:%{version}-%{release}
Provides: oracle-instantclient = %{epoch}:%{version}
Conflicts: oracle-client, oracle-client

%description
Base files for Instant Client.  Support for OCI, OCCI, and JDBC-OCCI applications.

Note: The is the CBS DM repackaging (binary only) of these files for dependency
tracking purposes.

%prep
[ -d %{name} ] && rm -rf %{name} ||:
mkdir %{name}
cd %{name}
unzip %{SOURCE0}

%build
# No build necessary

%install
cd %{name}
# was going to do this the easy way with rpm --root $RPM_BUILD_ROOT -i %SOURCE0
#
# BUT  Bug in rpm since 2004 prevents --root from working completed, it never
# prepends the root path on to the transaction lock file when it goes to lock
# that database and thus tries to lock the *real* db which can't be done w/out
# root.
#archive="`pwd`/%{base}-%{version}-%{release}.cpio"

mkdir -p $RPM_BUILD_ROOT/%{_libdir}/oracle/%{version}/client/lib
find . -type f -exec mv {} $RPM_BUILD_ROOT/%{_libdir}/oracle/%{version}/client/lib/ \;

%if "%{_os}" == "linux"
%post
echo "%{_libdir}/oracle/%{version}/client/lib" > /etc/ld.so.conf.d/oracle-instantclient-%{version}.conf
/sbin/ldconfig

%postun
rm -f /etc/ld.so.conf.d/oracle-instantclient-%{version}.conf
/sbin/ldconfig
%endif
%if "%{_os}" == "solaris"
%post
#if [ ! -f /var/ld/64/ld.config ] ; then
#/usr/bin/crle -64 -c /var/ld/64/ld.config -l /lib/64:/usr/lib/64:/usr/local/lib/64:/usr/sfw/lib/64
#fi
#/usr/bin/crle -64 -c /var/ld/64/ld.config -l "%{_libdir}/oracle/%{version}/client/lib" -u
/usr/bin/crle -l "%{_libdir}/oracle/%{version}/client/lib" -u
%endif

%clean
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"

%files 
%defattr(0755,root,root)
%{_libdir}/oracle/%{version}

%changelog
* Fri Jun 06 2008 Peter Willis
- cleanups for solaris
- switch to 32-bit to support DBD::Oracle

* Wed Nov 29 2006 Peter Willis
- add ld.so.conf.d so perl can find the library

* Thu Nov 24 2005 Jesse Sipprell
- Initial build of CBS-oracle-instantclient

# vi: sts=2 et sw=2 tw=0 noai
-------------- next part --------------
%define name    oracle-instantclient-devel
%define base    oracle-instantclient-devel
%define version 10.2.0.3
%define release 4
%define epoch   1
%define user_buildroot %{name}-%{version}-%{release}-%(eval "id -nu")

Name: %{name}
Version: %{version}
Release: %{release}
Epoch: %{epoch}
Summary: Development headers and libs for Oracle instantclient 10g.
URL: http://www.oracle.com/
Vendor: Oracle
License: Oracle
Packager: %{current_packager}
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{user_buildroot}

%if "%{_os}" == "linux"
Source: instantclient-sdk-linux32-%{version}-20060331.zip
Requires: fedora-release >= 3
%endif

%if "%{_os}" == "solaris"
#Source: instantclient-sdk-solaris64-%{version}-20070101.zip
Source: instantclient-sdk-solaris6432-%{version}-20070101.zip
%define _prefix /usr/local
%endif

# DO NOT PLACE .so LIB REQUIRES HERE.  Let rpmbuild figure those out, it's
# better at it than you. ;)
Provides: oracle-instantclient-devel = %{epoch}:%{version}-%{release}
Requires: oracle-instantclient = %{epoch}:%{version}
Conflicts: oracle-client, oracle-client

%description
Header files and stub libraries needed to build software against the oracle
instantclient.

%prep
[ -d %{name} ] && rm -rf %{name} ||:
mkdir %{name}
cd %{name}
unzip %{SOURCE0}

%build
# No build necessary

%install
cd %{name}
# was going to do this the easy way with rpm --root $RPM_BUILD_ROOT -i %SOURCE0
#
# BUT  Bug in rpm since 2004 prevents --root from working completed, it never
# prepends the root path on to the transaction lock file when it goes to lock
# that database and thus tries to lock the *real* db which can't be done w/out
# root.
#archive="`pwd`/%{base}-%{version}-%{release}.cpio"

for dir in %{_includedir}/oracle/%{version}/client %{_libdir}/oracle/%{version}/client/lib %{_datadir}/oracle/%{version}/client ; do \
  mkdir -p $RPM_BUILD_ROOT/$dir ; \
done

find . -type f -name '*.h' -exec mv {} $RPM_BUILD_ROOT/%{_includedir}/oracle/%{version}/client/ \;

ln -sf %{_libdir}/oracle/%{version}/client/lib/libclntsh.so.10.1 $RPM_BUILD_ROOT/%{_libdir}/oracle/%{version}/client/lib/libclntsh.so
ln -sf %{_libdir}/oracle/%{version}/client/lib/libocci.so.10.1 $RPM_BUILD_ROOT/%{_libdir}/oracle/%{version}/client/lib/libocci.so

find . -type f -name '*demo*' -exec mv {} $RPM_BUILD_ROOT/%{_datadir}/oracle/%{version}/client/ \;
find . -type f -name 'occidml.cpp' -exec mv {} $RPM_BUILD_ROOT/%{_datadir}/oracle/%{version}/client/ \;

cp -r "./instantclient_10_2/sdk" $RPM_BUILD_ROOT/%{_libdir}/oracle/%{version}

%if "%{_os}" == "linux"
%post
echo "%{_libdir}/oracle/%{version}/client/lib" > /etc/ld.so.conf.d/oracle-instantclient-%{version}.conf
/sbin/ldconfig

%postun
rm -f /etc/ld.so.conf.d/oracle-instantclient-%{version}.conf
/sbin/ldconfig
%endif
%if "%{_os}" == "solaris"
%post
#if [ ! -f /var/ld/64/ld.config ] ; then
#/usr/bin/crle -64 -c /var/ld/64/ld.config -l /lib/64:/usr/lib/64:/usr/local/lib/64:/usr/sfw/lib/64
#fi
#/usr/bin/crle -64 -c /var/ld/64/ld.config -l "%{_libdir}/oracle/%{version}/client/lib" -u
/usr/bin/crle -l "%{_libdir}/oracle/%{version}/client/lib" -u
%endif

%clean
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"

%files 
%defattr(0755,root,root)
%{_includedir}/oracle/%{version}
%{_datadir}/oracle/%{version}
%{_libdir}/oracle/%{version}

%changelog
* Fri Jun 06 2008 Peter Willis
- add in the 'sdk' directory to help DBD::Oracle build
- change _prefix based on OS, make everything else respect macro'd stuff like that
- switch to 32 bit to support DBD::Oracle

* Fri May 30 2008 Peter Willis
- support solaris

* Wed Nov 29 2006 Peter Willis
- add ld.so.conf.d so perl can find the library

* Thu Nov 24 2005 Jesse Sipprell
- Initial build of CBS-oracle-instantclient-devel

# vi: sts=2 et sw=2 tw=0 noai
-------------- next part --------------
# this is a "template" spec file, for building an rpm from source.   Template
# is in quotes because there is no way to cookie-cutter rolling an rpm, but
# this a good foundation.
%define name    oracle-instantclient-sqlplus
%define base    oracle-instantclient-sqlplus
%define version 10.2.0.3
%define release 4
%define epoch   1
%define user_buildroot %{name}-%{version}-%{release}

Name: %{name}
Version: %{version}
Release: %{release}
Epoch: %{epoch}
Summary: Instant Client for Oracle Database 10g.
URL: http://www.oracle.com/
Vendor: Oracle
License: Oracle
Packager: %{current_packager}
Group: System Environment/Libraries
BuildRoot: %{_tmppath}/%{user_buildroot}

%if "%{_os}" == "linux"
Source: instantclient-sqlplus-linux32-%{version}-20060331.zip
Requires: fedora-release >= 3
%endif

%if "%{_os}" == "solaris"
#Source: instantclient-sqlplus-solaris64-%{version}-20070101.zip
Source: instantclient-sqlplus-solaris6432-%{version}-20070101.zip
%define _prefix /usr/local
%endif


# DO NOT PLACE .so LIB REQUIRES HERE.  Let rpmbuild figure those out, it's
# better at it than you. ;)
Provides: oracle-instantclient-sqlplus = %{epoch}:%{version}-%{release}
Conflicts: oracle-client, oracle-client
Requires: oracle-instantclient = %{epoch}:%{version}-%{release}

%description
Additional libraries and executable for running SQL*Plus with Instant Client

Note: The is the CBS DM repackaging (binary only) of these files for dependency
tracking purposes.

%prep
[ -d %{name} ] && rm -rf %{name} ||:
mkdir %{name}
cd %{name}
unzip %{SOURCE0}

%build
# No build necessary

%install
cd %{name}
# was going to do this the easy way with rpm --root $RPM_BUILD_ROOT -i %SOURCE0
#
# BUT  Bug in rpm since 2004 prevents --root from working completed, it never
# prepends the root path on to the transaction lock file when it goes to lock
# that database and thus tries to lock the *real* db which can't be done w/out
# root.
#archive="`pwd`/%{base}-%{version}-%{release}.cpio"

for dir in %{_bindir} %{_libdir}/oracle/%{version}/client/bin %{_libdir}/oracle/%{version}/client/lib ; do \
mkdir -p $RPM_BUILD_ROOT/$dir ; \
done

#find . -name sqlplus -exec cp {} %{_bindir}/sqlplus \;
ln -sf %{_libdir}/oracle/%{version}/client/bin/sqlplus $RPM_BUILD_ROOT/%{_bindir}/sqlplus
find . -name sqlplus -exec mv {} $RPM_BUILD_ROOT/%{_libdir}/oracle/%{version}/client/bin/sqlplus \;
find . -name glogin.sql -exec mv {} $RPM_BUILD_ROOT/%{_libdir}/oracle/%{version}/client/lib/glogin.sql \;
find . -name libsqlplus.so -exec mv {} $RPM_BUILD_ROOT/%{_libdir}/oracle/%{version}/client/lib/libsqlplus.so \;
find . -name libsqlplusic.so -exec mv {} $RPM_BUILD_ROOT/%{_libdir}/oracle/%{version}/client/lib/libsqlplusic.so \;

%if "%{_os}" == "linux"
%post
echo "%{_libdir}/oracle/%{version}/client/lib" > /etc/ld.so.conf.d/oracle-instantclient-%{version}.conf
/sbin/ldconfig

%postun
rm -f /etc/ld.so.conf.d/oracle-instantclient-%{version}.conf
/sbin/ldconfig
%endif
%if "%{_os}" == "solaris"
%post
#if [ ! -f /var/ld/64/ld.config ] ; then
#/usr/bin/crle -64 -c /var/ld/64/ld.config -l /lib/64:/usr/lib/64:/usr/local/lib/64:/usr/sfw/lib/64
#fi
#/usr/bin/crle -64 -c /var/ld/64/ld.config -l "%{_libdir}/oracle/%{version}/client/lib" -u
/usr/bin/crle -l "%{_libdir}/oracle/%{version}/client/lib" -u
%endif

%clean
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"

%files 
%defattr(0755,root,root)
%{_libdir}/oracle/%{version}
%{_bindir}

%changelog
* Fri May 30 2008 Peter Willis
- support solaris
- *sigh* switch to 32-bit version to support instantclient used by DBD::Oracle

* Wed Nov 29 2006 Peter Willis
- add ld.so.conf.d so perl can find the library

* Tue Mar 21 2006 Mitch Lewandowski <mlewandowski at cbs.com>
- Initial build of CBS-oracle-instantclient-sqlplus

# vi: sts=2 et sw=2 tw=0 noai
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbd-oracle-sources.tgz
Type: application/octet-stream
Size: 5986 bytes
Desc: not available
Url : http://lists.rpmforge.net/pipermail/suggest/attachments/20080618/031fd497/dbd-oracle-sources-0001.obj


More information about the suggest mailing list