wok-6.x view mariadb/receipt @ rev 24453
Add some current_version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Feb 15 18:29:48 2022 +0000 (2022-02-15) |
parents | 970c5ec9a60a |
children | 94dd3813f40d |
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 # What is the latest version available today?
25 current_version()
26 {
27 wget -O - $WEB_SITE 2>/dev/null | \
28 sed '/Latest M/!d;s|<a href|\n&|g' | sed '/rc/d;/rel=/!d;s|.*rel=||;s|\&.*||;q'
29 }
31 # Rules to configure and make the package.
32 compile_rules()
33 {
35 cd $src
36 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
37 -DINSTALL-DOCREADMEDIR=/usr/share/doc \
38 -DINSTALL_MYSQLDATADIR=/var/lib/mysql \
39 -DINSTALL_SYSCONFDIR=/etc \
40 -DINSTALL_LIBDIR=lib/mysql \
41 -DINSTALL_INFODIR=share/doc/mysql \
42 -DINSTALL_MANDIR=share/man \
43 -DINSTALL_PLUGINDIR=lib/mysql/plugin \
44 -DINSTALL_SHAREDIR=share \
45 -DINSTALL_MYSQLSHAREDIR=share/mysql \
46 -DINSTALL_UNIX_ADDRDIR=/var/run/mysqld/mysqld.sock &&
47 make $MAKEFLAGS &&
48 make install
49 }
51 # Rules to gen a SliTaz package suitable for Tazpkg.
52 genpkg_rules()
53 {
54 mkdir -p \
55 $fs/usr/share \
56 $fs/usr/lib/mysql/plugin \
57 $fs/etc/mysql \
58 $fs/etc/mysql.d \
59 $fs/var/lib/mysql
61 cp -a $install/usr/bin $fs/usr
62 cp -a $install/usr/scripts/* $fs/usr/bin
63 cp -a $install/usr/lib/mysql/plugin/*.so* $fs/usr/lib/mysql/plugin
64 cp -a $install/usr/share/mysql $fs/usr/share
66 # Configuration file
67 cp -a $stuff/etc/init.d $fs/etc
68 cp -a $src/support-files/my-medium.cnf $fs/etc/mysql/my.cnf
69 cp -a $src/support-files/my-small.cnf $fs/etc/mysql
70 grep -q "bind-address" $fs/etc/mysql/my.cnf || sed -i \
71 's/^\[mysqld\]/[mysqld]\nbind-address\t= 127.0.0.1/' \
72 $fs/etc/mysql/my.cnf
74 # Permissions
75 chmod 600 $fs/etc/mysql/my.cnf
77 cat $stuff/*.files-list | while read file; do
78 [ -f $fs$file ] && rm -f $fs$file
79 done
81 }
83 # Pre and post install commands for Tazpkg.
84 post_install()
85 {
87 local user
88 local group
90 user=mysql
91 group=mysql
93 if ! grep -q $user "$1/etc/passwd"; then
94 echo
95 echo -n "Adding user/group $user..."
96 chroot "$1/" addgroup -S $group
97 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user
98 status
99 fi
101 cat <<EOF
102 ----
103 To start $PACKAGE server you can run :
105 /etc/init.d/$PACKAGE start
107 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
108 ----
109 EOF
110 }
112 pre_install()
113 {
114 # Cleanup old files
115 rm -f "$1/usr/libexec/mysql"*
116 # Mv config
117 [ -f "$1/etc/my.cnf" ] &&
118 mv -f "$1/etc/my.cnf" "$1/etc/mysql/my.cnf" || true
119 }
121 post_remove()
122 {
123 echo "Removing user/group mysl"
124 deluser mysql
125 }