wok view mariadb/receipt @ rev 14919
Up: firefox-langpack-it (17.0.7esr)
author | Richard Dunbar <mojo@slitaz.org> |
---|---|
date | Tue Aug 06 01:22:37 2013 +0000 (2013-08-06) |
parents | e9130cce9043 |
children | 408c87fa22ca |
line source
1 # SliTaz package receipt.
3 PACKAGE="mariadb"
4 VERSION="5.5.30"
5 CATEGORY="office"
6 SHORT_DESC="SQL database system."
7 MAINTAINER="erjo@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.gz"
9 WEB_SITE="http://mariadb.org/en/"
10 WGET_URL="http://pangolin.slitaz.org/downloads/sources/$TARBALL"
11 CONFIG_FILES="/etc/mysql"
12 TAZPANEL_DAEMON="man|edit::/etc/mysql/my.cnf|options|web::$WEB_SITE"
13 PROVIDE="mysql"
15 CONFIG_FILES="/etc/mysql/my.cnf"
16 DATABASE_FILES="/var/lib/mysql"
17 CROSS="bug: can not run test programm"
19 DEPENDS="busybox libmariadbclient mariadb-client zlib slitaz-base-files \
20 gcc-lib-base"
21 BUILD_DEPENDS="cmake ncurses-dev"
23 # Rules to configure and make the package.
24 compile_rules()
25 {
27 cd $src
28 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
29 -DINSTALL-DOCREADMEDIR=/usr/share/doc \
30 -DINSTALL_MYSQLDATADIR=/var/lib/mysql \
31 -DINSTALL_SYSCONFDIR=/etc \
32 -DINSTALL_LIBDIR=lib/mysql \
33 -DINSTALL_INFODIR=share/doc/mysql \
34 -DINSTALL_MANDIR=share/man \
35 -DINSTALL_PLUGINDIR=lib/mysql/plugin \
36 -DINSTALL_SHAREDIR=share \
37 -DINSTALL_MYSQLSHAREDIR=share/mysql \
38 -DINSTALL_UNIX_ADDRDIR=/var/run/mysqld/mysqld.sock
39 make $MAKEFLAGS &&
40 make install
41 }
43 # Rules to gen a SliTaz package suitable for Tazpkg.
44 genpkg_rules()
45 {
46 mkdir -p \
47 $fs/usr/share \
48 $fs/usr/lib/mysql/plugin \
49 $fs/etc/mysql \
50 $fs/etc/mysql.d \
51 $fs/var/lib/mysql
53 cp -a $install/usr/bin $fs/usr
54 cp -a $install/usr/scripts/* $fs/usr/bin
55 cp -a $install/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
56 cp -a $install/usr/share/mysql $fs/usr/share
58 # Configuration file
59 cp -a $stuff/etc/init.d $fs/etc
60 cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf
61 cp -a $src/support-files/my-small.cnf $fs/etc/mysql
62 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
63 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
64 $fs/etc/mysql/my.cnf
66 # Permissions
67 chmod 600 $fs/etc/mysql/my.cnf
69 cat $stuff/*.files-list | while read file; do
70 [ -f $fs$file ] && rm -f $fs$file
71 done
73 }
75 # Pre and post install commands for Tazpkg.
76 post_install()
77 {
79 local user
80 local group
82 user=mysql
83 group=mysql
85 if ! grep -q $user $1/etc/passwd; then
86 echo -n "Adding user/group $user..."
87 chroot $1/ addgroup -S $group
88 chroot $1/ adduser -s /bin/false -S -D -H -G $group $user
89 status
90 fi
92 mkdir -p $1/var/run/mysqld
93 chroot $1/ chown -R ${user}.${group} /var/lib/mysql /var/run/mysqld
95 cat <<EOF
96 ----
97 To start $PACKAGE server you can run :
99 /etc/init.d/$PACKAGE start
101 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
102 ----
103 EOF
104 }
106 pre_install()
107 {
108 # Cleanup old files
109 rm -f $1/usr/libexec/mysql*
110 # Mv config
111 [ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf
112 }
114 post_remove()
115 {
116 echo "Removing user/group mysl"
117 deluser mysql
118 }