Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:keywords Id