Index: trunk/tools/ts-specs/TSmysql.spec |
— | — | @@ -0,0 +1,161 @@ |
| 2 | +%define _basedir /opt/TSmysql |
| 3 | +%include Solaris.inc |
| 4 | + |
| 5 | +%define _prefix /opt/TSmysql |
| 6 | + |
| 7 | +Name: TSmysql |
| 8 | +Summary: MySQL database server |
| 9 | +Version: 5.1.30 |
| 10 | +Source: http://mysql.mirrors.pair.com/Downloads/MySQL-5.1/mysql-%{version}.tar.gz |
| 11 | + |
| 12 | +SUNW_BaseDir: /opt/TSmysql |
| 13 | +BuildRoot: %{_tmppath}/%{name}-%{version}-build |
| 14 | +%include default-depend.inc |
| 15 | + |
| 16 | +Requires: TSisaexec |
| 17 | + |
| 18 | +%ifarch amd64 sparcv9 |
| 19 | +%include arch64.inc |
| 20 | +%use mysql64=mysql.spec |
| 21 | +%endif |
| 22 | +%include base.inc |
| 23 | +%use mysql = mysql.spec |
| 24 | + |
| 25 | +%package devel |
| 26 | +Summary: %{summary} - development files |
| 27 | +SUNW_BaseDir: %{_basedir} |
| 28 | +%include default-depend.inc |
| 29 | +Requires: %name |
| 30 | + |
| 31 | +%package extra |
| 32 | +Summary: %{summary} - test suite and benchmark tools |
| 33 | +SUNW_BaseDir: %{_basedir} |
| 34 | +%include default-depend.inc |
| 35 | +Requires: %name |
| 36 | + |
| 37 | +%prep |
| 38 | +rm -rf %name-%version |
| 39 | +mkdir %name-%version |
| 40 | + |
| 41 | +%ifarch amd64 sparcv9 |
| 42 | +mkdir %name-%version/%_arch64 |
| 43 | +%mysql64.prep -d %name-%version/%_arch64 |
| 44 | +%endif |
| 45 | + |
| 46 | +mkdir %name-%version/%{base_arch} |
| 47 | +%mysql.prep -d %name-%version/%{base_arch} |
| 48 | + |
| 49 | +%build |
| 50 | + |
| 51 | +CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '` |
| 52 | +if test "x$CPUS" = "x" -o $CPUS = 0; then |
| 53 | + CPUS=1 |
| 54 | +fi |
| 55 | + |
| 56 | +export CC="cc" |
| 57 | +export CXX="CC" |
| 58 | +export CPPFLAGS='-I/usr/sfw/include' |
| 59 | + |
| 60 | +%ifarch amd64 sparcv9 |
| 61 | +%include arch64.inc |
| 62 | +export CFLAGS="%optflags -m64" |
| 63 | +export CXXFLAGS="%cxx_optflags -m64" |
| 64 | +export LDFLAGS="%{_ldflags} -m64 -L/usr/sfw/lib/%_arch64 -R/usr/sfw/lib/%_arch64" |
| 65 | +%mysql64.build -d %name-%version/%_arch64 |
| 66 | +%endif |
| 67 | +%include base.inc |
| 68 | +export LDFLAGS="%{_ldflags} -L/usr/sfw/lib -R/usr/sfw/lib" |
| 69 | +export CFLAGS="%optflags" |
| 70 | +export CXXFLAGS="%cxx_optflags" |
| 71 | +%mysql.build -d %name-%version/%{base_arch} |
| 72 | + |
| 73 | +%install |
| 74 | +rm -rf $RPM_BUILD_ROOT |
| 75 | + |
| 76 | +%ifarch amd64 sparcv9 |
| 77 | +%mysql64.install -d %name-%version/%_arch64 |
| 78 | +mv $RPM_BUILD_ROOT/%{_bindir}/%_arch64/mysql_config $RPM_BUILD_ROOT/%{_bindir} |
| 79 | +rm -rf $RPM_BUILD_ROOT/%{_bindir}/%_arch64 |
| 80 | +mkdir -p $RPM_BUILD_ROOT/%{_bindir}/%_arch64 |
| 81 | +mv $RPM_BUILD_ROOT/%{_bindir}/mysql_config $RPM_BUILD_ROOT/%{_bindir}/%_arch64 |
| 82 | +rm -f $RPM_BUILD_ROOT/%{_libdir}/%_arch64/mysqlmanager |
| 83 | +%endif |
| 84 | + |
| 85 | +%mysql.install -d %name-%version/%{base_arch} |
| 86 | + |
| 87 | +%ifarch i386 |
| 88 | +mkdir -p $RPM_BUILD_ROOT/%{_libdir}/i86 |
| 89 | +mv $RPM_BUILD_ROOT/%{_libdir}/mysqld $RPM_BUILD_ROOT/%{_libdir}/i86 |
| 90 | +%else |
| 91 | +mkdir -p $RPM_BUILD_ROOT/%{_libdir}/sparcv7 |
| 92 | +mv $RPM_BUILD_ROOT/%{_libdir}/mysqld $RPM_BUILD_ROOT/%{_libdir}/sparcv7 |
| 93 | +%endif |
| 94 | + |
| 95 | +ln -s ../../ts/lib/isaexec $RPM_BUILD_ROOT%{_libdir}/mysqld |
| 96 | + |
| 97 | +%clean |
| 98 | +rm -rf $RPM_BUILD_ROOT |
| 99 | + |
| 100 | +%files |
| 101 | +%defattr (-, root, bin) |
| 102 | +%dir %attr (0755, root, bin) %{_bindir} |
| 103 | +%{_bindir}/* |
| 104 | +%dir %attr (0755, root, sys) %{_libdir} |
| 105 | +%hard %{_libdir}/mysqld |
| 106 | +%{_libdir}/mysqlmanager |
| 107 | +%dir %attr (0755, root, sys) %{_libdir}/i86 |
| 108 | +%{_libdir}/i86/mysqld |
| 109 | +%dir %attr (0755, root, sys) %{_libdir}/mysql |
| 110 | +%{_libdir}/mysql/*.so.* |
| 111 | +%dir %attr (0755, root, sys) %{_libdir}/mysql/plugin |
| 112 | +%{_libdir}/mysql/plugin/*.so* |
| 113 | +%dir %attr (0755, root, sys) %{_datadir} |
| 114 | +%dir %attr (0755, root, sys) %{_datadir}/info |
| 115 | +%{_datadir}/info/* |
| 116 | +%dir %attr (0755, root, sys) %{_datadir}/mysql |
| 117 | +%{_datadir}/mysql/* |
| 118 | +%dir %attr (0755, root, sys) %{_mandir} |
| 119 | +%dir %attr (0755, root, sys) %{_mandir}/man1 |
| 120 | +%{_mandir}/man1/* |
| 121 | +%dir %attr (0755, root, sys) %{_mandir}/man8 |
| 122 | +%{_mandir}/man8/* |
| 123 | + |
| 124 | +%ifarch amd64 sparcv9 |
| 125 | +%dir %attr (0755, root, sys) %{_libdir}/%_arch64 |
| 126 | +%{_libdir}/%_arch64/mysqld |
| 127 | +%dir %attr (0755, root, sys) %{_libdir}/%_arch64/mysql |
| 128 | +%{_prefix}/lib/%_arch64/mysql/*.so.* |
| 129 | +%dir %attr (0755, root, sys) %{_libdir}/%_arch64/mysql/plugin |
| 130 | +%{_prefix}/lib/%_arch64/mysql/plugin/*.so* |
| 131 | +%endif |
| 132 | + |
| 133 | +%files devel |
| 134 | +%defattr (-, root, bin) |
| 135 | +%dir %attr (0755, root, sys) %{_libdir} |
| 136 | +%dir %attr (0755, root, sys) %{_libdir}/mysql |
| 137 | +%{_libdir}/mysql/*.so |
| 138 | +%dir %attr (0755, root, sys) %{_prefix}/include |
| 139 | +%{_prefix}/include/* |
| 140 | +%dir %attr (0755, root, sys) %{_datadir} |
| 141 | +%dir %attr (0755, root, sys) %{_datadir}/aclocal |
| 142 | +%{_datadir}/aclocal/* |
| 143 | + |
| 144 | +%ifarch amd64 sparcv9 |
| 145 | +%dir %attr (0755, root, sys) %{_libdir}/%_arch64 |
| 146 | +%dir %attr (0755, root, sys) %{_libdir}/%_arch64/mysql |
| 147 | +%{_prefix}/lib/%_arch64/mysql/*.so |
| 148 | +%dir %attr (0755, root, bin) %{_bindir} |
| 149 | +%dir %attr (0755, root, bin) %{_bindir}/%_arch64 |
| 150 | +%{_bindir}/%_arch64/* |
| 151 | +%endif |
| 152 | + |
| 153 | +%files extra |
| 154 | +%defattr (-, root, bin) |
| 155 | +%dir %attr (0755, root, sys) %{_prefix}/mysql-test |
| 156 | +%{_prefix}/mysql-test/* |
| 157 | +%dir %attr (0755, root, sys) %{_prefix}/sql-bench |
| 158 | +%{_prefix}/sql-bench/* |
| 159 | + |
| 160 | +%changelog |
| 161 | +* Thu Jan 29 2009 - river@wikimedia.org |
| 162 | +- initial version |
Index: trunk/tools/ts-specs/base-specs/mysql.spec |
— | — | @@ -0,0 +1,44 @@ |
| 2 | +%define _prefix /opt/TSmysql |
| 3 | + |
| 4 | +Name: TSmysql |
| 5 | +Summary: MySQL database server |
| 6 | +Version: 5.1.30 |
| 7 | +Source: http://mysql.mirrors.pair.com/Downloads/MySQL-5.1/mysql-%{version}.tar.gz |
| 8 | + |
| 9 | +SUNW_BaseDir: /opt/TSmysql |
| 10 | +BuildRoot: %{_tmppath}/%{name}-%{version}-build |
| 11 | + |
| 12 | +%prep |
| 13 | +%setup -q -n mysql-%version |
| 14 | + |
| 15 | +%build |
| 16 | + |
| 17 | +CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '` |
| 18 | +if test "x$CPUS" = "x" -o $CPUS = 0; then |
| 19 | + CPUS=1 |
| 20 | +fi |
| 21 | + |
| 22 | +./configure \ |
| 23 | + --prefix=%{_prefix} \ |
| 24 | + --bindir=%{_bindir} \ |
| 25 | + --libdir=%{_libdir} \ |
| 26 | + --libexecdir=%{_libdir} \ |
| 27 | + --includedir=%{_includedir} \ |
| 28 | + --with-extra-charsets=all \ |
| 29 | + --with-mysqld-user=mysql \ |
| 30 | + --with-zlib-dir=/usr \ |
| 31 | + --with-big-tables \ |
| 32 | + --with-ssl=/usr/sfw \ |
| 33 | + --with-plugins=max-no-ndb |
| 34 | + |
| 35 | +gmake -j$CPUS |
| 36 | + |
| 37 | +%install |
| 38 | +gmake install DESTDIR=$RPM_BUILD_ROOT |
| 39 | +rm $RPM_BUILD_ROOT/%{_libdir}/mysql/*.la |
| 40 | +rm $RPM_BUILD_ROOT/%{_libdir}/mysql/*.a |
| 41 | +rm $RPM_BUILD_ROOT/%{_libdir}/mysql/plugin/*.la |
| 42 | +rm $RPM_BUILD_ROOT/%{_libdir}/mysql/plugin/*.a |
| 43 | + |
| 44 | +%clean |
| 45 | +rm -rf $RPM_BUILD_ROOT |