Magellan Linux

Contents of /trunk/extras/mysql5/mysql5-5.1.40-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:keywords Id