فهرست منبع

provide with_server option similar to what we added recently also to the PostgreSQL package

Ralf S. Engelschall 21 سال پیش
والد
کامیت
0b49f588d1
1فایلهای تغییر یافته به همراه20 افزوده شده و 1 حذف شده
  1. 20 1
      mysql/mysql.spec

+ 20 - 1
mysql/mysql.spec

@@ -40,9 +40,10 @@ Class:        BASE
 Group:        Database
 License:      GPL
 Version:      %{V_opkg}
-Release:      20040730
+Release:      20040829
 
 #   package options
+%option       with_server    yes
 %option       with_bdb       yes
 %option       with_innodb    no
 %option       with_ssl       no
@@ -109,6 +110,9 @@ AutoReqProv:  no
         --with-unix-socket-path=%{l_prefix}/var/mysql/mysql.sock \
         --with-mysqld-user=%{l_musr} \
         --enable-thread-safe-client \
+%if "%{with_server}" != "yes"
+        --without-server \
+%endif
 %if "%{with_bdb}" == "yes"
         --with-berkeley-db \
 %endif
@@ -195,13 +199,22 @@ AutoReqProv:  no
     #   directory for temporary tables
     %{l_shtool} mkdir -f -p -m 700 $RPM_BUILD_ROOT%{l_prefix}/var/mysql/tmp
 
+    #   optional client-only installation
+%if "%{with_server}" != "yes"
+    rm -rf $RPM_BUILD_ROOT%{l_prefix}/bin/*
+%endif
+
     #   determine the package files
     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+%if "%{with_server}" == "yes"
         %{l_files_std} \
         '%config %{l_prefix}/etc/mysql/my.cnf' \
         '%config %{l_prefix}/etc/mysql/my.pwd' \
         '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql' \
         '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql/tmp'
+%else
+        %{l_files_std}
+%endif
 
 %files -f files
 
@@ -209,13 +222,16 @@ AutoReqProv:  no
     rm -rf $RPM_BUILD_ROOT
 
 %pre
+%if "%{with_server}" == "yes"
     #   before upgrade, save status and stop service
     [ $1 -eq 2 ] || exit 0
     eval `%{l_rc} mysql status 2>/dev/null | tee %{l_tmpfile}`
     %{l_rc} mysql stop 2>/dev/null
+%endif
     exit 0
 
 %post
+%if "%{with_server}" == "yes"
     if [ $1 -eq 1 ]; then
         #   after install, create initial database
         $RPM_INSTALL_PREFIX/bin/mysql_install_db \
@@ -235,13 +251,16 @@ AutoReqProv:  no
         { eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}; true; } >/dev/null 2>&1
         [ ".$mysql_active" = .yes ] && %{l_rc} mysql start
     fi
+%endif
     exit 0
 
 %preun
+%if "%{with_server}" == "yes"
     #   before erase, stop service and remove log files
     [ $1 -eq 0 ] || exit 0
     %{l_rc} mysql stop 2>/dev/null
     rm -f $RPM_INSTALL_PREFIX/var/mysql/*.log* >/dev/null 2>&1 || true
     rm -f $RPM_INSTALL_PREFIX/var/mysql/*.err* >/dev/null 2>&1 || true
+%endif
     exit 0