Magellan Linux

Annotation of /trunk/extras/mysql5/mysql5-5.1.36-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2152 - (hide annotations) (download)
Mon Jul 6 17:50:30 2009 UTC (15 years, 2 months ago) by niro
File size: 3980 byte(s)
-fixed rc script
1 niro 2150 # $Id$
2    
3     PNAME="mysql5"
4     PVER="5.1.36"
5     PBUILD="r1"
6    
7     PCATEGORIE="dev-db"
8     STATE="unstable"
9    
10     DESCRIPTION="MySQL is a SQL (Structured Query Language) database server."
11     HOMEPAGE="http://www.mysql.com/"
12    
13     DEPEND=">= sys-libs/zlib-1.2
14     >= dev-libs/openssl-0.9.8
15     >= sys-apps/tcp-wrappers-7"
16    
17     SRCFILE="${PNAME/5/}-${PVER}.tar.gz"
18     SRCDIR="${BUILDDIR}/${PNAME/5/}-${PVER}"
19    
20     # initscript version
21 niro 2152 RC_REV=1.3
22 niro 2150
23     sminclude mtools
24    
25     SRC_URI=(
26     ftp://ftp.mysql.com/pub/mysql/src/${SRCFILE}
27     http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-${PVER%.*}/${SRCFILE}
28     mirror://${PNAME}/${SRCFILE}
29     mirror://${PNAME}/${PNAME}-5.0.41-cnf-defaults-2.patch
30     mirror://${PNAME}/mysql.rc-${RC_REV}
31     )
32    
33     src_prepare()
34     {
35     # warn about /proc in chroot environments
36     [[ ! -d /proc/sys ]] && die "Please make sure /proc is mounted in chroot-environments."
37    
38     munpack ${SRCFILE} || die
39     cd ${SRCDIR}
40    
41     # adjust default settings for magellan
42     mpatch ${PNAME}-5.0.41-cnf-defaults-2.patch || die
43     }
44    
45     src_compile()
46     {
47     cd ${SRCDIR}
48    
49     # fixes some issues
50     export CXXFLAGS="${CXXFLAGS} -fno-exceptions -fno-strict-aliasing"
51     export CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti -fno-implicit-templates"
52    
53     mconfigure \
54     --libexecdir=/usr/sbin \
55     --sysconfdir=/etc/mysql \
56     --localstatedir=/var/lib/mysql \
57     --with-raid \
58     --with-low-memory \
59     --enable-assembler \
60     --with-charset=latin1 \
61     --enable-local-infile \
62     --with-mysqld-user=mysql \
63     --with-extra-charsets=all \
64     --enable-thread-safe-client \
65     --with-client-ldflags=-lstdc++ \
66     --with-comment="Magellan MySQL ${PVER}-${PBUILD}" \
67     --with-unix-socket-path=/var/run/mysqld/mysqld.sock \
68     --enable-local-infile \
69     --without-berkeley-db \
70     --without-readline \
71     --enable-shared \
72     --enable-static \
73     --with-libwrap \
74     --with-innodb \
75 niro 2151 --with-ssl \
76 niro 2150 --without-debug \
77     --with-server \
78     --with-embedded-server \
79     || die
80    
81     mmake || die
82     }
83    
84     src_install()
85     {
86     cd ${SRCDIR}
87     mmake DESTDIR=${BINDIR} install || die
88    
89     # remove all unneeded stuff
90     local i
91     # dirs
92     for i in sql-bench mysql-test
93     do
94     if [[ -d ${BINDIR}/usr/${i} ]]
95     then
96     rm -r ${BINDIR}/usr/${i} || die
97     fi
98     done
99    
100     # files
101     for i in share/mysql/mysql-log-rotate \
102     share/mysql/mysql.server* \
103     share/mysql/binary-configure* \
104     share/mysql/my-*.cnf \
105     share/mysql/mi_test_all* \
106     bin/comp_err
107     do
108     if [[ -f ${BINDIR}/usr/${i} ]]
109     then
110     rm ${BINDIR}/usr/${i} || die
111     fi
112     done
113    
114     # needed directories
115     mkeepdir /var/lib/mysql || die
116     mchown mysql:mysql /var/lib/mysql || die
117     mchmod 0750 /var/lib/mysql || die
118    
119     mkeepdir /var/run/mysqld || die
120     mchown mysql:mysql /var/run/mysqld || die
121    
122     mkeepdir /var/log/mysql || die
123     mchown mysql:mysql /var/log/mysql || die
124    
125     # some common symlinks
126     for i in mysqlanalyze mysqlrepair mysqloptimize
127     do
128     mlink mysqlcheck /usr/bin/${i} || die
129     done
130    
131     minstalldocs ChangeLog COPYING EXCEPTIONS-CLIENT README || die
132     minstalldocs support-files/my-*.cnf support-files/magic || die
133     minstalldocs support-files/ndb-config-2-node.ini || die
134    
135     for i in scripts/mysql*
136     do
137     [[ ${i%.sh} == ${i} ]] && minstalldocs ${i}
138     done
139    
140     # install a default my.cnf
141     minstalldir /etc/mysql || die
142     minstallfile support-files/my-medium.cnf /etc/mysql/my.cnf || die
143    
144     # install an initscript
145     minstallrc mysql.rc-${RC_REV} mysql || die
146     }
147    
148     preinstall()
149     {
150     # adding mysql user
151     ${MLIBDIR}/mgroupadd -o "-g 60" mysql
152     ${MLIBDIR}/museradd -o "-u 60 -g mysql -d /dev/null -s /bin/false" mysql
153     }
154    
155     postinstall()
156     {
157     # create a database if none exists
158     if [[ ! -d /var/lib/mysql/mysql ]]
159     then
160     echo "Creating the mysql database ..."
161     mysql_install_db --user=mysql
162     chown -R mysql:mysql /var/lib/mysql
163     chmod 0750 /var/lib/mysql
164    
165     echo
166     echo "Warning: The administrator password is empty!"
167     echo "Please make sure to set one with following command:"
168     echo " mysqladmin -u root password <new-password>"
169     echo
170     fi
171    
172     # start the daemon
173     mstartservice mysql /usr/sbin/mysqld
174     }
175    
176     postremove()
177     {
178     [[ ! -f /usr/sbin/mysqld ]] && mstopservice mysql /usr/sbin/mysqld
179     }

Properties

Name Value
svn:keywords Id