Przeglądaj źródła

add support for pgAccess and ODBC linkage

Ralf S. Engelschall 24 lat temu
rodzic
commit
19c1e5fa29
1 zmienionych plików z 19 dodań i 0 usunięć
  1. 19 0
      postgresql/postgresql.spec

+ 19 - 0
postgresql/postgresql.spec

@@ -155,6 +155,15 @@ AutoReqProv:  no
           mv $man pg_$man
       done
     )
+
+    #   optionally install pgAccess startup wrapper
+%if "%{with_tcl}" == "yes"
+    ( LD_LIBRARY_PATH=%{l_prefix}/lib:$LD_LIBRARY_PATH
+      %{l_prefix}/share/postgresql/pgaccess/main.tcl ${1+"$@"}
+    ) >$RPM_BUILD_ROOT%{l_prefix}/bin/pgaccess
+    chmod 755 $RPM_BUILD_ROOT%{l_prefix}/bin/pgaccess
+%endif
+
     #   create additional directories
     %{l_shtool} mkdir -f -p -m 755 \
         $RPM_BUILD_ROOT%{l_prefix}/var/postgresql/db \
@@ -214,5 +223,15 @@ AutoReqProv:  no
           echo "\$ $RPM_INSTALL_PREFIX/bin/psql -U postgresql -d template1 \\"
           echo "  -c \"ALTER USER postgresql WITH PASSWORD '<new-password>'\""
         ) | %{l_rpmtool} msg -b -t notice
+
+        #   optionally link into unixODBC
+%if "%{with_odbc}" == "yes"
+        ( echo "[PostgreSQL]"
+          echo "Description     = PostgreSQL ODBC driver"
+          echo "Driver          = $RPM_INSTALL_PREFIX/lib/libodbcpsql.so"
+          echo "Setup           = $RPM_INSTALL_PREFIX/lib/libodbcpsqlS.so"
+          echo "Threading       = 2"
+        ) $RPM_INSTALL_PREFIX/bin/odbcinst -i -d -r
+%endif
     fi