mysql.spec 5.3 KB

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