wok-next view mariadb/receipt @ rev 20407
Up miniupnp (2.0.20171212)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Dec 18 12:55:43 2017 +0100 (2017-12-18) |
parents | 9e01bc6321ea |
children | e6615350078d |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="mariadb"
4 VERSION="10.0.11"
5 CATEGORY="office"
6 SHORT_DESC="SQL database system."
7 MAINTAINER="erjo@slitaz.org"
8 LICENSE="GPL2"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://mariadb.org/en/"
11 WGET_URL="http://pangolin.slitaz.org/downloads/sources/$TARBALL"
13 BUILD_DEPENDS="cmake ncurses-dev bison openssl-dev"
14 SPLIT="mariadb libmariadbclient mariadb-client mariadb-dev mariadb-test"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
20 cd $src
21 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
22 -DINSTALL-DOCREADMEDIR=/usr/share/doc \
23 -DINSTALL_MYSQLDATADIR=/var/lib/mysql \
24 -DINSTALL_SYSCONFDIR=/etc \
25 -DINSTALL_LIBDIR=lib/mysql \
26 -DINSTALL_INFODIR=share/doc/mysql \
27 -DINSTALL_MANDIR=share/man \
28 -DINSTALL_PLUGINDIR=lib/mysql/plugin \
29 -DINSTALL_SHAREDIR=share \
30 -DINSTALL_MYSQLSHAREDIR=share/mysql \
31 -DINSTALL_UNIX_ADDRDIR=/var/run/mysqld/mysqld.sock &&
32 make $MAKEFLAGS &&
33 make install
34 }
36 # Rules to gen a SliTaz package suitable for Tazpkg.
37 genpkg_rules()
38 {
39 case $PACKAGE in
40 mariadb)
41 CONFIG_FILES="/etc/mysql"
42 TAZPANEL_DAEMON="man|edit::/etc/mysql/my.cnf|options|web::$WEB_SITE"
43 PROVIDE="mysql"
44 CONFIG_FILES="/etc/mysql/my.cnf"
45 DATABASE_FILES="/var/lib/mysql"
46 CROSS="bug: can not run test programm"
47 DEPENDS="busybox libmariadbclient mariadb-client zlib \
48 slitaz-base-files gcc-lib-base"
49 mkdir -p \
50 $fs/usr/share \
51 $fs/usr/lib/mysql/plugin \
52 $fs/etc/mysql \
53 $fs/etc/mysql.d \
54 $fs/var/lib/mysql
56 cp -a $install/usr/bin $fs/usr
57 cp -a $install/usr/scripts/* $fs/usr/bin
58 cp -a $install/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
59 cp -a $install/usr/share/mysql $fs/usr/share
61 # Configuration file
62 cp -a $stuff/etc/init.d $fs/etc
63 cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf
64 cp -a $src/support-files/my-small.cnf $fs/etc/mysql
65 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
66 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
67 $fs/etc/mysql/my.cnf
69 # Permissions
70 chmod 600 $fs/etc/mysql/my.cnf
72 cat $stuff/*.files-list | while read file; do
73 [ -f $fs$file ] && rm -f $fs$file
74 done
75 ;;
76 libmariadbclient)
77 CAT="misc|SQL database system client libraries."
78 PROVIDE="libmysqlclient"
79 DEPENDS="zlib libssl"
80 mkdir -p $fs/usr/lib/mysql
81 cp -a $install/usr/lib/mysql/libmysqlclient*so* $fs/usr/lib/mysql
82 cd $fs/usr/lib
83 ln -s mysql/libmysqlclient.so .
84 ln -s mysql/libmysqlclient.so.18 .
85 ln -s mysql/libmysqlclient.so.18.0.0 .
86 ln -s mysql/libmysqlclient_r.so .
87 ln -s mysql/libmysqlclient_r.so.18 .
88 ln -s mysql/libmysqlclient_r.so.18.0.0 .
89 ;;
90 mariadb-client)
91 CAT="office|SQL database system client files."
92 PROVIDE="mysql_or_postgresql mysql-client"
93 DEPENDS="libmariadbclient zlib ncurses gcc-lib-base ncurses"
94 while read file; do
95 dir=$(dirname $file)
96 [ -d $fs$dir ] || mkdir -p $fs$dir
97 cp -a $install$file $fs$file
98 done < $wanted_stuff/$PACKAGE.files-list
99 ;;
100 mariadb-dev)
101 CAT="development|SQL database system devel files."
102 PROVIDE="mysql-dev"
103 DEPENDS="zlib"
104 mkdir -p $fs/usr/lib/mysql/plugin $fs/usr/share
105 cp -a $install/usr/include $fs/usr
106 cp -a $install/usr/share/aclocal $fs/usr/share
107 cp -a $install/usr/lib/mysql/*.*a $fs/usr/lib/mysql
108 #~ cp -a $install/usr/lib/mysql/plugin/*.*a $fs/usr/lib/mysql/plugin
109 while read file; do
110 dir=$(dirname $file)
111 [ -d $fs$dir ] || mkdir -p $fs$dir
112 cp -a $install$file $fs$file
113 done < $wanted_stuff/$PACKAGE.files-list
114 ;;
115 mariadb-test)
116 CAT="misc|SQL database system tests and benchs."
117 DEPENDS="mariadb perl libssl"
118 mkdir -p $fs/usr/share
119 cp -a $install/usr/mysql-test $fs/usr
120 cp -a $install/usr/sql-bench $fs/usr
121 find $fs/usr/mysql-test $fs/usr/sql-bench -type d -exec chmod 2777 {} \;
122 while read file; do
123 dir=$(dirname $file)
124 [ -d $fs$dir ] || mkdir -p $fs$dir
125 cp -a $install$file $fs$file
126 done < $wanted_stuff/$PACKAGE.files-list
127 mv $fs/usr/mysql-test $fs/usr/share/mysql-test
128 mv $fs/usr/sql-bench $fs/usr/share/sql-bench
129 ;;
130 esac
131 }
133 # Pre and post install commands for Tazpkg.
134 post_install_mariadb()
135 {
137 local user
138 local group
140 user=mysql
141 group=mysql
143 if ! grep -q $user "$1/etc/passwd"; then
144 echo -n "Adding user/group $user..."
145 chroot "$1/" addgroup -S $group
146 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user
147 status
148 fi
150 cat <<EOF
151 ----
152 To start $PACKAGE server you can run :
154 /etc/init.d/$PACKAGE start
156 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
157 ----
158 EOF
159 }
161 pre_install_mariadb()
162 {
163 # Cleanup old files
164 rm -f "$1/usr/libexec/mysql"*
165 # Mv config
166 [ -f "$1/etc/my.cnf" ] && mv -f "$1/etc/my.cnf" "$1/etc/mysql/my.cnf"
167 }
169 post_remove_mariadb()
170 {
171 echo "Removing user/group mysql"
172 deluser mysql
173 }