Contents of /smage/branches/alx-0_6_0/core/mysql/mysql-5.1.56-r1.smage2
Parent Directory | Revision Log
Revision 2506 -
(show annotations)
(download)
Thu Jun 30 13:55:15 2011 UTC (12 years, 11 months ago) by niro
File size: 3794 byte(s)
Thu Jun 30 13:55:15 2011 UTC (12 years, 11 months ago) by niro
File size: 3794 byte(s)
-removed STATE variable from smage files, use global distribution file for package/distribution states
1 | # $Id$ |
2 | |
3 | PNAME="mysql" |
4 | PVER="5.1.56" |
5 | PBUILD="r1" |
6 | |
7 | PCATEGORIE="dev-db" |
8 | |
9 | DESCRIPTION="MySQL is a SQL (Structured Query Language) database server." |
10 | HOMEPAGE="http://www.mysql.com/" |
11 | |
12 | DEPEND=">= sys-libs/zlib-1.2" |
13 | |
14 | SRCFILE="${PNAME}-${PVER}.tar.gz" |
15 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
16 | |
17 | REMOVE_DEPRECATED_MAGE_TARGETS=1 |
18 | ALX_ONLY_KEEP="etc/mysql |
19 | usr/bin/mysql |
20 | usr/$(mlibdir)/*.so.* |
21 | usr/$(mlibdir)/*.so |
22 | usr/$(mlibdir)/mysql/*.so.* |
23 | usr/$(mlibdir)/mysql/*.so" |
24 | sminclude mtools alx-split |
25 | |
26 | SRC_URI=( |
27 | ftp://ftp.mysql.com/pub/mysql/src/${SRCFILE} |
28 | http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-${PVER%.*}/${SRCFILE} |
29 | mirror://mysql5/${SRCFILE} |
30 | mirror://mysql5/mysql5-5.0.41-cnf-defaults-2.patch |
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 mysql5-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 | # --with-readline uses included readline, detection is broken |
60 | mconfigure \ |
61 | --libexecdir=/usr/sbin \ |
62 | --sysconfdir=/etc/mysql \ |
63 | --localstatedir=/var/lib/mysql \ |
64 | --without-raid \ |
65 | --with-low-memory \ |
66 | --enable-assembler \ |
67 | --with-charset=latin1 \ |
68 | --with-collation=latin1_swedish_ci \ |
69 | --enable-local-infile \ |
70 | --with-mysqld-user=mysql \ |
71 | --with-extra-charsets=none \ |
72 | --enable-thread-safe-client \ |
73 | --with-client-ldflags=-lstdc++ \ |
74 | --with-comment="Magellan_MySQL_${PVER}-${PBUILD}" \ |
75 | --with-unix-socket-path=/var/run/mysqld/mysqld.sock \ |
76 | --enable-shared \ |
77 | --disable-static \ |
78 | --without-libwrap \ |
79 | --without-ssl \ |
80 | --without-debug \ |
81 | --without-server \ |
82 | --without-embedded-server \ |
83 | --without-extra-tools \ |
84 | --without-innodb \ |
85 | --without-bench \ |
86 | --without-berkeley-db \ |
87 | --without-row-based-relication \ |
88 | --with-readline \ |
89 | || die |
90 | |
91 | mmake || die |
92 | } |
93 | |
94 | alx_generic_src_install() |
95 | { |
96 | cd ${SRCDIR} |
97 | mmake DESTDIR=${BINDIR} install || die |
98 | |
99 | # symlink client libs to libdir |
100 | pushd ${BINDIR}/usr/$(mlibdir) || die |
101 | for i in mysql/libmysqlclient{,_r}.so* |
102 | do |
103 | mlink ${i} /usr/$(mlibdir) || die |
104 | done |
105 | popd |
106 | |
107 | # remove all unneeded stuff |
108 | local i |
109 | # dirs |
110 | for i in sql-bench mysql-test |
111 | do |
112 | if [[ -d ${BINDIR}/usr/${i} ]] |
113 | then |
114 | rm -r ${BINDIR}/usr/${i} || die |
115 | fi |
116 | done |
117 | |
118 | # files |
119 | for i in share/mysql/mysql-log-rotate \ |
120 | share/mysql/mysql.server* \ |
121 | share/mysql/binary-configure* \ |
122 | share/mysql/my-*.cnf \ |
123 | share/mysql/mi_test_all* \ |
124 | bin/comp_err |
125 | do |
126 | if [[ -f ${BINDIR}/usr/${i} ]] |
127 | then |
128 | rm ${BINDIR}/usr/${i} || die |
129 | fi |
130 | done |
131 | |
132 | # needed directories |
133 | mkeepdir /var/lib/mysql || die |
134 | mchown mysql:mysql /var/lib/mysql || die |
135 | mchmod 0750 /var/lib/mysql || die |
136 | |
137 | mkeepdir /var/run/mysqld || die |
138 | mchown mysql:mysql /var/run/mysqld || die |
139 | |
140 | mkeepdir /var/log/mysql || die |
141 | mchown mysql:mysql /var/log/mysql || die |
142 | |
143 | # some common symlinks |
144 | for i in mysqlanalyze mysqlrepair mysqloptimize |
145 | do |
146 | mlink mysqlcheck /usr/bin/${i} || die |
147 | done |
148 | |
149 | minstalldocs ChangeLog COPYING EXCEPTIONS-CLIENT README || die |
150 | minstalldocs support-files/my-*.cnf support-files/magic || die |
151 | minstalldocs support-files/ndb-config-2-node.ini || die |
152 | |
153 | for i in scripts/mysql* |
154 | do |
155 | [[ ${i%.sh} == ${i} ]] && minstalldocs ${i} |
156 | done |
157 | |
158 | # install a default my.cnf |
159 | minstalldir /etc/mysql || die |
160 | minstallfile support-files/my-medium.cnf /etc/mysql/my.cnf || die |
161 | } |
162 | |
163 | preinstall() |
164 | { |
165 | add_conf_prot_mask /etc/mysql/my.cnf |
166 | } |