mysql.spec 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. URL: http://www.mysql.com/
  31. Vendor: MySQL AB
  32. Packager: The OpenPKG Project
  33. Distribution: OpenPKG [EXP]
  34. Group: Database
  35. License: GPL
  36. Version: 3.23.43
  37. Release: %{l_branch}.0
  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. PATH="%{l_prefix}/bin:$PATH"; export PATH
  60. # determine additional configure options
  61. case "%{l_target}" in
  62. *-freebsd* ) opt="--with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static" ;;
  63. *-linux* ) opt="--with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static" ;;
  64. *-solaris* ) opt="" ;; # static compiling doesn't work under Solaris because of missing libdl.a
  65. esac
  66. # configure source tree
  67. CC="%{l_cc}" \
  68. CXX="%{l_cxx}" \
  69. CFLAGS="%{l_cflags -O}" \
  70. CXXFLAGS="%{l_cflags -O}" \
  71. ./configure \
  72. --prefix=%{l_prefix} \
  73. --sysconfdir=%{l_prefix}/etc/mysql \
  74. --localstatedir=%{l_prefix}/var/mysql \
  75. --with-unix-socket-path=%{l_prefix}/var/mysql/mysql.sock \
  76. --with-mysqld-user=%{l_fsusr} \
  77. --enable-thread-safe-client \
  78. %if "%{berkeleydb}" == "yes"
  79. --with-berkeley-db \
  80. %endif
  81. %if "%{innobase}" == "yes"
  82. --with-innodb \
  83. %endif
  84. %if "%{gemini}" == "yes"
  85. --with-gemini \
  86. %endif
  87. --with-low-memory \
  88. $opt
  89. # build source tree
  90. %{l_make} %{l_mflags -O}
  91. %install
  92. rm -rf $RPM_BUILD_ROOT
  93. # perform standard installation procedure
  94. %{l_make} %{l_mflags} install \
  95. AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" \
  96. DESTDIR=$RPM_BUILD_ROOT
  97. # KLUDGE: my_dir.h is not installed!
  98. %{l_shtool} install -c -m 644 \
  99. include/my_dir.h $RPM_BUILD_ROOT%{l_prefix}/include/mysql/
  100. # strip installation area
  101. rm -rf $RPM_BUILD_ROOT%{l_prefix}/mysql-test
  102. rm -rf $RPM_BUILD_ROOT%{l_prefix}/sql-bench
  103. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  104. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/mysql-%{version}.spec
  105. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/binary-configure
  106. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2> /dev/null || true
  107. # install global configuration
  108. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/mysql
  109. %{l_shtool} install -c -m 644 \
  110. -e "s;@l_prefix@;%{l_prefix};g" \
  111. -e "s;@l_fsusr@;%{l_fsusr};g" \
  112. %{SOURCE my.cnf} \
  113. $RPM_BUILD_ROOT%{l_prefix}/etc/mysql/
  114. # install run-command script
  115. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  116. %{l_shtool} install -c -m 755 -e "s;@l_prefix@;%{l_prefix};g" \
  117. %{SOURCE rc.mysql} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  118. # make sure the database directory exists
  119. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/mysql
  120. # determine the package files
  121. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  122. %{l_files_std} \
  123. '%config %{l_prefix}/etc/mysql/my.cnf'
  124. %files -f files
  125. %clean
  126. rm -rf $RPM_BUILD_ROOT
  127. %post
  128. $RPM_INSTALL_PREFIX/bin/mysql_install_db
  129. chown -R %{l_fsusr}:%{l_fsgrp} $RPM_INSTALL_PREFIX/var/mysql/