wok view mariadb/receipt @ rev 20319

Up tazlito (501)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun May 20 13:28:18 2018 +0200 (2018-05-20)
parents bf261b0db903
children
line source
1 # SliTaz package receipt.
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"
12 CONFIG_FILES="/etc/mysql"
13 TAZPANEL_DAEMON="man|edit::/etc/mysql/my.cnf|options|web::$WEB_SITE"
14 PROVIDE="mysql"
16 CONFIG_FILES="/etc/mysql/my.cnf"
17 DATABASE_FILES="/var/lib/mysql"
18 CROSS="bug: can not run test programm"
20 DEPENDS="busybox libmariadbclient mariadb-client zlib slitaz-base-files \
21 gcc-lib-base"
22 BUILD_DEPENDS="cmake ncurses-dev bison openssl-dev"
24 # Rules to configure and make the package.
25 compile_rules()
26 {
28 cd $src
29 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
30 -DINSTALL-DOCREADMEDIR=/usr/share/doc \
31 -DINSTALL_MYSQLDATADIR=/var/lib/mysql \
32 -DINSTALL_SYSCONFDIR=/etc \
33 -DINSTALL_LIBDIR=lib/mysql \
34 -DINSTALL_INFODIR=share/doc/mysql \
35 -DINSTALL_MANDIR=share/man \
36 -DINSTALL_PLUGINDIR=lib/mysql/plugin \
37 -DINSTALL_SHAREDIR=share \
38 -DINSTALL_MYSQLSHAREDIR=share/mysql \
39 -DINSTALL_UNIX_ADDRDIR=/var/run/mysqld/mysqld.sock &&
40 make $MAKEFLAGS &&
41 make install
42 }
44 # Rules to gen a SliTaz package suitable for Tazpkg.
45 genpkg_rules()
46 {
47 mkdir -p \
48 $fs/usr/share \
49 $fs/usr/lib/mysql/plugin \
50 $fs/etc/mysql \
51 $fs/etc/mysql.d \
52 $fs/var/lib/mysql
54 cp -a $install/usr/bin $fs/usr
55 cp -a $install/usr/scripts/* $fs/usr/bin
56 cp -a $install/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
57 cp -a $install/usr/share/mysql $fs/usr/share
59 # Configuration file
60 cp -a $stuff/etc/init.d $fs/etc
61 cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf
62 cp -a $src/support-files/my-small.cnf $fs/etc/mysql
63 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
64 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
65 $fs/etc/mysql/my.cnf
67 # Permissions
68 chmod 600 $fs/etc/mysql/my.cnf
70 cat $stuff/*.files-list | while read file; do
71 [ -f $fs$file ] && rm -f $fs$file
72 done
74 }
76 # Pre and post install commands for Tazpkg.
77 post_install()
78 {
80 local user
81 local group
83 user=mysql
84 group=mysql
86 if ! grep -q $user "$1/etc/passwd"; then
87 echo
88 echo -n "Adding user/group $user..."
89 chroot "$1/" addgroup -S $group
90 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user
91 status
92 fi
94 cat <<EOF
95 ----
96 To start $PACKAGE server you can run :
98 /etc/init.d/$PACKAGE start
100 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
101 ----
102 EOF
103 }
105 pre_install()
106 {
107 # Cleanup old files
108 rm -f "$1/usr/libexec/mysql"*
109 # Mv config
110 [ -f "$1/etc/my.cnf" ] &&
111 mv -f "$1/etc/my.cnf" "$1/etc/mysql/my.cnf" || true
112 }
114 post_remove()
115 {
116 echo "Removing user/group mysl"
117 deluser mysql
118 }