Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4117 - (show annotations) (download)
Fri Nov 20 17:58:06 2009 UTC (14 years, 6 months ago) by niro
File size: 4205 byte(s)
-create client libs symlinks to /usr/$(mlibdir)
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 mlink mysql/libmysqlclient{,_r}.so\* /usr/$(mlibdir) || die
94 popd
95
96 # remove all unneeded stuff
97 local i
98 # dirs
99 for i in sql-bench mysql-test
100 do
101 if [[ -d ${BINDIR}/usr/${i} ]]
102 then
103 rm -r ${BINDIR}/usr/${i} || die
104 fi
105 done
106
107 # files
108 for i in share/mysql/mysql-log-rotate \
109 share/mysql/mysql.server* \
110 share/mysql/binary-configure* \
111 share/mysql/my-*.cnf \
112 share/mysql/mi_test_all* \
113 bin/comp_err
114 do
115 if [[ -f ${BINDIR}/usr/${i} ]]
116 then
117 rm ${BINDIR}/usr/${i} || die
118 fi
119 done
120
121 # needed directories
122 mkeepdir /var/lib/mysql || die
123 mchown mysql:mysql /var/lib/mysql || die
124 mchmod 0750 /var/lib/mysql || die
125
126 mkeepdir /var/run/mysqld || die
127 mchown mysql:mysql /var/run/mysqld || die
128
129 mkeepdir /var/log/mysql || die
130 mchown mysql:mysql /var/log/mysql || die
131
132 # some common symlinks
133 for i in mysqlanalyze mysqlrepair mysqloptimize
134 do
135 mlink mysqlcheck /usr/bin/${i} || die
136 done
137
138 minstalldocs ChangeLog COPYING EXCEPTIONS-CLIENT README || die
139 minstalldocs support-files/my-*.cnf support-files/magic || die
140 minstalldocs support-files/ndb-config-2-node.ini || die
141
142 for i in scripts/mysql*
143 do
144 [[ ${i%.sh} == ${i} ]] && minstalldocs ${i}
145 done
146
147 # install a default my.cnf
148 minstalldir /etc/mysql || die
149 minstallfile support-files/my-medium.cnf /etc/mysql/my.cnf || die
150
151 # install an initscript
152 minstallrc mysql.rc-${RC_REV} mysql || die
153 }
154
155 preinstall()
156 {
157 # adding mysql user
158 ${MLIBDIR}/mgroupadd -o "-g 60" mysql
159 ${MLIBDIR}/museradd -o "-u 60 -g mysql -d /dev/null -s /bin/false" mysql
160 }
161
162 postinstall()
163 {
164 # create a database if none exists
165 if [[ ! -d /var/lib/mysql/mysql ]]
166 then
167 echo "Creating the mysql database ..."
168 mysql_install_db --user=mysql
169 chown -R mysql:mysql /var/lib/mysql
170 chmod 0750 /var/lib/mysql
171
172 echo
173 echo "Warning: The administrator password is empty!"
174 echo "Please make sure to set one with following command:"
175 echo " mysqladmin -u root password <new-password>"
176 echo
177 fi
178
179 # start the daemon
180 mstartservice mysql /usr/sbin/mysqld
181 }
182
183 postremove()
184 {
185 [[ ! -f /usr/sbin/mysqld ]] && mstopservice mysql /usr/sbin/mysqld
186 }

Properties

Name Value
svn:keywords Id