mysql.spec 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. ##
  2. ## mysql.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2001 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2001 Ralf S. Engelschall <rse@engelschall.com>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. %define berkeleydb yes
  25. %define innobase no
  26. %define gemini no
  27. # package information
  28. Name: mysql
  29. Summary: Fast Relational Database Management System
  30. Group: Database
  31. URL: http://www.mysql.com/
  32. Vendor: MySQL AB
  33. Packager: rse@openpkg.org
  34. Distribution: OpenPKG
  35. License: GPL
  36. Version: 3.23.42
  37. Release: 2
  38. # list of sources
  39. Source0: http://download.sourceforge.net/mysql/mysql-%{version}.tar.gz
  40. Source1: my.cnf
  41. Source2: rc.mysql
  42. # build information
  43. Prefix: %{l_prefix}
  44. BuildRoot: %{l_buildroot}
  45. BuildPreReq: OpenPKG, openpkg >= 0.9-33, gcc
  46. PreReq: OpenPKG, openpkg >= 0.9-33
  47. AutoReq: no
  48. AutoReqProv: no
  49. %description
  50. MySQL is a multi-user Relational Database Management System (RDBMS),
  51. which is controlled through Structured Query Language (SQL) operating in
  52. full multi-threading mode. The main goals of MySQL are speed, robustness
  53. and ease of use. MySQL was originally developed because of the need for
  54. a SQL server that could handle very big databases with magnitude higher
  55. speed than what any database vendor could offer.
  56. %prep
  57. %setup0 -q
  58. %build
  59. # determine additional configure options
  60. case "%{l_target}" in
  61. *-freebsd* ) opt="--with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static" ;;
  62. *-linux* ) opt="--with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static" ;;
  63. *-solaris* ) opt="" ;; # static compiling doesn't work under Solaris because of missing libdl.a
  64. esac
  65. # configure source tree
  66. CC="%{l_cc}" \
  67. CXX="%{l_cxx}" \
  68. CFLAGS="%{l_cflags -O}" \
  69. CXXFLAGS="%{l_cflags -O}" \
  70. ./configure \
  71. --prefix=%{l_prefix} \
  72. --sysconfdir=%{l_prefix}/etc/mysql \
  73. --localstatedir=%{l_prefix}/var/mysql \
  74. --with-unix-socket-path=%{l_prefix}/var/mysql/mysql.sock \
  75. --with-mysqld-user=%{l_fsusr} \
  76. --enable-thread-safe-client \
  77. %if "%{berkeleydb}" == "yes"
  78. --with-berkeley-db \
  79. %endif
  80. %if "%{innobase}" == "yes"
  81. --with-innodb \
  82. %endif
  83. %if "%{gemini}" == "yes"
  84. --with-gemini \
  85. %endif
  86. --with-low-memory \
  87. $opt
  88. # build source tree
  89. %{l_make} %{l_mflags -O}
  90. %install
  91. rm -rf $RPM_BUILD_ROOT
  92. # perform standard installation procedure
  93. %{l_make} %{l_mflags} install \
  94. AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" \
  95. DESTDIR=$RPM_BUILD_ROOT
  96. # KLUDGE: my_dir.h is not installed!
  97. %{l_shtool} install -c -m 644 \
  98. include/my_dir.h $RPM_BUILD_ROOT%{l_prefix}/include/mysql/
  99. # strip installation area
  100. rm -rf $RPM_BUILD_ROOT%{l_prefix}/mysql-test
  101. rm -rf $RPM_BUILD_ROOT%{l_prefix}/sql-bench
  102. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  103. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/mysql-%{version}.spec
  104. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/binary-configure
  105. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2> /dev/null || true
  106. # install global configuration
  107. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/mysql
  108. %{l_shtool} install -c -m 644 \
  109. -e "s;@l_prefix@;%{l_prefix};g" \
  110. -e "s;@l_fsusr@;%{l_fsusr};g" \
  111. %{SOURCE my.cnf} \
  112. $RPM_BUILD_ROOT%{l_prefix}/etc/mysql/
  113. # install run-command script
  114. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  115. %{l_shtool} install -c -m 755 -e "s;@l_prefix@;%{l_prefix};g" \
  116. %{SOURCE rc.mysql} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  117. # make sure the database directory exists
  118. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/mysql
  119. # determine the package files
  120. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  121. %{l_files_std} \
  122. '%config %{l_prefix}/etc/mysql/my.cnf'
  123. %files -f files
  124. %clean
  125. rm -rf $RPM_BUILD_ROOT
  126. %post
  127. $RPM_INSTALL_PREFIX/bin/mysql_install_db
  128. chown -R %{l_fsusr}:%{l_fsgrp} $RPM_INSTALL_PREFIX/var/mysql/