wok-next view mysql/receipt @ rev 21613
updated eboard (1.1.1 -> 1.1.3)
author | Hans-G?nter Theisgen |
---|---|
date | Thu Jun 25 10:33:28 2020 +0100 (2020-06-25) |
parents | c9a7a7b42a86 |
children |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="mysql"
4 VERSION="5.5.59"
5 CATEGORY="database"
6 SHORT_DESC="SQL database system"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="https://www.mysql.com/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-${VERSION%.*}/$TARBALL"
14 BUILD_DEPENDS="cmake zlib-dev ncurses-dev readline-dev libunistring-dev \
15 libaio-dev"
16 SPLIT="libmysqlclient $PACKAGE-client $PACKAGE-test $PACKAGE-dev $PACKAGE"
18 compile_rules() {
19 mkdir build
20 cd build
22 # CFLAGS/CXXFLAGS as suggested upstream
23 CFLAGS="-fPIC $CFLAGS -fno-strict-aliasing -DBIG_JOINS=1 -fomit-frame-pointer" \
24 CXXFLAGS="-fPIC $CXXFLAGS -std=gnu++98 -fno-strict-aliasing -DBIG_JOINS=1 -felide-constructors -fno-rtti" \
25 cmake .. \
26 -DCMAKE_BUILD_TYPE=Release \
27 -DCMAKE_INSTALL_PREFIX=/usr \
28 -DSYSCONFDIR=/etc/mysql \
29 -DMYSQL_DATADIR=/var/lib/mysql \
30 -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
31 -DDEFAULT_CHARSET=utf8 \
32 -DDEFAULT_COLLATION=utf8_general_ci \
33 -DENABLED_LOCAL_INFILE=ON \
34 -DINSTALL_INFODIR=share/mysql/docs \
35 -DINSTALL_MANDIR=share/man \
36 -DINSTALL_PLUGINDIR=/usr/lib/mysql/plugin \
37 -DINSTALL_SCRIPTDIR=bin \
38 -DINSTALL_INCLUDEDIR=include/mysql \
39 -DINSTALL_DOCREADMEDIR=share/mysql \
40 -DINSTALL_SUPPORTFILESDIR=share/mysql \
41 -DINSTALL_MYSQLSHAREDIR=share/mysql \
42 -DINSTALL_DOCDIR=share/mysql/docs \
43 -DINSTALL_SHAREDIR=share/mysql \
44 -DWITH_READLINE=ON \
45 -DWITH_ZLIB=system \
46 -DWITH_SSL=bundled \
47 -DWITH_LIBWRAP=OFF \
48 -DWITH_MYSQLD_LDFLAGS="$LDFLAGS" \
49 -DWITH_EXTRA_CHARSETS=complex \
50 -DWITH_EMBEDDED_SERVER=ON \
51 -DWITH_INNOBASE_STORAGE_ENGINE=1 \
52 -DWITH_PARTITION_STORAGE_ENGINE=1 \
53 -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
54 -DWITHOUT_ARCHIVE_STORAGE_ENGINE=1 \
55 -DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1 \
56 -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 &&
57 make &&
58 make DESTDIR=$install install || return 1
60 # fix paths
61 mv $install/usr/mysql-test $install/usr/share/mysql-test
62 mv $install/usr/sql-bench $install/usr/share/sql-bench
64 # Configuration file
65 mkdir -p $install/etc
66 cp -a $stuff/etc/init.d $install/etc
67 cp -a $stuff/etc/mysql $install/etc
68 chown -R root:root $install/etc
69 }
71 genpkg_rules() {
72 case $PACKAGE in
73 libmysqlclient)
74 copy libmysqlclient*so*
75 CAT="database|client libraries"
76 DEPENDS="zlib"
77 ;;
78 *-client)
79 # client binaries (plus /usr/bin/mysql), see $src/build/client
80 copy /bin/mysql mysql_plugin mysql_upgrade mysqladmin mysqlbinlog \
81 mysqlcheck mysqldump mysqlimport mysqlshow mysqlslap mysqltest
82 CAT="database|client files"
83 PROVIDE="mysql_or_postgresql"
84 DEPENDS="libmysqlclient ncurses zlib"
85 ;;
86 *-test)
87 copy mysql-test/ sql-bench/ db.opt
88 CAT="development|tests and benchmarks"
89 DEPENDS="mysql perl"
90 ;;
91 *-dev)
92 copy @dev mysql_config
93 rm -r $fs/usr/share/mysql-test
94 ;;
95 mysql)
96 copy @std @rm
97 DEPENDS="libmysqlclient libaio mysql-client slitaz-base-files \
98 ncurses zlib"
99 CONFIG_FILES="/etc/mysql"
100 DATABASE_FILES="/var/lib/mysql"
101 TAZPANEL_DAEMON="man|edit::/etc/mysql/my.cnf|options|web::$WEB_SITE"
102 ;;
103 esac
104 }
106 pre_install_mysql() {
107 # Cleanup old files
108 rm -f "$1"/usr/libexec/mysql*
109 # Move old config
110 if [ -f "$1/etc/my.cnf" ]; then
111 mv -f "$1/etc/my.cnf" "$1/etc/mysql/my.cnf"
112 fi
113 }
115 post_install_mysql() {
116 chmod 600 "$1/etc/mysql/my.cnf"
118 local user=mysql group=mysql
120 if ! grep -q $user "$1/etc/passwd"; then
121 action "Adding user/group $user..."
122 chroot "$1/" addgroup -S $group
123 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user
124 status
125 fi
126 # adduser mysql if needed
127 if ! grep -q $user "$1/etc/passwd"; then
128 action "Adding MySQL Daemon user..."
129 chroot "$1/" /bin/adduser -s /bin/false -h /dev/null \
130 -g "MySQL Daemon user" -u 27 -H -D -S -G $group $user
131 status
132 fi
133 #chroot "$1/" /bin/chown $user.$group $(cat "$1/$INSTALLED/$PACKAGE/files.list")
134 mkdir -p "$1/var/lib/mysql"
135 chroot "$1/" /bin/chown -R $user.$group /var/lib/mysql
137 if [ -n "$quiet" ]; then
138 chroot "$1/" mysql_install_db --user=$user --basedir=/usr >/dev/null 2>&1
139 else
140 chroot "$1/" mysql_install_db --user=$user --basedir=/usr
141 fi
143 [ -n "$quiet" ] || cat <<EOF
145 .----------------------------------------------.
146 | To start mysql server you can run: |
147 | /etc/init.d/mysql start |
148 | |
149 | Or add mysql to RUN_DAEMONS in /etc/rcS.conf |
150 '----------------------------------------------'
151 EOF
152 }
154 post_remove_mysql() {
155 echo "Removing user/group mysql"
156 chroot "$1/" deluser mysql
157 }
159 post_install_mysql_test() {
160 chmod 2777 "$1/usr/share/mysql-test"
161 chmod 2777 "$1/usr/share/sql-bench"
162 }