ソースを参照

add optional MySQL compatibility layer

Ralf S. Engelschall 20 年 前
コミット
7733e7fd8c
1 ファイル変更35 行追加13 行削除
  1. 35 13
      postgresql/postgresql.spec

+ 35 - 13
postgresql/postgresql.spec

@@ -32,6 +32,7 @@
 %define       V_psqlodbc        08.01.0102
 %define       V_slony1          1.1.2
 %define       V_pgcluster       1.3.0c
+%define       V_mysqlcompat     1.0b3
 
 #   package information
 Name:         postgresql
@@ -47,15 +48,16 @@ Version:      %{V_postgresql}
 Release:      20060106
 
 #   package options
-%option       with_server    yes
-%option       with_cxx       no
-%option       with_perl      no
-%option       with_odbc      no
-%option       with_compat    no
-%option       with_tcl       no
-%option       with_slony1    no
-%option       with_pgcluster no
-%option       with_kerberos  no
+%option       with_server       yes
+%option       with_cxx          no
+%option       with_perl         no
+%option       with_odbc         no
+%option       with_compat       no
+%option       with_tcl          no
+%option       with_slony1       no
+%option       with_pgcluster    no
+%option       with_kerberos     no
+%option       with_mysqlcompat  no
 
 #   list of sources
 Source0:      ftp://ftp.postgresql.org/pub/source/v%{V_postgresql}/postgresql-%{V_postgresql}.tar.gz
@@ -65,8 +67,9 @@ Source3:      ftp://gborg.postgresql.org/pub/pgperl/stable/pgperl-%{V_pgperl}.ta
 Source4:      ftp://ftp.postgresql.org/pub/odbc/versions/src/psqlodbc-%{V_psqlodbc}.tar.gz
 Source5:      http://developer.postgresql.org/~wieck/slony1/download/slony1-%{V_slony1}.tar.bz2
 Source6:      http://pgfoundry.org/frs/download.php/219/pgcluster-%{V_pgcluster}-patch.tar.gz
-Source7:      rc.postgresql
-Source8:      pg_migrate
+Source7:      http://pgfoundry.org/frs/download.php/548/mysqlcompat-%{V_pgcluster}.tar.gz
+Source8:      rc.postgresql
+Source9:      pg_migrate
 Patch0:       postgresql.patch
 
 #   build information
@@ -141,11 +144,17 @@ AutoReqProv:  no
         regex     = slony1-(\d+\.\d+\.\d+)\.tar\.bz2
     }
     prog postgresql:pgcluster = {
-        comment   = "steve: beside the filename also the url hat to be changed to download the current version"
+        comment   = "rse: beside the filename also the path changes for new versions"
         version   = %{V_pgcluster}
         url       = http://pgfoundry.org/frs/?group_id=1000072&release_id=168
         regex     = pgcluster-(__VER__)-patch\.tar\.gz
     }
+    prog postgresql:mysqlcompat = {
+        comment   = "rse: beside the filename also the path changes for new versions"
+        version   = %{V_mysqlcompat}
+        url       = http://pgfoundry.org/frs/?group_id=1000154&release_id=379
+        regex     = mysqlcompat-(__VER__)\.tar\.gz
+    }
 
 %prep
     %setup -q
@@ -182,6 +191,9 @@ AutoReqProv:  no
         -e '/preproc\.c/,/Makefile\.aix/d' | \
     %{l_patch} -p1
 %endif
+%if "%{with_mysqlcompat}" == "yes"
+    %setup -q -T -D -a 7
+%endif
 %if "%{with_kerberos}" == "yes"
     %{l_shtool} subst \
         -e 's;krb5 -ldes -lasn1 -lroken;krb5 -lk5crypto -lkrb5support -lcom_err;g' \
@@ -488,14 +500,24 @@ AutoReqProv:  no
     ) || exit $?
 %endif
 
-%if "%{with_pgcluster}" == "yes"
     #   post-adjust pgcluster configuration filenames
+%if "%{with_pgcluster}" == "yes"
     mv $RPM_BUILD_ROOT%{l_prefix}/etc/postgresql/pglb.conf.sample \
        $RPM_BUILD_ROOT%{l_prefix}/etc/postgresql/pglb.conf
     mv $RPM_BUILD_ROOT%{l_prefix}/etc/postgresql/pgreplicate.conf.sample \
        $RPM_BUILD_ROOT%{l_prefix}/etc/postgresql/pgreplicate.conf
 %endif
 
+    #   install MySQL compatibility layer
+%if "%{with_mysqlcompat}" == "yes"
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/share/postgresql/mysqlcompat
+    %{l_shtool} install -c -m 644 \
+        mysqlcompat-%{V_mysqlcompat}/README \
+        mysqlcompat-%{V_mysqlcompat}/*.sql \
+        $RPM_BUILD_ROOT%{l_prefix}/share/postgresql/mysqlcompat/
+%endif
+
     #   install run-command script
     %{l_shtool} mkdir -f -p -m 755 \
         $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d