Procházet zdrojové kódy

add DBD::Sybase via FreeTDS's Sybase emulation API

Ralf S. Engelschall před 21 roky
rodič
revize
d96484394b
1 změnil soubory, kde provedl 28 přidání a 1 odebrání
  1. 28 1
      perl-dbi/perl-dbi.spec

+ 28 - 1
perl-dbi/perl-dbi.spec

@@ -33,6 +33,7 @@
 %define       V_dbd_mysql      2.9004
 %define       V_dbd_pgsql      1.32
 %define       V_dbd_oracle     1.16
+%define       V_dbd_sybase     1.04_14
 %define       V_dbd_odbc       1.13
 
 #   package information
@@ -46,13 +47,14 @@ Class:        BASE
 Group:        Language
 License:      GPL/Artistic
 Version:      %{V_perl}
-Release:      20041118
+Release:      20041125
 
 #   package options
 %option       with_dbd_sqlite  no
 %option       with_dbd_mysql   no
 %option       with_dbd_pgsql   no
 %option       with_dbd_oracle  no
+%option       with_dbd_sybase  no
 %option       with_dbd_odbc    no
 
 #   list of sources
@@ -65,6 +67,7 @@ Source5:      http://www.cpan.org/modules/by-module/DBD/DBD-mysql-%{V_dbd_mysql}
 Source6:      http://www.cpan.org/modules/by-module/DBD/DBD-Pg-%{V_dbd_pgsql}.tar.gz
 Source7:      http://www.cpan.org/modules/by-module/DBD/DBD-Oracle-%{V_dbd_oracle}.tar.gz
 Source8:      http://www.cpan.org/modules/by-module/DBD/DBD-ODBC-%{V_dbd_odbc}.tar.gz
+Source9:      http://www.peppler.org/downloads/DBD-Sybase-%{V_dbd_sybase}.tar.gz
 Patch0:       perl-dbi.patch
 
 #   build information
@@ -90,6 +93,10 @@ PreReq:       postgresql
 BuildPreReq:  oracle
 PreReq:       oracle
 %endif
+%if "%{with_dbd_sybase}" == "yes"
+BuildPreReq:  freetds, libiconv
+PreReq:       freetds, libiconv
+%endif
 %if "%{with_dbd_odbc}" == "yes"
 BuildPreReq:  unixodbc
 PreReq:       unixodbc
@@ -107,6 +114,7 @@ AutoReqProv:  no
     - DBD::mysql (%{V_dbd_mysql}) [%{with_dbd_mysql}]
     - DBD::Pg (%{V_dbd_pgsql}) [%{with_dbd_pgsql}]
     - DBD::Oracle (%{V_dbd_oracle}) [%{with_dbd_oracle}]
+    - DBD::Sybase (%{V_dbd_sybase}) [%{with_dbd_sybase}]
     - DBD::ODBC (%{V_dbd_odbc}) [%{with_dbd_odbc}]
 
 %track
@@ -145,6 +153,11 @@ AutoReqProv:  no
         url       = http://www.cpan.org/modules/by-module/DBD/
         regex     = DBD-SQLite-(__VER__)\.tar\.gz
     }
+    prog perl-dbi:DBD-Sybase = {
+        version   = %{V_dbd_sybase}
+        url       = http://www.peppler.org/downloads/
+        regex     = DBD-Sybase-(__VER__)\.tar\.gz
+    }
     prog perl-dbi:DBI = {
         version   = %{V_dbi}
         url       = http://www.cpan.org/modules/by-module/DBI/
@@ -166,6 +179,7 @@ AutoReqProv:  no
     %setup -q -T -D -a 6
     %setup -q -T -D -a 7
     %setup -q -T -D -a 8
+    %setup -q -T -D -a 9
     %patch -p0 -d DBD-SQLite-%{V_dbd_sqlite}
 
 %build
@@ -239,6 +253,19 @@ AutoReqProv:  no
     ) || exit $?
 %endif
 
+%if "%{with_dbd_sybase}" == "yes"
+    #   build DBD::Sybase
+    ( cd DBD-Sybase-%{V_dbd_sybase}
+      SYBASE="%{l_prefix}"
+      export SYBASE
+      %{l_shtool} subst \
+          -e 's;\([^s(]/lib\);\1/freetds;g' \
+          -e 's;-lct;%{l_ldflags} -lct -liconv;g' \
+          Makefile.PL
+      %{l_prefix}/bin/perl-openpkg configure build install
+    ) || exit $?
+%endif
+
 %if "%{with_dbd_odbc}" == "yes"
     #   build DBD::odbc
     ( cd DBD-ODBC-%{V_dbd_odbc}