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

  1. %define mysql_version        3.23.36
  2. %define shared_lib_version    10:0:0
  3. %define release            1
  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.36
  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>
  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
  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. See the documentation for more information
  49.  
  50. %description -l pt_BR
  51. O MySQL é um servidor de banco de dados SQL realmente multiusuário e\
  52. multi-tarefa. A linguagem SQL é a mais popular linguagem para banco de\
  53. dados no mundo. O MySQL é uma implementação cliente/servidor que\
  54. consiste de um servidor chamado mysqld e diversos\
  55. programas/bibliotecas clientes. Os principais objetivos do MySQL são:\
  56. velocidade, robustez e facilidade de uso.  O MySQL foi originalmente\
  57. desenvolvido porque nós na Tcx precisávamos de um servidor SQL que\
  58. pudesse lidar com grandes bases de dados e com uma velocidade muito\
  59. maior do que a que qualquer vendedor podia nos oferecer. Estamos\
  60. usando\
  61. o MySQL desde 1996 em um ambiente com mais de 40 bases de dados com 10.000\
  62. tabelas, das quais mais de 500 têm mais de 7 milhões de linhas. Isto é o\
  63. equivalente a aproximadamente 50G de dados críticos. A base da construção do\
  64. MySQL é uma série de rotinas que foram usadas em um ambiente de produção com\
  65. alta demanda por muitos anos. Mesmo o MySQL estando ainda em desenvolvimento,\
  66. ele já oferece um conjunto de funções muito ricas e úteis. Veja a documentação\
  67. para maiores informações.
  68.  
  69. %package client
  70. Release: %{release}
  71. Summary: MySQL - Client
  72. Group: Applications/Databases
  73. Summary(pt_BR): MySQL - Cliente
  74. Group(pt_BR): Aplicações/Banco_de_Dados
  75. Obsoletes: mysql-client
  76.  
  77. %description client
  78. This package contains the standard MySQL clients. 
  79.  
  80. %{see_base}
  81.  
  82. %description client -l pt_BR
  83. Este pacote contém os clientes padrão para o MySQL.
  84.  
  85. %package bench
  86. Release: %{release}
  87. Requires: MySQL-client MySQL-DBI-perl-bin perl
  88. Summary: MySQL - Benchmarks and test system
  89. Group: Applications/Databases
  90. Summary(pt_BR): MySQL - Medições de desempenho
  91. Group(pt_BR): Aplicações/Banco_de_Dados
  92. Obsoletes: mysql-bench
  93.  
  94. %description bench
  95. This package contains MySQL benchmark scripts and data.
  96.  
  97. %{see_base}
  98.  
  99. %description bench -l pt_BR
  100. Este pacote contém medições de desempenho de scripts e dados do MySQL.
  101.  
  102. %package devel
  103. Release: %{release}
  104. Requires: MySQL-client
  105. Summary: MySQL - Development header files and libraries
  106. Group: Applications/Databases
  107. Summary(pt_BR): MySQL - Medições de desempenho
  108. Group(pt_BR): Aplicações/Banco_de_Dados
  109. Obsoletes: mysql-devel
  110.  
  111. %description devel
  112. This package contains the development header files and libraries
  113. necessary to develop MySQL client applications.
  114.  
  115. %{see_base}
  116.  
  117. %description devel -l pt_BR
  118. Este pacote contém os arquivos de cabeçalho (header files) e bibliotecas 
  119. necessárias para desenvolver aplicações clientes do MySQL. 
  120.  
  121. %package shared
  122. Release: %{release}
  123. Summary: MySQL - Shared libraries
  124. Group: Applications/Databases
  125.  
  126. %description shared
  127. This package contains the shared libraries (*.so*) which certain
  128. languages and applications need to dynamically load and use MySQL.
  129.  
  130. %prep
  131. %setup -n mysql-%{mysql_version}
  132.  
  133. %build
  134. # The all-static flag is to make the RPM work on different
  135. # distributions. This version tries to put shared mysqlclient libraries
  136. # in a separate package.
  137.  
  138. BuildMySQL() {
  139. # The --enable-assembler simply does nothing on systems that does not
  140. # support assembler speedups.
  141. sh -c  "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \
  142.     CC=\"${MYSQL_BUILD_CC:-egcs}\" \
  143.     CFLAGS=\"${MYSQL_BUILD_CFLAGS:- -O6 -fno-omit-frame-pointer}\" \
  144.     CXX=\"${MYSQL_BUILD_CXX:-egcs}\" \
  145.     CXXFLAGS=\"${MYSQL_BUILD_CXXFLAGS:- -O6 \
  146.               -felide-constructors -fno-exceptions -fno-rtti \
  147.           -fno-omit-frame-pointer}\" \
  148.     ./configure \
  149.          $* \
  150.         --enable-assembler \
  151.             --with-mysqld-user=%{mysqld_user} \
  152.             --with-unix-socket-path=/var/lib/mysql/mysql.sock \
  153.             --prefix=/ \
  154.         --with-extra-charsets=complex \
  155.             --exec-prefix=/usr \
  156.             --libexecdir=/usr/sbin \
  157.             --sysconfdir=/etc \
  158.             --datadir=/usr/share \
  159.             --localstatedir=/var/lib/mysql \
  160.             --infodir=/usr/info \
  161.             --includedir=/usr/include \
  162.             --mandir=/usr/man \
  163.         --without-berkeley-db \
  164.         --without-innobase \
  165.         --with-comment=\"Official MySQL RPM\";
  166.         # Add this for more debugging support
  167.         # --with-debug
  168.         # Add this for MyISAM RAID support:
  169.         # --with-raid
  170.         "
  171.  
  172.  # benchdir does not fit in above model. Maybe a separate bench distribution
  173.  make benchdir_root=$RPM_BUILD_ROOT/usr/share/
  174. }
  175.  
  176. # Use the build root for temporary storage of the shared libraries.
  177.  
  178. RBR=$RPM_BUILD_ROOT
  179. MBD=$RPM_BUILD_DIR/mysql-%{mysql_version}
  180. if test -z "$RBR" -o "$RBR" = "/"
  181. then
  182.     echo "RPM_BUILD_ROOT has stupid value"
  183.     exit 1
  184. fi
  185. rm -rf $RBR
  186. mkdir -p $RBR
  187.  
  188. BuildMySQL "--enable-shared --enable-thread-safe-client --without-server"
  189.  
  190. # Save everything for debus
  191. tar cf $RBR/all.tar .
  192.  
  193. # Save shared libraries
  194. (cd libmysql/.libs; tar cf $RBR/shared-libs.tar *.so*)
  195. (cd libmysql_r/.libs; tar rf $RBR/shared-libs.tar *.so*)
  196.  
  197. # Save manual to avoid rebuilding
  198. mv Docs/manual.ps Docs/manual.ps.save
  199. make distclean
  200. mv Docs/manual.ps.save Docs/manual.ps
  201.  
  202. BuildMySQL "--disable-shared" \
  203.        "--with-mysqld-ldflags='-all-static'" \
  204.        "--with-client-ldflags='-all-static'"
  205.  
  206. %install -n mysql-%{mysql_version}
  207. RBR=$RPM_BUILD_ROOT
  208. MBD=$RPM_BUILD_DIR/mysql-%{mysql_version}
  209. # Ensure that needed directories exists
  210. install -d $RBR/etc/{logrotate.d,rc.d/init.d}
  211. install -d $RBR/var/lib/mysql/mysql
  212. install -d $RBR/usr/share/sql-bench
  213. install -d $RBR/usr/share/mysql-test
  214. install -d $RBR/usr/{sbin,share,man,include}
  215. install -d $RBR/usr/doc/MySQL-%{mysql_version}
  216. install -d $RBR/usr/lib
  217. # Make install
  218. make install DESTDIR=$RBR benchdir_root=/usr/share/
  219.  
  220. # Install shared libraries (Disable for architectures that don't support it)
  221. (cd $RBR/usr/lib; tar xf $RBR/shared-libs.tar)
  222.  
  223. # Install logrotate and autostart
  224. install -m644 $MBD/support-files/mysql-log-rotate $RBR/etc/logrotate.d/mysql
  225. install -m755 $MBD/support-files/mysql.server $RBR/etc/rc.d/init.d/mysql
  226.  
  227. # Install docs
  228. install -m644 $RPM_BUILD_DIR/mysql-%{mysql_version}/Docs/mysql.info \
  229.  $RBR/usr/info/mysql.info
  230. for file in README COPYING COPYING.LIB Docs/manual_toc.html Docs/manual.html \
  231.     Docs/manual.txt Docs/manual.texi Docs/manual.ps \
  232.     support-files/my-huge.cnf support-files/my-large.cnf \
  233.     support-files/my-medium.cnf support-files/my-small.cnf
  234. do
  235.     b=`basename $file`
  236.     install -m644 $MBD/$file $RBR/usr/doc/MySQL-%{mysql_version}/$b
  237. done
  238.  
  239. %pre
  240. if test -x /etc/rc.d/init.d/mysql
  241. then
  242.   /etc/rc.d/init.d/mysql stop > /dev/null 2>&1
  243.   echo "Giving mysqld a couple of seconds to exit nicely"
  244.   sleep 5
  245. fi
  246.  
  247. %post
  248. mysql_datadir=/var/lib/mysql
  249.  
  250. # Create data directory if needed
  251. if test ! -d $mysql_datadir;        then mkdir $mysql_datadir; fi
  252. if test ! -d $mysql_datadir/mysql;    then mkdir $mysql_datadir/mysql; fi
  253. if test ! -d $mysql_datadir/test;    then mkdir $mysql_datadir/test; fi
  254.  
  255. # Make MySQL start/shutdown automatically when the machine does it.
  256. /sbin/chkconfig --add mysql
  257.  
  258. # Create a MySQL user. Do not report any problems if it already
  259. # exists. This is redhat specific and should be handled more portable
  260. useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" mysql 2> /dev/null || true 
  261.  
  262. # Change permissions so that the user that will run the MySQL daemon
  263. # owns all database files.
  264. chown -R mysql $mysql_datadir
  265.  
  266. # Initiate databases
  267. mysql_install_db -IN-RPM
  268.  
  269. # Change permissions again to fix any new files.
  270. chown -R mysql $mysql_datadir
  271.  
  272. # Fix permissions for the permission database so that only the user
  273. # can read them.
  274. chmod -R og-rw $mysql_datadir/mysql
  275.  
  276. # Restart in the same way that mysqld will be started normally.
  277. /etc/rc.d/init.d/mysql start
  278.  
  279. # Allow safe_mysqld to start mysqld and print a message before we exit
  280. sleep 2
  281.  
  282. %preun
  283. if test -x /etc/rc.d/init.d/mysql
  284. then
  285.   /etc/rc.d/init.d/mysql stop > /dev/null
  286. fi
  287. # Remove autostart of mysql
  288. if test $1 = 0
  289. then
  290.    /sbin/chkconfig --del mysql
  291. fi
  292. # We do not remove the mysql user since it may still own a lot of
  293. # database files.
  294.  
  295. %files
  296. %attr(-, root, root) %doc /usr/doc/MySQL-%{mysql_version}/
  297.  
  298. %attr(755, root, root) /usr/bin/isamchk
  299. %attr(755, root, root) /usr/bin/isamlog
  300. %attr(755, root, root) /usr/bin/pack_isam
  301. %attr(755, root, root) /usr/bin/myisamchk
  302. %attr(755, root, root) /usr/bin/myisamlog
  303. %attr(755, root, root) /usr/bin/myisampack
  304. %attr(755, root, root) /usr/bin/mysql_fix_privilege_tables
  305. %attr(755, root, root) /usr/bin/mysql_convert_table_format
  306. %attr(755, root, root) /usr/bin/mysql_install_db
  307. %attr(755, root, root) /usr/bin/mysql_setpermission
  308. %attr(755, root, root) /usr/bin/mysql_zap
  309. %attr(755, root, root) /usr/bin/mysqlbug
  310. %attr(755, root, root) /usr/bin/mysqltest
  311. %attr(755, root, root) /usr/bin/mysqlhotcopy
  312. %attr(755, root, root) /usr/bin/perror
  313. %attr(755, root, root) /usr/bin/replace
  314. %attr(755, root, root) /usr/bin/resolveip
  315. %attr(755, root, root) /usr/bin/safe_mysqld
  316. %attr(755, root, root) /usr/bin/mysqld_multi
  317. %attr(755, root, root) /usr/bin/my_print_defaults
  318.  
  319. %attr(644, root, root) /usr/info/mysql.info*
  320.  
  321. %attr(755, root, root) /usr/sbin/mysqld
  322.  
  323. %attr(644, root, root) /etc/logrotate.d/mysql
  324. %attr(755, root, root) /etc/rc.d/init.d/mysql
  325.  
  326. %attr(755, root, root) /usr/share/mysql/
  327.  
  328. %files client
  329. %attr(755, root, root) /usr/bin/msql2mysql
  330. %attr(755, root, root) /usr/bin/mysql
  331. %attr(755, root, root) /usr/bin/mysqlaccess
  332. %attr(755, root, root) /usr/bin/mysqladmin
  333. %attr(755, root, root) /usr/bin/mysql_find_rows
  334. %attr(755, root, root) /usr/bin/mysqldump
  335. %attr(755, root, root) /usr/bin/mysqlimport
  336. %attr(755, root, root) /usr/bin/mysqlshow
  337. %attr(755, root, root) /usr/bin/mysqlbinlog
  338.  
  339. %attr(644, root, man) %doc /usr/man/man1/mysql.1*
  340. %attr(644, root, man) %doc /usr/man/man1/isamchk.1*
  341. %attr(644, root, man) %doc /usr/man/man1/isamlog.1*
  342. %attr(644, root, man) %doc /usr/man/man1/mysql_zap.1*
  343. %attr(644, root, man) %doc /usr/man/man1/mysqlaccess.1*
  344. %attr(644, root, man) %doc /usr/man/man1/mysqladmin.1*
  345. %attr(644, root, man) %doc /usr/man/man1/mysqld.1*
  346. %attr(644, root, man) %doc /usr/man/man1/mysqld_multi.1*
  347. %attr(644, root, man) %doc /usr/man/man1/mysqldump.1*
  348. %attr(644, root, man) %doc /usr/man/man1/mysqlshow.1*
  349. %attr(644, root, man) %doc /usr/man/man1/perror.1*
  350. %attr(644, root, man) %doc /usr/man/man1/replace.1*
  351. %attr(644, root, man) %doc /usr/man/man1/safe_mysqld.1*
  352.  
  353. %post shared
  354. /sbin/ldconfig
  355.  
  356. %postun shared
  357. /sbin/ldconfig
  358.  
  359. %files devel
  360. %attr(755, root, root) /usr/bin/comp_err
  361. %attr(755, root, root) /usr/include/mysql/
  362. %attr(755, root, root) /usr/lib/mysql/
  363. %attr(755, root, root) /usr/bin/mysql_config
  364.  
  365. %files shared
  366. # Shared libraries (omit for architectures that don't support them)
  367. %attr(755, root, root) /usr/lib/*.so*
  368.  
  369. %files bench
  370. %attr(-, root, root) /usr/share/sql-bench
  371. %attr(-, root, root) /usr/share/mysql-test
  372.  
  373. %changelog 
  374.  
  375. * Tue Jan 2  2001  Monty
  376.  
  377. - Added mysql-test to the bench package
  378.  
  379. * Fri Aug 18 2000 Tim Smith <tim@mysql.com>
  380.  
  381. - Added separate libmysql_r directory; now both a threaded
  382.   and non-threaded library is shipped.
  383.  
  384. * Wed Sep 28 1999 David Axmark <davida@mysql.com>
  385.  
  386. - Added the support-files/my-example.cnf to the docs directory.
  387.  
  388. - Removed devel dependency on base since it is about client
  389.   development.
  390.  
  391. * Wed Sep 8 1999 David Axmark <davida@mysql.com>
  392.  
  393. - Cleaned up some for 3.23.
  394.  
  395. * Thu Jul 1 1999 David Axmark <davida@mysql.com>
  396.  
  397. - Added support for shared libraries in a separate sub
  398.   package. Original fix by David Fox (dsfox@cogsci.ucsd.edu)
  399.  
  400. - The --enable-assembler switch is now automatically disables on
  401.   platforms there assembler code is unavailable. This should allow
  402.   building this RPM on non i386 systems.
  403.  
  404. * Mon Feb 22 1999 David Axmark <david@detron.se>
  405.  
  406. - Removed unportable cc switches from the spec file. The defaults can
  407.   now be overridden with environment variables. This feature is used
  408.   to compile the official RPM with optimal (but compiler version
  409.   specific) switches.
  410.  
  411. - Removed the repetitive description parts for the sub rpms. Maybe add
  412.   again if RPM gets a multiline macro capability.
  413.  
  414. - Added support for a pt_BR translation. Translation contributed by
  415.   Jorge Godoy <jorge@bestway.com.br>.
  416.  
  417. * Wed Nov 4 1998 David Axmark <david@detron.se>
  418.  
  419. - A lot of changes in all the rpm and install scripts. This may even
  420.   be a working RPM :-)
  421.  
  422. * Sun Aug 16 1998 David Axmark <david@detron.se>
  423.  
  424. - A developers changelog for MySQL is available in the source RPM. And
  425.   there is a history of major user visible changed in the Reference
  426.   Manual.  Only RPM specific changes will be documented here.
  427.