wok-next view mysql/receipt @ rev 15001

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