Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:keywords Id