wok view mariadb/receipt @ rev 13504
Up: midori (0.4.7)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat Oct 13 15:43:37 2012 +0200 (2012-10-13) |
parents | dd085711d6a2 |
children | e9130cce9043 |
line source
1 # SliTaz package receipt.
3 PACKAGE="mariadb"
4 VERSION="5.5.24"
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 PROVIDE="mysql"
13 CONFIG_FILES="/etc/mysql/my.cnf"
14 DATABASE_FILES="/var/lib/mysql"
15 CROSS="bug: can not run test programm"
17 DEPENDS="busybox libmariadbclient mariadb-client zlib slitaz-base-files \
18 gcc-lib-base"
19 BUILD_DEPENDS="cmake ncurses-dev"
21 # Rules to configure and make the package.
22 compile_rules()
23 {
25 cd $src
26 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
27 -DINSTALL-DOCREADMEDIR=/usr/share/doc \
28 -DINSTALL_MYSQLDATADIR=/var/lib/mysql \
29 -DINSTALL_SYSCONFDIR=/etc \
30 -DINSTALL_LIBDIR=lib/mysql \
31 -DINSTALL_INFODIR=share/doc/mysql \
32 -DINSTALL_MANDIR=share/man \
33 -DINSTALL_PLUGINDIR=lib/mysql/plugin \
34 -DINSTALL_SHAREDIR=share \
35 -DINSTALL_MYSQLSHAREDIR=share/mysql \
36 -DINSTALL_UNIX_ADDRDIR=/var/run/mysqld/mysqld.sock
37 make $MAKEFLAGS &&
38 make install
39 }
41 # Rules to gen a SliTaz package suitable for Tazpkg.
42 genpkg_rules()
43 {
44 mkdir -p \
45 $fs/usr/share \
46 $fs/usr/lib/mysql/plugin \
47 $fs/etc/mysql \
48 $fs/etc/mysql.d \
49 $fs/var/lib/mysql \
50 $fs/var/run/mysqld
52 cp -a $install/usr/bin $fs/usr
53 cp -a $install/usr/scripts/* $fs/usr/bin
54 cp -a $install/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
55 cp -a $install/usr/share/mysql $fs/usr/share
57 # Configuration file
58 cp -a $stuff/etc/init.d $fs/etc
59 cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf
60 cp -a $src/support-files/my-small.cnf $fs/etc/mysql
61 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
62 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
63 $fs/etc/mysql/my.cnf
65 # Permissions
66 chmod 600 $fs/etc/mysql/my.cnf
68 cat $stuff/*.files-list | while read file; do
69 [ -f $fs$file ] && rm -f $fs$file
70 done
72 }
74 # Pre and post install commands for Tazpkg.
75 post_install()
76 {
78 local user
79 local group
81 user=mysql
82 group=mysql
84 if ! grep -q $user $1/etc/passwd; then
85 echo -n "Adding user/group $user..."
86 chroot $1/ addgroup -S $group
87 chroot $1/ adduser -s /bin/false -S -D -H -G $group $user
88 status
89 fi
91 chroot $1/ chown -R ${user}.${group} /var/lib/mysql /var/run/mysqld
93 cat <<EOF
94 ----
95 To start $PACKAGE server you can run :
97 /etc/init.d/$PACKAGE start
99 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
100 ----
101 EOF
102 }
104 pre_install()
105 {
106 # Cleanup old files
107 rm -f $1/usr/libexec/mysql*
108 # Mv config
109 [ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf
110 }
112 post_remove()
113 {
114 echo "Removing user/group mysl"
115 deluser mysql
116 }