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