mysql.spec 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. ##
  2. ## mysql.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2002 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2002 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.49
  38. Release: 20020220
  39. # list of sources
  40. Source0: http://www.fh-wolfenbuettel.de/ftp/pub/database/mysql/Downloads/MySQL-3.23/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 >= 20020206, gcc
  47. PreReq: OpenPKG, openpkg >= 20020206
  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. %setup -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_musr} \
  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. --disable-shared \
  90. $opt
  91. # build source tree
  92. %{l_make} %{l_mflags -O}
  93. %install
  94. rm -rf $RPM_BUILD_ROOT
  95. # perform standard installation procedure
  96. %{l_make} %{l_mflags} install \
  97. AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" \
  98. DESTDIR=$RPM_BUILD_ROOT
  99. # KLUDGE: my_dir.h is not installed!
  100. %{l_shtool} install -c -m 644 \
  101. include/my_dir.h $RPM_BUILD_ROOT%{l_prefix}/include/mysql/
  102. # strip installation area
  103. rm -rf $RPM_BUILD_ROOT%{l_prefix}/mysql-test
  104. rm -rf $RPM_BUILD_ROOT%{l_prefix}/sql-bench
  105. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  106. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/mysql-%{version}.spec
  107. rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/binary-configure
  108. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2> /dev/null || true
  109. strip $RPM_BUILD_ROOT%{l_prefix}/libexec/* 2> /dev/null || true
  110. # install global configuration
  111. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/mysql
  112. %{l_shtool} install -c -m 644 \
  113. -e 's;@l_prefix@;%{l_prefix};g' \
  114. -e 's;@l_musr@;%{l_musr};g' \
  115. %{SOURCE my.cnf} \
  116. $RPM_BUILD_ROOT%{l_prefix}/etc/mysql/
  117. # install run-command script
  118. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  119. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  120. %{SOURCE rc.mysql} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  121. # make sure the database directory exists
  122. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/mysql
  123. # determine the package files
  124. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  125. %{l_files_std} \
  126. '%config %{l_prefix}/etc/mysql/my.cnf'
  127. %files -f files
  128. %clean
  129. rm -rf $RPM_BUILD_ROOT
  130. %post
  131. $RPM_INSTALL_PREFIX/bin/mysql_install_db
  132. chown -R %{l_musr}:%{l_mgrp} $RPM_INSTALL_PREFIX/var/mysql/