wok-next view mysql/receipt @ rev 20869
mono: fix build on 32-bit
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Mon Jul 02 10:15:48 2018 +0300 (2018-07-02) |
parents | 9278a60d6895 |
children | c9a7a7b42a86 |
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/"
10 #CROSS="bug: can not run test programm"
12 TARBALL="$PACKAGE-$VERSION.tar.gz"
13 WGET_URL="ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-${VERSION%.*}/$TARBALL"
15 BUILD_DEPENDS="cmake zlib-dev ncurses-dev readline-dev libunistring-dev \
16 libaio-dev"
17 SPLIT="libmysqlclient mysql-client mysql-test mysql-dev mysql"
19 compile_rules() {
20 mkdir build; 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 && make DESTDIR=$DESTDIR install || return 1
59 # fix paths
60 mv $install/usr/mysql-test $install/usr/share/mysql-test
61 mv $install/usr/sql-bench $install/usr/share/sql-bench
63 # Configuration file
64 mkdir -p $install/etc
65 cp -a $stuff/etc/init.d $install/etc
66 cp -a $stuff/etc/mysql $install/etc
67 chown -R root:root $install/etc
68 }
70 genpkg_rules() {
71 case $PACKAGE in
72 libmysqlclient)
73 copy libmysqlclient*so*
74 CAT="database|client libraries"
75 DEPENDS="zlib"
76 ;;
77 mysql-client)
78 # client binaries (plus /usr/bin/mysql), see $src/build/client
79 copy /bin/mysql mysql_plugin mysql_upgrade mysqladmin mysqlbinlog \
80 mysqlcheck mysqldump mysqlimport mysqlshow mysqlslap mysqltest
81 CAT="database|client files"
82 PROVIDE="mysql_or_postgresql"
83 DEPENDS="libmysqlclient ncurses zlib"
84 ;;
85 mysql-test)
86 copy mysql-test/ sql-bench/ db.opt
87 CAT="development|tests and benchmarks"
88 DEPENDS="mysql perl"
89 ;;
90 *-dev)
91 copy @dev mysql_config
92 rm -r $fs/usr/share/mysql-test
93 ;;
94 mysql)
95 copy @std @rm
96 DEPENDS="libmysqlclient libaio mysql-client slitaz-base-files \
97 ncurses zlib"
98 CONFIG_FILES="/etc/mysql"
99 DATABASE_FILES="/var/lib/mysql"
100 TAZPANEL_DAEMON="man|edit::/etc/mysql/my.cnf|options|web::$WEB_SITE"
101 ;;
102 esac
103 }
105 pre_install_mysql() {
106 # Cleanup old files
107 rm -f "$1/usr/libexec/mysql"*
108 # Move old config
109 [ -f "$1/etc/my.cnf" ] && mv -f "$1/etc/my.cnf" "$1/etc/mysql/my.cnf"
110 }
112 post_install_mysql() {
113 chmod 600 "$1/etc/mysql/my.cnf"
115 local user=mysql group=mysql
117 if ! grep -q $user "$1/etc/passwd"; then
118 action "Adding user/group $user..."
119 chroot "$1/" addgroup -S $group
120 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user
121 status
122 fi
123 # adduser mysql if needed
124 if ! grep -q $user "$1/etc/passwd"; then
125 action "Adding MySQL Daemon user..."
126 chroot "$1/" /bin/adduser -s /bin/false -h /dev/null \
127 -g "MySQL Daemon user" -u 27 -H -D -S -G $group $user
128 status
129 fi
130 #chroot "$1/" /bin/chown $user.$group $(cat "$1/$INSTALLED/$PACKAGE/files.list")
131 mkdir -p "$1/var/lib/mysql"
132 chroot "$1/" /bin/chown -R $user.$group /var/lib/mysql
133 chroot "$1/" mysql_install_db --user=$user --basedir=/usr
135 [ -n "$quiet" ] || cat <<EOF
137 .----------------------------------------------.
138 | To start mysql server you can run: |
139 | /etc/init.d/mysql start |
140 | |
141 | Or add mysql to RUN_DAEMONS in /etc/rcS.conf |
142 '----------------------------------------------'
143 EOF
144 }
146 post_remove_mysql() {
147 echo "Removing user/group mysql"
148 chroot "$1/" deluser mysql
149 }
151 post_install_mysql_test() {
152 chmod 2777 "$1/usr/share/mysql-test"
153 chmod 2777 "$1/usr/share/sql-bench"
154 }