wok-current view mysql/receipt @ rev 13924
Up: atk (2.6.0)
author | Alexander Medvedev <devl547@gmail.com> |
---|---|
date | Fri Jan 25 23:21:02 2013 +0000 (2013-01-25) |
parents | d2ea785a98d7 |
children | e9130cce9043 |
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/my.cnf"
12 DATABASE_FILES="/var/lib/mysql"
13 CROSS="bug: can not run test programm"
15 DEPENDS="busybox libmysqlclient mysql-client zlib slitaz-base-files \
16 gcc-lib-base openssl readline"
17 BUILD_DEPENDS="cmake openssl-dev zlib-dev ncurses-dev readline-dev"
19 # Rules to configure and make the package.
20 compile_rules()
21 {
22 mkdir -p $WOK/$PACKAGE/source/build
23 cd $WOK/$PACKAGE/source/build
24 # CFLAGS/CXXFLAGS as suggested upstream
25 CFLAGS="-fPIC ${CFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -fomit-frame-pointer" \
26 CXXFLAGS="-fPIC ${CXXFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -felide-constructors -fno-rtti" \
27 cmake ../$PACKAGE-$VERSION \
28 -DCMAKE_BUILD_TYPE=Release \
29 -DCMAKE_INSTALL_PREFIX=/usr \
30 -DSYSCONFDIR=/etc/mysql \
31 -DMYSQL_DATADIR=/var/lib/mysql \
32 -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
33 -DDEFAULT_CHARSET=utf8 \
34 -DDEFAULT_COLLATION=utf8_general_ci \
35 -DENABLED_LOCAL_INFILE=ON \
36 -DINSTALL_INFODIR=share/mysql/docs \
37 -DINSTALL_MANDIR=share/man \
38 -DINSTALL_PLUGINDIR=/usr/lib/mysql/plugin \
39 -DINSTALL_SCRIPTDIR=bin \
40 -DINSTALL_INCLUDEDIR=include/mysql \
41 -DINSTALL_DOCREADMEDIR=share/mysql \
42 -DINSTALL_SUPPORTFILESDIR=share/mysql \
43 -DINSTALL_MYSQLSHAREDIR=share/mysql \
44 -DINSTALL_DOCDIR=share/mysql/docs \
45 -DINSTALL_SHAREDIR=share/mysql \
46 -DWITH_READLINE=ON \
47 -DWITH_ZLIB=system \
48 -DWITH_SSL=system \
49 -DWITH_LIBWRAP=OFF \
50 -DWITH_MYSQLD_LDFLAGS="${LDFLAGS}" \
51 -DWITH_EXTRA_CHARSETS=complex \
52 -DWITH_EMBEDDED_SERVER=ON \
53 -DWITH_INNOBASE_STORAGE_ENGINE=1 \
54 -DWITH_PARTITION_STORAGE_ENGINE=1 \
55 -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
56 -DWITHOUT_ARCHIVE_STORAGE_ENGINE=1 \
57 -DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1 \
58 -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 &&
59 make && make DESTDIR=$DESTDIR install
60 }
62 # Rules to gen a SliTaz package suitable for Tazpkg.
63 genpkg_rules()
64 {
65 mkdir -p \
66 $fs/usr/share \
67 $fs/usr/lib/mysql/plugin \
68 $fs/etc/mysql \
69 $fs/etc/mysql.d \
70 $fs/var/lib/mysql \
71 $fs/var/run/mysqld
73 cp -a $install/usr/bin $fs/usr
74 cp -a $install/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
75 cp -a $install/usr/share/mysql $fs/usr/share
77 # Configuration file
78 cp -a $stuff/etc/init.d $fs/etc
79 cp -a $stuff/etc/mysql $fs/etc
80 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
81 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
82 $fs/etc/mysql/my.cnf
84 # Permissions
85 chmod 600 $fs/etc/mysql/my.cnf
87 cat $stuff/*.files-list | while read file; do
88 [ -f $fs$file ] && rm -f $fs$file
89 done
91 }
93 # Pre and post install commands for Tazpkg.
94 post_install()
95 {
97 local user
98 local group
100 user=mysql
101 group=mysql
103 if ! grep -q $user $1/etc/passwd; then
104 echo -n "Adding user/group $user..."
105 chroot $1/ addgroup -S $group
106 chroot $1/ adduser -s /bin/false -S -D -H -G $group $user
107 status
108 fi
109 # adduser mysql if needed
110 if ! grep -q ${user} $1/etc/passwd; then
111 echo -n "Adding user MySQL..."
112 chroot $1/ /bin/adduser -s /bin/false -h /dev/null \
113 -g "MySQL Daemon user" -u 27 -H -D -S -G ${group} ${user}
114 status
115 fi
116 #chroot $1/ /bin/chown ${user}.${group} $(cat $1/$INSTALLED/$PACKAGE/files.list)
117 chroot "$1/" /bin/chown -R ${user}.${group} /var/lib/mysql /var/run/mysqld
118 chroot "$1/" mysql_install_db --user=${user} --basedir=/usr
119 cat <<EOF
120 ----
121 To start $PACKAGE server you can run :
123 /etc/init.d/$PACKAGE start
125 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
126 ----
127 EOF
128 }
130 pre_install()
131 {
132 # Cleanup old files
133 rm -f $1/usr/libexec/mysql*
134 # Mv config
135 [ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf
136 }
138 post_remove()
139 {
140 echo "Removing user/group mysql"
141 chroot "$1/" deluser mysql
142 }