wok-current view mysql/receipt @ rev 14888
Up: python-formalchemy (1.4.2)
author | Claudinei Pereira <claudinei@slitaz.org> |
---|---|
date | Wed Jul 24 19:01:54 2013 -0300 (2013-07-24) |
parents | 96e4513829cd |
children | 408c87fa22ca |
line source
1 # SliTaz package receipt.
3 PACKAGE="mysql"
4 VERSION="5.5.27"
5 CATEGORY="office"
6 SHORT_DESC="SQL database system."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.gz"
9 WEB_SITE="http://www.mysql.com/"
10 WGET_URL="ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-5.5/$TARBALL"
11 CONFIG_FILES="/etc/mysql"
12 DATABASE_FILES="/var/lib/mysql"
13 TAZPANEL_DAEMON="man|edit::/etc/mysql/my.cnf|options|web::$WEB_SITE"
14 CROSS="bug: can not run test programm"
16 DEPENDS="busybox libmysqlclient mysql-client zlib slitaz-base-files \
17 gcc-lib-base openssl readline"
18 BUILD_DEPENDS="cmake openssl-dev zlib-dev ncurses-dev readline-dev"
20 # Rules to configure and make the package.
21 compile_rules()
22 {
23 mkdir -p $WOK/$PACKAGE/source/build
24 cd $WOK/$PACKAGE/source/build
25 # CFLAGS/CXXFLAGS as suggested upstream
26 CFLAGS="-fPIC ${CFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -fomit-frame-pointer" \
27 CXXFLAGS="-fPIC ${CXXFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -felide-constructors -fno-rtti" \
28 cmake ../$PACKAGE-$VERSION \
29 -DCMAKE_BUILD_TYPE=Release \
30 -DCMAKE_INSTALL_PREFIX=/usr \
31 -DSYSCONFDIR=/etc/mysql \
32 -DMYSQL_DATADIR=/var/lib/mysql \
33 -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
34 -DDEFAULT_CHARSET=utf8 \
35 -DDEFAULT_COLLATION=utf8_general_ci \
36 -DENABLED_LOCAL_INFILE=ON \
37 -DINSTALL_INFODIR=share/mysql/docs \
38 -DINSTALL_MANDIR=share/man \
39 -DINSTALL_PLUGINDIR=/usr/lib/mysql/plugin \
40 -DINSTALL_SCRIPTDIR=bin \
41 -DINSTALL_INCLUDEDIR=include/mysql \
42 -DINSTALL_DOCREADMEDIR=share/mysql \
43 -DINSTALL_SUPPORTFILESDIR=share/mysql \
44 -DINSTALL_MYSQLSHAREDIR=share/mysql \
45 -DINSTALL_DOCDIR=share/mysql/docs \
46 -DINSTALL_SHAREDIR=share/mysql \
47 -DWITH_READLINE=ON \
48 -DWITH_ZLIB=system \
49 -DWITH_SSL=system \
50 -DWITH_LIBWRAP=OFF \
51 -DWITH_MYSQLD_LDFLAGS="${LDFLAGS}" \
52 -DWITH_EXTRA_CHARSETS=complex \
53 -DWITH_EMBEDDED_SERVER=ON \
54 -DWITH_INNOBASE_STORAGE_ENGINE=1 \
55 -DWITH_PARTITION_STORAGE_ENGINE=1 \
56 -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
57 -DWITHOUT_ARCHIVE_STORAGE_ENGINE=1 \
58 -DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1 \
59 -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 &&
60 make && make DESTDIR=$DESTDIR install
61 }
63 # Rules to gen a SliTaz package suitable for Tazpkg.
64 genpkg_rules()
65 {
66 mkdir -p \
67 $fs/usr/share \
68 $fs/usr/lib/mysql/plugin \
69 $fs/etc/mysql \
70 $fs/etc/mysql.d \
71 $fs/var/lib/mysql \
72 $fs/var/run/mysqld
74 cp -a $install/usr/bin $fs/usr
75 cp -a $install/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
76 cp -a $install/usr/share/mysql $fs/usr/share
78 # Configuration file
79 cp -a $stuff/etc/init.d $fs/etc
80 cp -a $stuff/etc/mysql $fs/etc
81 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
82 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
83 $fs/etc/mysql/my.cnf
85 # Permissions
86 chmod 600 $fs/etc/mysql/my.cnf
88 cat $stuff/*.files-list | while read file; do
89 [ -f $fs$file ] && rm -f $fs$file
90 done
92 }
94 # Pre and post install commands for Tazpkg.
95 post_install()
96 {
98 local user
99 local group
101 user=mysql
102 group=mysql
104 if ! grep -q $user $1/etc/passwd; then
105 echo -n "Adding user/group $user..."
106 chroot $1/ addgroup -S $group
107 chroot $1/ adduser -s /bin/false -S -D -H -G $group $user
108 status
109 fi
110 # adduser mysql if needed
111 if ! grep -q ${user} $1/etc/passwd; then
112 echo -n "Adding user MySQL..."
113 chroot $1/ /bin/adduser -s /bin/false -h /dev/null \
114 -g "MySQL Daemon user" -u 27 -H -D -S -G ${group} ${user}
115 status
116 fi
117 #chroot $1/ /bin/chown ${user}.${group} $(cat $1/$INSTALLED/$PACKAGE/files.list)
118 chroot "$1/" /bin/chown -R ${user}.${group} /var/lib/mysql /var/run/mysqld
119 chroot "$1/" mysql_install_db --user=${user} --basedir=/usr
120 cat <<EOF
121 ----
122 To start $PACKAGE server you can run :
124 /etc/init.d/$PACKAGE start
126 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
127 ----
128 EOF
129 }
131 pre_install()
132 {
133 # Cleanup old files
134 rm -f $1/usr/libexec/mysql*
135 # Mv config
136 [ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf
137 }
139 post_remove()
140 {
141 echo "Removing user/group mysql"
142 chroot "$1/" deluser mysql
143 }