Annotation of /trunk/extras/mysql5/mysql5-5.0.51a-r1.smage2
Parent Directory | Revision Log
Revision 2 -
(hide annotations)
(download)
Fri Oct 10 13:29:42 2008 UTC (15 years, 11 months ago) by niro
File size: 4044 byte(s)
Fri Oct 10 13:29:42 2008 UTC (15 years, 11 months ago) by niro
File size: 4044 byte(s)
import repo
1 | niro | 2 | # $Header: /magellan-cvs/smage/mysql5/mysql5-5.0.51a-r1.smage2,v 1.1 2008/02/20 10:16:23 niro Exp $ |
2 | |||
3 | PNAME="mysql5" | ||
4 | PVER="5.0.51a" | ||
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 | RC_REV=1.2 | ||
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-5.0/${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 | --with-openssl \ | ||
76 | --without-debug \ | ||
77 | --with-server \ | ||
78 | || die | ||
79 | |||
80 | mmake || die | ||
81 | } | ||
82 | |||
83 | src_install() | ||
84 | { | ||
85 | cd ${SRCDIR} | ||
86 | mmake DESTDIR=${BINDIR} install || die | ||
87 | |||
88 | # remove all unneeded stuff | ||
89 | local i | ||
90 | # dirs | ||
91 | for i in sql-bench mysql-test | ||
92 | do | ||
93 | if [[ -d ${BINDIR}/usr/${i} ]] | ||
94 | then | ||
95 | rm -r ${BINDIR}/usr/${i} || die | ||
96 | fi | ||
97 | done | ||
98 | |||
99 | # files | ||
100 | for i in share/mysql/mysql-log-rotate \ | ||
101 | share/mysql/mysql.server* \ | ||
102 | share/mysql/binary-configure* \ | ||
103 | share/mysql/my-*.cnf \ | ||
104 | share/mysql/mi_test_all* \ | ||
105 | bin/comp_err | ||
106 | do | ||
107 | if [[ -f ${BINDIR}/usr/${i} ]] | ||
108 | then | ||
109 | rm ${BINDIR}/usr/${i} || die | ||
110 | fi | ||
111 | done | ||
112 | |||
113 | # needed directories | ||
114 | mkeepdir /var/lib/mysql || die | ||
115 | mchown mysql:mysql /var/lib/mysql || die | ||
116 | mchmod 0750 /var/lib/mysql || die | ||
117 | |||
118 | mkeepdir /var/run/mysqld || die | ||
119 | mchown mysql:mysql /var/run/mysqld || die | ||
120 | |||
121 | mkeepdir /var/log/mysql || die | ||
122 | mchown mysql:mysql /var/log/mysql || die | ||
123 | |||
124 | # some common symlinks | ||
125 | for i in mysqlanalyze mysqlrepair mysqloptimize | ||
126 | do | ||
127 | mlink mysqlcheck /usr/bin/${i} || die | ||
128 | done | ||
129 | |||
130 | minstalldocs ChangeLog COPYING EXCEPTIONS-CLIENT README || die | ||
131 | minstalldocs support-files/my-*.cnf support-files/magic || die | ||
132 | minstalldocs support-files/ndb-config-2-node.ini || die | ||
133 | |||
134 | for i in scripts/mysql* | ||
135 | do | ||
136 | [[ ${i%.sh} == ${i} ]] && minstalldocs ${i} | ||
137 | done | ||
138 | |||
139 | # install a default my.cnf | ||
140 | minstalldir /etc/mysql || die | ||
141 | minstallfile support-files/my-medium.cnf /etc/mysql/my.cnf || die | ||
142 | |||
143 | # install an initscript | ||
144 | minstallrc mysql.rc-${RC_REV} mysql || die | ||
145 | } | ||
146 | |||
147 | preinstall() | ||
148 | { | ||
149 | # adding mysql user | ||
150 | ${MLIBDIR}/mgroupadd -o "-g 60" mysql | ||
151 | ${MLIBDIR}/museradd -o "-u 60 -g mysql -d /dev/null -s /bin/false" mysql | ||
152 | } | ||
153 | |||
154 | postinstall() | ||
155 | { | ||
156 | # create a database if none exists | ||
157 | if [[ ! -d /var/lib/mysql/mysql ]] | ||
158 | then | ||
159 | echo "Creating the mysql database ..." | ||
160 | mysql_install_db --user=mysql | ||
161 | chown -R mysql:mysql /var/lib/mysql | ||
162 | chmod 0750 /var/lib/mysql | ||
163 | |||
164 | echo | ||
165 | echo "Warning: The administrator password is empty!" | ||
166 | echo "Please make sure to set one with following command:" | ||
167 | echo " mysqladmin -u root password <new-password>" | ||
168 | echo | ||
169 | fi | ||
170 | |||
171 | # start the daemon | ||
172 | mstartservice mysql /usr/sbin/mysqld | ||
173 | } | ||
174 | |||
175 | postremove() | ||
176 | { | ||
177 | [[ ! -f /usr/sbin/mysqld ]] && mstopservice mysql /usr/sbin/mysqld | ||
178 | } |
Properties
Name | Value |
---|---|
svn:keywords | Id |