wok-next view mysql/receipt @ rev 20204
libjreen: update bdeps
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Nov 03 22:50:48 2017 +0100 (2017-11-03) |
parents | 4048d48a47c1 |
children | 0e7893ac206d |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="mysql"
4 VERSION="5.5.56"
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 openssl-dev zlib-dev ncurses-dev readline-dev"
16 SPLIT="libmysqlclient mysql-client mysql-test mysql-dev"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 mkdir build; cd build
23 # CFLAGS/CXXFLAGS as suggested upstream
24 CFLAGS="-fPIC ${CFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -fomit-frame-pointer" \
25 CXXFLAGS="-fPIC ${CXXFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -felide-constructors -fno-rtti" \
26 cmake .. \
27 -DCMAKE_BUILD_TYPE=Release \
28 -DCMAKE_INSTALL_PREFIX=/usr \
29 -DSYSCONFDIR=/etc/mysql \
30 -DMYSQL_DATADIR=/var/lib/mysql \
31 -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
32 -DDEFAULT_CHARSET=utf8 \
33 -DDEFAULT_COLLATION=utf8_general_ci \
34 -DENABLED_LOCAL_INFILE=ON \
35 -DINSTALL_INFODIR=share/mysql/docs \
36 -DINSTALL_MANDIR=share/man \
37 -DINSTALL_PLUGINDIR=/usr/lib/mysql/plugin \
38 -DINSTALL_SCRIPTDIR=bin \
39 -DINSTALL_INCLUDEDIR=include/mysql \
40 -DINSTALL_DOCREADMEDIR=share/mysql \
41 -DINSTALL_SUPPORTFILESDIR=share/mysql \
42 -DINSTALL_MYSQLSHAREDIR=share/mysql \
43 -DINSTALL_DOCDIR=share/mysql/docs \
44 -DINSTALL_SHAREDIR=share/mysql \
45 -DWITH_READLINE=ON \
46 -DWITH_ZLIB=system \
47 -DWITH_SSL=system \
48 -DWITH_LIBWRAP=OFF \
49 -DWITH_MYSQLD_LDFLAGS="${LDFLAGS}" \
50 -DWITH_EXTRA_CHARSETS=complex \
51 -DWITH_EMBEDDED_SERVER=ON \
52 -DWITH_INNOBASE_STORAGE_ENGINE=1 \
53 -DWITH_PARTITION_STORAGE_ENGINE=1 \
54 -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
55 -DWITHOUT_ARCHIVE_STORAGE_ENGINE=1 \
56 -DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1 \
57 -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 &&
58 make && make DESTDIR=$DESTDIR install
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 # Rules to gen a SliTaz package suitable for Tazpkg.
72 genpkg_rules()
73 {
74 # client binaries (plus /usr/bin/mysql), see $src/build/client
75 client="mysql_plugin mysql_upgrade mysqladmin mysqlbinlog mysqlcheck \
76 mysqldump mysqlimport mysqlshow mysqlslap mysqltest"
78 case $PACKAGE in
79 mysql)
80 copy etc/ bin/ plugin/ /usr/share/mysql/
81 for i in $client mysql mysql_config; do
82 rm $fs/usr/bin/$i
83 done
84 find $fs -name '*.m4' -delete
85 DEPENDS="libmysqlclient mysql-client slitaz-base-files \
86 libcrypto libssl ncurses zlib"
87 CONFIG_FILES="/etc/mysql"
88 DATABASE_FILES="/var/lib/mysql"
89 TAZPANEL_DAEMON="man|edit::/etc/mysql/my.cnf|options|web::$WEB_SITE"
90 ;;
91 libmysqlclient)
92 copy libmysqlclient*so*
93 CAT="database|client libraries"
94 DEPENDS="libcrypto libssl zlib"
95 ;;
96 mysql-client)
97 copy /bin/mysql $client
98 CAT="database|client files"
99 PROVIDE="mysql_or_postgresql"
100 DEPENDS="libmysqlclient libcrypto libssl ncurses zlib"
101 ;;
102 mysql-test)
103 copy mysql-test/ sql-bench/ db.opt
104 CAT="development|tests and benchmarks"
105 DEPENDS="mysql perl"
106 ;;
107 *-dev)
108 copy @dev mysql_config
109 rm -r $fs/usr/share/mysql-test
110 ;;
111 esac
112 }
114 # Pre and post install commands for Tazpkg.
115 pre_install_mysql()
116 {
117 # Cleanup old files
118 rm -f "$1/usr/libexec/mysql"*
119 # Move old config
120 [ -f "$1/etc/my.cnf" ] && mv -f "$1/etc/my.cnf" "$1/etc/mysql/my.cnf"
121 }
123 post_install_mysql()
124 {
125 chmod 600 "$1/etc/mysql/my.cnf"
127 local user=mysql group=mysql
129 if ! grep -q $user "$1/etc/passwd"; then
130 action "Adding user/group $user..."
131 chroot "$1/" addgroup -S $group
132 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user
133 status
134 fi
135 # adduser mysql if needed
136 if ! grep -q $user "$1/etc/passwd"; then
137 action "Adding MySQL Daemon user..."
138 chroot "$1/" /bin/adduser -s /bin/false -h /dev/null \
139 -g "MySQL Daemon user" -u 27 -H -D -S -G $group $user
140 status
141 fi
142 #chroot "$1/" /bin/chown $user.$group $(cat "$1/$INSTALLED/$PACKAGE/files.list")
143 mkdir -p "$1/var/lib/mysql"
144 chroot "$1/" /bin/chown -R $user.$group /var/lib/mysql
145 chroot "$1/" mysql_install_db --user=$user --basedir=/usr
147 [ -n "$quiet" ] || cat <<EOF
148 ----
149 To start mysql server you can run:
151 /etc/init.d/mysql start
153 Or add mysql to RUN_DAEMONS in /etc/rcS.conf
154 ----
155 EOF
156 }
158 post_remove_mysql()
159 {
160 echo "Removing user/group mysql"
161 chroot "$1/" deluser mysql
162 }
164 post_install_mysql_test()
165 {
166 chmod 2777 "$1/usr/share/mysql-test"
167 chmod 2777 "$1/usr/share/sql-bench"
168 }