Contents of /smage/branches/alx-0_6_0/core/mysql/mysql-5.1.56-r1.smage2
Parent Directory
|
Revision Log
Revision 1896 -
(show annotations)
(download)
Mon May 2 13:41:59 2011 UTC (13 years, 1 month ago) by niro
File size: 3743 byte(s)
Mon May 2 13:41:59 2011 UTC (13 years, 1 month ago) by niro
File size: 3743 byte(s)
-fixed build and alxify
1 | # $Id$ |
2 | |
3 | PNAME="mysql" |
4 | PVER="5.1.56" |
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 | |
15 | SRCFILE="${PNAME}-${PVER}.tar.gz" |
16 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
17 | |
18 | REMOVE_DEPRECATED_MAGE_TARGETS=1 |
19 | ALX_ONLY_KEEP="etc/mysql |
20 | usr/bin/mysql |
21 | usr/$(mlibdir)/*.so.* |
22 | usr/$(mlibdir)/*.so |
23 | usr/$(mlibdir)/mysql/*.so.* |
24 | usr/$(mlibdir)/mysql/*.so" |
25 | sminclude mtools alx-split |
26 | |
27 | SRC_URI=( |
28 | ftp://ftp.mysql.com/pub/mysql/src/${SRCFILE} |
29 | http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-${PVER%.*}/${SRCFILE} |
30 | mirror://mysql5/${SRCFILE} |
31 | mirror://mysql5/mysql5-5.0.41-cnf-defaults-2.patch |
32 | ) |
33 | |
34 | UP2DATE="updatecmd http://dev.mysql.com/ | grep GA | sed 's/.*\ \([0-9].*\)/\1/;q'" |
35 | |
36 | src_prepare() |
37 | { |
38 | # warn about /proc in chroot environments |
39 | [[ ! -d /proc/sys ]] && die "Please make sure /proc is mounted in chroot-environments." |
40 | |
41 | munpack ${SRCFILE} || die |
42 | cd ${SRCDIR} |
43 | |
44 | # adjust default settings for magellan |
45 | mpatch mysql5-5.0.41-cnf-defaults-2.patch || die |
46 | } |
47 | |
48 | src_compile() |
49 | { |
50 | cd ${SRCDIR} |
51 | |
52 | # fixes some issues |
53 | export CXXFLAGS="${CXXFLAGS} -fno-exceptions -fno-strict-aliasing" |
54 | export CXXFLAGS="${CXXFLAGS} -felide-constructors -fno-rtti -fno-implicit-templates" |
55 | |
56 | # fix PIC issues |
57 | export CFLAGS="${CFLAGS} -fPIC" |
58 | export CXXFLAGS="${CXXFLAGS} -fPIC" |
59 | |
60 | # --with-readline uses included readline, detection is broken |
61 | mconfigure \ |
62 | --libexecdir=/usr/sbin \ |
63 | --sysconfdir=/etc/mysql \ |
64 | --localstatedir=/var/lib/mysql \ |
65 | --without-raid \ |
66 | --with-low-memory \ |
67 | --enable-assembler \ |
68 | --with-charset=latin1 \ |
69 | --with-collation=latin1_swedish_ci \ |
70 | --enable-local-infile \ |
71 | --with-mysqld-user=mysql \ |
72 | --with-extra-charsets=none \ |
73 | --enable-thread-safe-client \ |
74 | --with-client-ldflags=-lstdc++ \ |
75 | --with-comment="Magellan_MySQL_${PVER}-${PBUILD}" \ |
76 | --with-unix-socket-path=/var/run/mysqld/mysqld.sock \ |
77 | --enable-shared \ |
78 | --disable-static \ |
79 | --without-libwrap \ |
80 | --without-ssl \ |
81 | --without-debug \ |
82 | --without-server \ |
83 | --without-embedded-server \ |
84 | --without-extra-tools \ |
85 | --without-innodb \ |
86 | --without-bench \ |
87 | --without-berkeley-db \ |
88 | --without-row-based-relication \ |
89 | --with-readline \ |
90 | || die |
91 | |
92 | mmake || die |
93 | } |
94 | |
95 | src_install() |
96 | { |
97 | cd ${SRCDIR} |
98 | mmake DESTDIR=${BINDIR} install || die |
99 | |
100 | # symlink client libs to libdir |
101 | pushd ${BINDIR}/usr/$(mlibdir) || die |
102 | for i in mysql/libmysqlclient{,_r}.so* |
103 | do |
104 | mlink ${i} /usr/$(mlibdir) || die |
105 | done |
106 | popd |
107 | |
108 | # remove all unneeded stuff |
109 | local i |
110 | # dirs |
111 | for i in sql-bench mysql-test |
112 | do |
113 | if [[ -d ${BINDIR}/usr/${i} ]] |
114 | then |
115 | rm -r ${BINDIR}/usr/${i} || die |
116 | fi |
117 | done |
118 | |
119 | # files |
120 | for i in share/mysql/mysql-log-rotate \ |
121 | share/mysql/mysql.server* \ |
122 | share/mysql/binary-configure* \ |
123 | share/mysql/my-*.cnf \ |
124 | share/mysql/mi_test_all* \ |
125 | bin/comp_err |
126 | do |
127 | if [[ -f ${BINDIR}/usr/${i} ]] |
128 | then |
129 | rm ${BINDIR}/usr/${i} || die |
130 | fi |
131 | done |
132 | |
133 | # needed directories |
134 | mkeepdir /var/lib/mysql || die |
135 | mchown mysql:mysql /var/lib/mysql || die |
136 | mchmod 0750 /var/lib/mysql || die |
137 | |
138 | mkeepdir /var/run/mysqld || die |
139 | mchown mysql:mysql /var/run/mysqld || die |
140 | |
141 | mkeepdir /var/log/mysql || die |
142 | mchown mysql:mysql /var/log/mysql || die |
143 | |
144 | # some common symlinks |
145 | for i in mysqlanalyze mysqlrepair mysqloptimize |
146 | do |
147 | mlink mysqlcheck /usr/bin/${i} || die |
148 | done |
149 | |
150 | minstalldocs ChangeLog COPYING EXCEPTIONS-CLIENT README || die |
151 | minstalldocs support-files/my-*.cnf support-files/magic || die |
152 | minstalldocs support-files/ndb-config-2-node.ini || die |
153 | |
154 | for i in scripts/mysql* |
155 | do |
156 | [[ ${i%.sh} == ${i} ]] && minstalldocs ${i} |
157 | done |
158 | |
159 | # install a default my.cnf |
160 | minstalldir /etc/mysql || die |
161 | minstallfile support-files/my-medium.cnf /etc/mysql/my.cnf || die |
162 | } |