home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / MySql / support-files / mysql-max-3.23.37.spec < prev    next >
Encoding:
Text File  |  2001-01-01  |  8.9 KB  |  264 lines

  1. %define mysql_version        3.23.37
  2. %define shared_lib_version    10:0:0
  3. %define release            2
  4. %define mysqld_user        mysql
  5.  
  6. %define see_base For a description of MySQL see the base MySQL RPM or http://www.mysql.com
  7.  
  8. Name: MySQL
  9. Summary:    MySQL: a very fast and reliable SQL database engine
  10. Group:        Applications/Databases
  11. Summary(pt_BR): MySQL: Um servidor SQL rápido e confiável.
  12. Group(pt_BR):    Aplicações/Banco_de_Dados
  13. Version:    3.23.37
  14. Release:    %{release}
  15. Copyright:    GPL / LGPL
  16. Source:        http://www.mysql.com/Downloads/MySQL-3.23/mysql-%{mysql_version}.tar.gz
  17. Icon:        mysql.gif
  18. URL:        http://www.mysql.com/
  19. Packager:    David Axmark <david@mysql.com>, Monty <monty@mysql.com>
  20. Provides:    msqlormysql MySQL-server
  21. Obsoletes:    mysql
  22.  
  23. # Think about what you use here since the first step is to
  24. # run a rm -rf
  25. BuildRoot:    /var/tmp/mysql-max
  26.  
  27. # From the manual
  28. %description
  29. MySQL is a true multi-user, multi-threaded SQL (Structured Query
  30. Language) database server. MySQL is a client/server implementation
  31. that consists of a server daemon (mysqld) and many different client
  32. programs/libraries.
  33.  
  34. The main goals of MySQL are speed, robustness and ease of use.  MySQL
  35. was originally developed because we needed a SQL server that could
  36. handle very big databases with magnitude higher speed than what any
  37. database vendor could offer to us. And since we did not need all the
  38. features that made their server slow we made our own. We have now been
  39. using MySQL since 1996 in a environment with more than 40 databases,
  40. 10,000 tables, of which more than 500 have more than 7 million
  41. rows. This is about 200G of data.
  42.  
  43. The base upon which MySQL is built is a set of routines that have been
  44. used in a highly demanding production environment for many
  45. years. While MySQL is still in development, it already offers a rich
  46. and highly useful function set.
  47.  
  48. The MySQL-max version differs from the normal MySQL server distribution
  49. in that the BDB and Innobase table handlers are enabled by default.
  50. You can use any normal MySQL client with the MySQL-max server.
  51.  
  52. See the documentation for more information.
  53.  
  54. %description -l pt_BR
  55. O MySQL é um servidor de banco de dados SQL realmente multiusuário e\
  56. multi-tarefa. A linguagem SQL é a mais popular linguagem para banco de\
  57. dados no mundo. O MySQL é uma implementação cliente/servidor que\
  58. consiste de um servidor chamado mysqld e diversos\
  59. programas/bibliotecas clientes. Os principais objetivos do MySQL são:\
  60. velocidade, robustez e facilidade de uso.  O MySQL foi originalmente\
  61. desenvolvido porque nós na Tcx precisávamos de um servidor SQL que\
  62. pudesse lidar com grandes bases de dados e com uma velocidade muito\
  63. maior do que a que qualquer vendedor podia nos oferecer. Estamos\
  64. usando\
  65. o MySQL desde 1996 em um ambiente com mais de 40 bases de dados com 10.000\
  66. tabelas, das quais mais de 500 têm mais de 7 milhões de linhas. Isto é o\
  67. equivalente a aproximadamente 50G de dados críticos. A base da construção do\
  68. MySQL é uma série de rotinas que foram usadas em um ambiente de produção com\
  69. alta demanda por muitos anos. Mesmo o MySQL estando ainda em desenvolvimento,\
  70. ele já oferece um conjunto de funções muito ricas e úteis. Veja a documentação\
  71. para maiores informações.
  72.  
  73. %prep
  74. %setup -n mysql-max-%{mysql_version}
  75. # %setup -T -D -a 1 -n mysql-max-%{mysql_version}
  76.  
  77. %build
  78. # The all-static flag is to make the RPM work on different
  79. # distributions. This version tries to put shared mysqlclient libraries
  80. # in a separate package.
  81.  
  82. BuildMySQL() {
  83. # The --enable-assembler simply does nothing on systems that does not
  84. # support assembler speedups.
  85. sh -c  "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \
  86.     CC=\"${MYSQL_BUILD_CC:-egcs}\" \
  87.     CFLAGS=\"${MYSQL_BUILD_CFLAGS:- -O6 -fno-omit-frame-pointer}\" \
  88.     CXX=\"${MYSQL_BUILD_CXX:-egcs}\" \
  89.     CXXFLAGS=\"${MYSQL_BUILD_CXXFLAGS:- -O6 \
  90.               -felide-constructors -fno-exceptions -fno-rtti \
  91.           -fno-omit-frame-pointer}\" \
  92.     ./configure \
  93.          $* \
  94.         --enable-assembler \
  95.             --with-mysqld-user=%{mysqld_user} \
  96.             --with-unix-socket-path=/var/lib/mysql/mysql.sock \
  97.             --prefix=/ \
  98.         --with-extra-charsets=complex \
  99.             --exec-prefix=/usr \
  100.             --libexecdir=/usr/sbin \
  101.             --sysconfdir=/etc \
  102.             --datadir=/usr/share \
  103.             --localstatedir=/var/lib/mysql \
  104.             --infodir=/usr/info \
  105.             --includedir=/usr/include \
  106.             --mandir=/usr/man \
  107.             --with-berkeley-db \
  108.             --with-innodb \
  109.         --with-comment=\"Official MySQL-Max RPM\";
  110.         # Add this for more debugging support
  111.         # --with-debug
  112.         # Add this for MyISAM RAID support:
  113.         # --with-raid
  114.         "
  115.  make
  116. }
  117.  
  118. # Use the build root for temporary storage of the shared libraries.
  119.  
  120. RBR=$RPM_BUILD_ROOT
  121. MBD=$RPM_BUILD_DIR/mysql-max-%{mysql_version}
  122. if test -z "$RBR" -o "$RBR" = "/"
  123. then
  124.     echo "RPM_BUILD_ROOT has stupid value"
  125.     exit 1
  126. fi
  127. rm -rf $RBR
  128. mkdir -p $RBR
  129.  
  130. #cd $MBD/db-%{db_version}/dist 
  131. #./configure --prefix=$RBR/usr/BDB
  132. #make install
  133. #
  134. #echo $RBR $MBD
  135. #cd $MBD
  136.  
  137. BuildMySQL "--disable-shared" \
  138.        "--with-mysqld-ldflags='-all-static'" \
  139.        "--with-client-ldflags='-all-static'"
  140.  
  141. %install -n mysql-max-%{mysql_version}
  142. RBR=$RPM_BUILD_ROOT
  143. MBD=$RPM_BUILD_DIR/mysql-max-%{mysql_version}
  144. # Ensure that needed directories exists
  145. install -d $RBR/etc/{logrotate.d,rc.d/init.d}
  146. install -d $RBR/var/lib/mysql/mysql
  147. install -d $RBR/usr/share/sql-bench
  148. install -d $RBR/usr/share/mysql-test
  149. install -d $RBR/usr/{sbin,share,man,include}
  150. install -d $RBR/usr/doc/MySQL-%{mysql_version}
  151. install -d $RBR/usr/lib
  152. # Make install
  153. make install DESTDIR=$RBR benchdir_root=/usr/share/
  154.  
  155. # Install logrotate and autostart
  156. install -m644 $MBD/support-files/mysql-log-rotate $RBR/etc/logrotate.d/mysql
  157. install -m755 $MBD/support-files/mysql.server $RBR/etc/rc.d/init.d/mysql
  158.  
  159. # Install docs
  160. install -m644 $RPM_BUILD_DIR/mysql-max-%{mysql_version}/Docs/mysql.info \
  161.  $RBR/usr/info/mysql.info
  162. for file in README COPYING COPYING.LIB Docs/manual_toc.html Docs/manual.html \
  163.     Docs/manual.txt Docs/manual.texi Docs/manual.ps \
  164.     support-files/my-huge.cnf support-files/my-large.cnf \
  165.     support-files/my-medium.cnf support-files/my-small.cnf
  166. do
  167.     b=`basename $file`
  168.     install -m644 $MBD/$file $RBR/usr/doc/MySQL-%{mysql_version}/$b
  169. done
  170.  
  171. %pre
  172. if test -x /etc/rc.d/init.d/mysql
  173. then
  174.   /etc/rc.d/init.d/mysql stop > /dev/null 2>&1
  175.   echo "Giving mysqld a couple of seconds to exit nicely"
  176.   sleep 5
  177. fi
  178.  
  179. %post
  180. mysql_datadir=/var/lib/mysql
  181.  
  182. # Create data directory if needed
  183. if test ! -d $mysql_datadir;        then mkdir $mysql_datadir; fi
  184. if test ! -d $mysql_datadir/mysql;    then mkdir $mysql_datadir/mysql; fi
  185. if test ! -d $mysql_datadir/test;    then mkdir $mysql_datadir/test; fi
  186.  
  187. # Make MySQL start/shutdown automatically when the machine does it.
  188. /sbin/chkconfig --add mysql
  189.  
  190. # Create a MySQL user. Do not report any problems if it already
  191. # exists. This is redhat specific and should be handled more portable
  192. useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" mysql 2> /dev/null || true 
  193.  
  194. # Change permissions so that the user that will run the MySQL daemon
  195. # owns all database files.
  196. chown -R mysql $mysql_datadir
  197.  
  198. # Initiate databases
  199. mysql_install_db -IN-RPM
  200.  
  201. # Change permissions again to fix any new files.
  202. chown -R mysql $mysql_datadir
  203.  
  204. # Fix permissions for the permission database so that only the user
  205. # can read them.
  206. chmod -R og-rw $mysql_datadir/mysql
  207.  
  208. # Restart in the same way that mysqld will be started normally.
  209. /etc/rc.d/init.d/mysql start
  210.  
  211. # Allow safe_mysqld to start mysqld and print a message before we exit
  212. sleep 2
  213.  
  214. %preun
  215. if test -x /etc/rc.d/init.d/mysql
  216. then
  217.   /etc/rc.d/init.d/mysql stop > /dev/null
  218. fi
  219. # Remove autostart of mysql
  220. if test $1 = 0
  221. then
  222.    /sbin/chkconfig --del mysql
  223. fi
  224. # We do not remove the mysql user since it may still own a lot of
  225. # database files.
  226.  
  227. %files
  228. %attr(-, root, root) %doc /usr/doc/MySQL-%{mysql_version}/
  229.  
  230. %attr(755, root, root) /usr/bin/isamchk
  231. %attr(755, root, root) /usr/bin/isamlog
  232. %attr(755, root, root) /usr/bin/pack_isam
  233. %attr(755, root, root) /usr/bin/myisamchk
  234. %attr(755, root, root) /usr/bin/myisamlog
  235. %attr(755, root, root) /usr/bin/myisampack
  236. %attr(755, root, root) /usr/bin/mysql_fix_privilege_tables
  237. %attr(755, root, root) /usr/bin/mysql_convert_table_format
  238. %attr(755, root, root) /usr/bin/mysql_install_db
  239. %attr(755, root, root) /usr/bin/mysql_setpermission
  240. %attr(755, root, root) /usr/bin/mysql_zap
  241. %attr(755, root, root) /usr/bin/mysqlbug
  242. %attr(755, root, root) /usr/bin/mysqltest
  243. %attr(755, root, root) /usr/bin/mysqlhotcopy
  244. %attr(755, root, root) /usr/bin/perror
  245. %attr(755, root, root) /usr/bin/replace
  246. %attr(755, root, root) /usr/bin/resolveip
  247. %attr(755, root, root) /usr/bin/safe_mysqld
  248. %attr(755, root, root) /usr/bin/mysqld_multi
  249. %attr(755, root, root) /usr/bin/my_print_defaults
  250.  
  251. %attr(644, root, root) /usr/info/mysql.info*
  252.  
  253. %attr(755, root, root) /usr/sbin/mysqld
  254.  
  255. %attr(644, root, root) /etc/logrotate.d/mysql
  256. %attr(755, root, root) /etc/rc.d/init.d/mysql
  257.  
  258. %attr(755, root, root) /usr/share/mysql/
  259.  
  260. %changelog 
  261.  
  262. * Fri Apr 13 2001 Monty
  263.   First version of mysql-max.spec.sh based on mysql.spec.sh
  264.