2010-06-06 Mark Wright <[email protected]>
authormarkwright
Sun, 06 Jun 2010 10:37:12 +0000
changeset 2760 6102b8653c96
parent 2759 d9754a9e0060
child 2761 81d82b86fa3e
2010-06-06 Mark Wright <[email protected]> * SFEerlang.spec, base-specs/erlang.spec: *NEW* current Erlang programming language release, SMP, HiPE, 64bit built on Solaris 10u8 with gtk2 from KDE4 Solaris * patches/erlang-01-lib-wx-c_src-wxe_gl.h.diff: Fix for 64 bit * base-specs/wxwidgets-gnu.spec: Build 64 bit * patches/wxwidgets-05-setup.h.in.diff: Fix header for 64 bit build * patches/wxwidgets-03-changeset_r61009.diff: gtk2 GSocket name clash * patches/wxwidgets-04-wxFileName-ticket-4697.diff: Fix for 64 bit
ChangeLog
SFEerlang.spec
SFEwxwidgets-gnu.spec
base-specs/erlang.spec
base-specs/wxwidgets-gnu.spec
patches/erlang-01-lib-wx-c_src-wxe_gl.h.diff
patches/wxwidgets-03-changeset_r61009.diff
patches/wxwidgets-04-wxFileName-ticket-4697.diff
patches/wxwidgets-05-setup.h.in.diff
--- a/ChangeLog	Sat Jun 05 03:11:16 2010 +0000
+++ b/ChangeLog	Sun Jun 06 10:37:12 2010 +0000
@@ -1,4 +1,16 @@
+2010-06-06 Mark Wright <[email protected]>
+
+	* SFEerlang.spec, base-specs/erlang.spec: *NEW* current Erlang
+	  programming language release, SMP, HiPE, 64bit built on
+	  Solaris 10u8 with gtk2 from KDE4 Solaris
+	* patches/erlang-01-lib-wx-c_src-wxe_gl.h.diff: Fix for 64 bit
+	* base-specs/wxwidgets-gnu.spec: Build 64 bit
+	* patches/wxwidgets-05-setup.h.in.diff: Fix header for 64 bit build
+	* patches/wxwidgets-03-changeset_r61009.diff: gtk2 GSocket name clash
+	* patches/wxwidgets-04-wxFileName-ticket-4697.diff: Fix for 64 bit
+
 2010-06-05 Mark Wright <[email protected]>
+
 	* SFEunixodbc.spec: bump to 2.2.14, build 64 bit, install
 	  headers in /usr/include/odbc
 	* base-specs/unixodbc-sr.spec: build 64 bit
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SFEerlang.spec	Sun Jun 06 10:37:12 2010 +0000
@@ -0,0 +1,184 @@
+#
+# spec file for package SFEerlang 
+#
+# Copyright 2010 Sun Microsystems, Inc.
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+
+%include Solaris.inc
+
+%define cc_is_gcc 1
+
+%ifarch amd64 sparcv9
+%include arch64.inc
+%define is64 1
+%use erlang_64 = erlang.spec
+%endif
+
+%include base.inc
+%define is64 0
+%use erlang = erlang.spec
+
+%define pkg_src_name     otp_src
+%define src_name         erlang
+%define src_ver          R13B04
+
+Name:                    SFEerlang 
+Summary:                 erlang - Erlang programming language and OTP libraries (g++-built)
+Version:                 %{src_ver}
+Release:                 1
+License:                 ERLANG PUBLIC LICENSE
+Group:                   Development/Languages/Erlang
+Distribution:            Java Desktop System
+Vendor:                  Sun Microsystems, Inc.
+URL:                     http://www.erlang.org
+Source:                  http://erlang.org/download/%{pkg_src_name}_%{src_ver}.tar.gz
+SUNW_BaseDir:            %{_basedir}
+BuildRoot:               %{_tmppath}/%{src_name}_%{src_ver}
+
+%define SFEgd            %(/usr/bin/pkginfo -q SUNWgd && echo 0 || echo 1)
+%define SFEunixodbc      %(/usr/bin/pkginfo -q SUNWunixodbc && echo 0 || echo 1)
+
+%include default-depend.inc
+
+%define src2_name crypto_lib_makefile.patch
+%define src3_name erts_configure.patch
+%define src4_name inet_drv.c.patch
+%define src5_name libs_makefile.patch64
+%define src6_name orber_lib_makefile.patch
+%define src7_name ssl_examples_makefile.patch
+
+Source2:                 http://src.opensolaris.org/source/raw/sfw/usr/src/cmd/erlang/Patches/%{src2_name}
+Source3:                 http://src.opensolaris.org/source/raw/sfw/usr/src/cmd/erlang/Patches/%{src3_name}
+Source4:                 http://src.opensolaris.org/source/raw/sfw/usr/src/cmd/erlang/Patches/%{src4_name}
+Source5:                 http://src.opensolaris.org/source/raw/sfw/usr/src/cmd/erlang/Patches/%{src5_name}
+Source6:                 http://src.opensolaris.org/source/raw/sfw/usr/src/cmd/erlang/Patches/%{src6_name}
+Source7:                 http://src.opensolaris.org/source/raw/sfw/usr/src/cmd/erlang/Patches/%{src7_name}
+
+Requires: 	SFEgcc
+
+Requires:       SFEwxwidgets-gnu
+BuildRequires:  SFEwxwidgets-gnu-devel
+
+%if %SFEgd
+BuildRequires: SFEgd-devel
+Requires: SFEgd
+%else
+BuildRequires: SUNWgd2
+Requires: SUNWgd2
+%endif
+
+%if %SFEunixodbc
+BuildRequires: SFEunixodbc-devel
+Requires: SFEunixodbc
+%else
+BuildRequires: SUNWunixodbc
+Requires: SUNWunixodbc
+%endif
+
+BuildRequires: SUNWgtar
+BuildRequires: SUNWesu
+
+%prep
+rm -rf %{name}-%{version}
+mkdir %{name}-%{version}
+%ifarch amd64 sparcv9
+mkdir %{name}-%{version}/%{_arch64}
+%define is64 1
+%erlang_64.prep -d %{name}-%{version}/%{_arch64}
+%endif
+
+mkdir %{name}-%{version}/%{base_arch}
+%define is64 0
+%erlang.prep -d %{name}-%{version}/%{base_arch}
+
+
+%build
+%ifarch amd64 sparcv9
+%define is64 1
+%erlang_64.build -d %{name}-%{version}/%{_arch64}
+%endif
+
+%define is64 0
+%erlang.build -d %{name}-%{version}/%{base_arch}
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%ifarch amd64 sparcv9
+%define is64 1
+%erlang_64.install -d %{name}-%{version}/%{_arch64}
+%endif
+
+%define is64 0
+%erlang.install -d %{name}-%{version}/%{base_arch}
+
+
+# Prepare lists of files for packaging
+cd %{_builddir}/%{name}-%{version}
+touch SFEerlang-all.files
+
+find $RPM_BUILD_ROOT%{_prefix} \( -type f -o -type l \) -name "*" > SFEerlang-all.files
+sort SFEerlang-all.files > SFEerlang-all-sort.files
+# Clean up syntax for %files section
+sed -i -e 's:'"$RPM_BUILD_ROOT"'::' SFEerlang-all-sort.files
+
+%clean
+%ifarch amd64 sparcv9
+%define is64 1
+%erlang_64.clean -d %{name}-%{version}/%{_arch64}
+%endif
+
+%define is64 0
+%erlang.clean -d %{name}-%{version}/%{base_arch}
+
+%files -f SFEerlang-all-sort.files
+%defattr (-, root, bin)
+%dir %attr (0755, root, bin) %{_bindir}
+%dir %attr (0755, root, bin) %{_libdir}
+
+%ifarch amd64 sparcv9
+%dir %attr (0755, root, bin) %{_bindir}/%{_arch64}
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}
+%endif
+
+%ifarch amd64 sparcv9
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/erlang/erts-5.7.5/man
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/erlang/erts-5.7.5/doc
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/erlang/lib/kernel-2.13.5/examples/uds_dist/ebin
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/erlang/lib/kernel-2.13.5/examples/uds_dist/priv
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/erlang/lib/erl_interface-3.6.5/src/auxdir
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/erlang/lib/inets-5.3/examples/server_root/htdocs/secret/top_secret
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/erlang/lib/inets-5.3/examples/server_root/htdocs/mnesia_secret/top_secret
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/erlang/lib/inets-5.3/examples/server_root/logs
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/erlang/lib/mnesia-4.4.13/include
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/erlang/lib/ssl-3.10.8/examples/certs/etc/otpCA/certs
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/erlang/lib/ssl-3.10.8/examples/certs/etc/otpCA/crl
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/erlang/lib/ssl-3.10.8/examples/certs/etc/erlangCA/crl
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/erlang/lib/ssl-3.10.8/examples/certs/etc/erlangCA/certs
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/erlang/lib/common_test-1.4.7/priv/bin
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/erlang/lib/percept-0.8.4/priv/logs
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/erlang/lib/odbc-2.10.7/priv/obj
+%endif
+
+%dir %attr (0755, root, bin) %{_libdir}/erlang/erts-5.7.5/man
+%dir %attr (0755, root, bin) %{_libdir}/erlang/erts-5.7.5/doc
+%dir %attr (0755, root, bin) %{_libdir}/erlang/lib/kernel-2.13.5/examples/uds_dist/priv
+%dir %attr (0755, root, bin) %{_libdir}/erlang/lib/kernel-2.13.5/examples/uds_dist/ebin
+%dir %attr (0755, root, bin) %{_libdir}/erlang/lib/erl_interface-3.6.5/src/auxdir
+%dir %attr (0755, root, bin) %{_libdir}/erlang/lib/inets-5.3/examples/server_root/htdocs/secret/top_secret
+%dir %attr (0755, root, bin) %{_libdir}/erlang/lib/inets-5.3/examples/server_root/htdocs/mnesia_secret/top_secret
+%dir %attr (0755, root, bin) %{_libdir}/erlang/lib/inets-5.3/examples/server_root/logs
+%dir %attr (0755, root, bin) %{_libdir}/erlang/lib/mnesia-4.4.13/include
+%dir %attr (0755, root, bin) %{_libdir}/erlang/lib/ssl-3.10.8/examples/certs/etc/erlangCA/crl
+%dir %attr (0755, root, bin) %{_libdir}/erlang/lib/ssl-3.10.8/examples/certs/etc/erlangCA/certs
+%dir %attr (0755, root, bin) %{_libdir}/erlang/lib/ssl-3.10.8/examples/certs/etc/otpCA/crl
+%dir %attr (0755, root, bin) %{_libdir}/erlang/lib/ssl-3.10.8/examples/certs/etc/otpCA/certs
+%dir %attr (0755, root, bin) %{_libdir}/erlang/lib/common_test-1.4.7/priv/bin
+%dir %attr (0755, root, bin) %{_libdir}/erlang/lib/percept-0.8.4/priv/logs
+%dir %attr (0755, root, bin) %{_libdir}/erlang/lib/odbc-2.10.7/priv/obj
+
+%changelog
+* Sun Jun 6 2010 - [email protected]
+- Initial spec
--- a/SFEwxwidgets-gnu.spec	Sat Jun 05 03:11:16 2010 +0000
+++ b/SFEwxwidgets-gnu.spec	Sun Jun 06 10:37:12 2010 +0000
@@ -7,17 +7,28 @@
 %include Solaris.inc
 %include usr-gnu.inc
 
+%define pkg_src_name	wxWidgets
+%define	src_ver 2.8.10
+%define	src_name        wxwidgets-gnu
+
 %define using_gld %(gcc -v 2>&1 | /usr/xpg4/bin/grep -q with-gnu-ld && echo 1 || echo 0)
 %define SUNWlibsdl      %(/usr/bin/pkginfo -q SUNWlibsdl && echo 1 || echo 0)
 
+%define cc_is_gcc 1
+%ifarch amd64 sparcv9
+%include arch64.inc
+%define is64 1
+%use wxwidgets_gnu_64 = wxwidgets-gnu.spec
+%endif
+%include base.inc
+%define is64 0
+%use wxwidgets_gnu = wxwidgets-gnu.spec
+
 Name:                    SFEwxwidgets-gnu
 Summary:                 wxWidgets - Cross-Platform GUI Library (g++)
 URL:                     http://wxwidgets.org/
-Version:                 2.8.10
-%define tarball_version  2.8.10
-Source:			 %{sf_download}/wxwindows/wxWidgets-%{tarball_version}.tar.bz2
-Patch1:                  wxwidgets-01-msgfmt.diff
-Patch2:                  wxwidgets-02-Tmacro.diff
+Version:                 %{src_ver}
+Source:			 %{sf_download}/wxwindows/%{pkg_src_name}-%{src_ver}.tar.bz2
 SUNW_BaseDir:            %{_basedir}
 BuildRoot:               %{_tmppath}/%{name}-%{version}-build
 %include default-depend.inc
@@ -39,6 +50,18 @@
 BuildRequires: SFEsdl-devel
 %endif
 
+%if %{is_s10}
+# There is no gtk2 on solaris 10, hence necessary to build it from the
+# KDE4 Solaris project:
+# http://techbase.kde.org/index.php?title=Projects/KDE_on_Solaris
+# Also after noticing that there are no 64 bit gtk v1 libs on solaris 10u8,
+# I gave in on trying to make it work with gtk v1 on Solaris 10u8.
+Requires:      FOSSgtk2
+Requires:      FOSSexpat
+BuildRequires: FOSSgtk2
+BuildRequires: FOSSexpat
+%endif
+
 %package devel
 Summary:		 %{summary} - development files
 SUNW_BaseDir:            %{_basedir}
@@ -54,90 +77,63 @@
 %endif
 
 %prep
-rm -rf %name-%version
-%setup -q -n wxWidgets-%tarball_version
-%patch1 -p1
-%patch2 -p0
-
-%build
-CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
-if test "x$CPUS" = "x" -o $CPUS = 0; then
-    CPUS=1
-fi
-
-export CPPFLAGS="-I/usr/X11/include"
-export CC=gcc
-export CFLAGS="%{gcc_optflags}"
-export CXX=g++
-export CXXFLAGS="%{gcc_cxx_optflags}"
-%if %using_gld
-  export LDFLAGS="-L%{_libdir} -L/usr/X11/lib -R%{_libdir} -R/usr/X11/lib -lm"
-  CFLAGS="$( echo $CFLAGS | sed 's/ -Xlinker -i//' )"
-  CXXFLAGS="$( echo $CXXFLAGS | sed 's/ -Xlinker -i//' )"
-%else
-  export LDFLAGS="%{_ldflags} -lm"
-  export LD_OPTIONS="-i -L%{_libdir} -L/usr/X11/lib -R%{_libdir}:/usr/X11/lib"
+rm -rf %{name}-%{version}
+mkdir %{name}-%{version}
+%ifarch amd64 sparcv9
+mkdir %{name}-%{version}/%{_arch64}
+%define is64 1
+%wxwidgets_gnu_64.prep -d %{name}-%{version}/%{_arch64}
 %endif
 
-# keep PATH from being mangled by SDL check (breaks grep -E and tr A-Z a-z)
-perl -pi -e 's,PATH=".*\$PATH",:,' configure
-./configure --prefix=%{_prefix}			\
-	    --bindir=%{_bindir}			\
-	    --includedir=%{_includedir}		\
-            --libdir=%{_libdir}			\
-            --enable-gtk2			\
-            --enable-unicode			\
-            --enable-mimetype			\
-            --enable-gui			\
-            --enable-xrc			\
-            --with-gtk				\
-            --with-subdirs			\
-            --without-expat                     \
-            --with-sdl                          \
-            --with-gnomeprint			\
-            --with-gnomevfs			\
-            --with-opengl			\
-            --without-libmspack
+mkdir %{name}-%{version}/%{base_arch}
+%define is64 0
+%wxwidgets_gnu.prep -d %{name}-%{version}/%{base_arch}
+
 
-make -j$CPUS
-cd contrib
-make -j$CPUS
-cd ..
-cd locale
-make allmo
-cd ..
+%build
+%ifarch amd64 sparcv9
+%define is64 1
+%wxwidgets_gnu_64.build -d %{name}-%{version}/%{_arch64}
+%endif
+
+%define is64 0
+%wxwidgets_gnu.build -d %{name}-%{version}/%{base_arch}
+
 
 %install
 rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-cd contrib
-make install DESTDIR=$RPM_BUILD_ROOT
-cd ..
-
-cd $RPM_BUILD_ROOT%{_bindir}
-rm -f wx-config
-ln -s ../lib/wx/config/gtk2-unicode-release-* wx-config
-perl -pi -e 's,-pthreads,,' wx-config
-
-%if %build_l10n
-# Rename zh dir to zh_CN as zh is a symlink to zh_CN and causing installation
-# problems as a dir.
-cd $RPM_BUILD_ROOT%{_datadir}/locale
-mv zh zh_CN
-%else
-# REMOVE l10n FILES
-rm -rf $RPM_BUILD_ROOT%{_datadir}/locale
+%ifarch amd64 sparcv9
+%define is64 1
+%wxwidgets_gnu_64.install -d %{name}-%{version}/%{_arch64}
 %endif
 
+%define is64 0
+%wxwidgets_gnu.install -d %{name}-%{version}/%{base_arch}
+
 %clean
-rm -rf $RPM_BUILD_ROOT
+%ifarch amd64 sparcv9
+%define is64 1
+%wxwidgets_gnu_64.clean -d %{name}-%{version}/%{_arch64}
+%endif
+
+%define is64 0
+%wxwidgets_gnu.clean -d %{name}-%{version}/%{base_arch}
 
 %files
 %defattr (-, root, bin)
 %dir %attr (0755, root, bin) %{_bindir}
-%{_bindir}/*
+%{_bindir}/wx*
 %dir %attr (0755, root, bin) %{_libdir}
-%{_libdir}/*
+%{_libdir}/lib*
+%{_libdir}/wx
+
+%ifarch amd64 sparcv9
+%dir %attr (0755, root, bin) %{_bindir}/%{_arch64}
+%{_bindir}/%{_arch64}/wx*
+%dir %attr (0755, root, bin) %{_libdir}/%{_arch64}
+%{_libdir}/%{_arch64}/lib*
+%{_libdir}/%{_arch64}/wx*
+%endif
 
 %files devel
 %defattr (-, root, bin)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/base-specs/erlang.spec	Sun Jun 06 10:37:12 2010 +0000
@@ -0,0 +1,136 @@
+# base spec for erlang
+#
+# Copyright (c) 2010 Sun Microsystems, Inc.
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+
+%define pkg_src_name     otp_src
+%define src_name         erlang
+%define src_ver          R13B04
+
+Name:                    SFEerlang 
+Summary:                 erlang - Erlang programming language and OTP libraries (g++-built)
+Version:                 %{src_ver}
+Release:                 1
+License:                 ERLANG PUBLIC LICENSE
+Group:                   Development/Languages/Erlang
+Distribution:            Java Desktop System
+Vendor:                  Sun Microsystems, Inc.
+URL:                     http://www.erlang.org
+Source:                  http://erlang.org/download/%{pkg_src_name}_%{src_ver}.tar.gz
+SUNW_BaseDir:            %{_basedir}
+BuildRoot:               %{_tmppath}/%{src_name}_%{src_ver}
+
+Patch1:                  erlang-01-lib-wx-c_src-wxe_gl.h.diff
+
+%prep
+%setup -q -n %{pkg_src_name}_%{src_ver}
+%patch1 -p1
+mkdir Patches
+cp %{SOURCE2} Patches
+cp %{SOURCE3} Patches
+cp %{SOURCE4} Patches
+cp %{SOURCE5} Patches
+cp %{SOURCE6} Patches
+cp %{SOURCE7} Patches
+
+gpatch -p 0 < Patches/%{src3_name}
+gpatch -p 0 < Patches/%{src4_name}
+gpatch -p 0 < Patches/%{src7_name}
+
+chmod 0755 configure
+
+sed -i -e 's,WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`,WX_LIBS="`$WX_CONFIG_WITH_ARGS --libs` -lGLU",' lib/wx/configure lib/wx/configure.in
+sed -i -e '/SSL_DYNAMIC_ONLY=/s:no:yes:' erts/configure erts/configure.in
+
+sed -i -e 's,$rdir/include,$rdir/include/odbc,g' lib/odbc/configure lib/odbc/configure.in
+sed -i -e 's,${libdir}/64,${libdir}/%{_arch64},g' lib/odbc/configure lib/odbc/configure.in
+
+export CC=gcc
+export CXX=g++
+export CPPFLAGS="-D_LARGEFILE64_SOURCE -I%{gnu_inc} -I%{gnu_inc}/wx-2.8 -I%{_includedir}/gd2 -I%{sfw_inc} -I%{xorg_inc}"
+export LDFLAGS="%{_ldflags} %{gnu_lib_path} %{sfw_lib_path} %{xorg_lib_path}"
+%if %{is64}
+export CPPFLAGS="${CPPFLAGS} -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8"
+export CFLAGS="%{gcc_optflags64}"
+export CXXFLAGS="%{gcc_cxx_optflags64}"
+export LDFLAGS="-m64 ${LDFLAGS}"
+%else
+export CFLAGS="%{gcc_optflags}"
+export CXXFLAGS="%{gcc_cxx_optflags}"
+%endif
+
+./configure --prefix=%{_prefix} \
+            --bindir=%{_bindir}	\
+            --libdir=%{_libdir}	\
+            --libexecdir=%{_libexecdir}	\
+            --includedir=%{_includedir} \
+            --mandir=%{_mandir} \
+            --enable-static=no \
+	    --localstatedir=/var \
+ 	    --disable-static \
+ 	    --disable-rpath \
+ 	    --enable-smp-support \
+ 	    --enable-threads \
+ 	    --enable-hipe \
+ 	    --with-ssl \
+%if %{is64}
+            --enable-m64-build \
+%endif
+ 	    --enable-dynamic-ssl-lib
+
+%build
+export CC=gcc
+export CXX=g++
+export CPPFLAGS="-D_LARGEFILE64_SOURCE -I%{gnu_inc} -I%{gnu_inc}/wx-2.8 -I%{_includedir}/gd2 -I%{sfw_inc} -I%{xorg_inc}"
+export LDFLAGS="%{_ldflags} %{gnu_lib_path} %{sfw_lib_path} %{xorg_lib_path}"
+%if %{is64}
+export CPPFLAGS="${CPPFLAGS} -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8"
+export CFLAGS="%{gcc_optflags64}"
+export CXXFLAGS="%{gcc_cxx_optflags64}"
+export LDFLAGS="-m64 ${LDFLAGS}"
+%else
+export CFLAGS="%{gcc_optflags}"
+export CXXFLAGS="%{gcc_cxx_optflags}"
+%endif
+
+export SHELL="/bin/bash"
+export CONFIG_SHELL="/bin/bash"
+export MAKESHELL="/bin/bash"
+${MAKE}
+
+%install
+export CC=gcc
+export CXX=g++
+export CPPFLAGS="-D_LARGEFILE64_SOURCE -I%{gnu_inc} -I%{gnu_inc}/wx-2.8 -I%{_includedir}/gd2 -I%{sfw_inc} -I%{xorg_inc}"
+export LDFLAGS="%{_ldflags} %{gnu_lib_path} %{sfw_lib_path} %{xorg_lib_path}"
+%if %{is64}
+export CPPFLAGS="${CPPFLAGS} -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8"
+export CFLAGS="%{gcc_optflags64}"
+export CXXFLAGS="%{gcc_cxx_optflags64}"
+export LDFLAGS="-m64 ${LDFLAGS}"
+%else
+export CFLAGS="%{gcc_optflags}"
+export CXXFLAGS="%{gcc_cxx_optflags}"
+%endif
+
+export SHELL="/bin/bash"
+export CONFIG_SHELL="/bin/bash"
+export MAKESHELL="/bin/bash"
+
+$MAKE install DESTDIR=${RPM_BUILD_ROOT}
+
+if [ ! -f ${RPM_BUILD_ROOT}/usr/lib/%{_arch64}/erlang/lib/tools-2.6.5.1/emacs/erlang-skels.el ]
+then
+    # These files are not installed by make install in the R13B04 Erlang/OTP release
+    install -m 0644 lib/tools/emacs/erlang-skels.el ${RPM_BUILD_ROOT}/usr/lib/%{_arch64}/erlang/lib/tools-2.6.5.1/emacs
+    install -m 0644 lib/tools/emacs/erlang-skels-old.el ${RPM_BUILD_ROOT}/usr/lib/%{_arch64}/erlang/lib/tools-2.6.5.1/emacs
+fi
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%changelog
+* Sun Jun 6 2010 - [email protected]
+- create
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/base-specs/wxwidgets-gnu.spec	Sun Jun 06 10:37:12 2010 +0000
@@ -0,0 +1,142 @@
+Name:                    SFEwxwidgets-gnu
+Summary:                 wxWidgets - Cross-Platform GUI Library (g++)
+URL:                     http://wxwidgets.org/
+Version:                 %{src_ver}
+Source:			 %{sf_download}/wxwindows/%{pkg_src_name}-%{src_ver}.tar.bz2
+Patch1:                  wxwidgets-01-msgfmt.diff
+Patch2:                  wxwidgets-02-Tmacro.diff
+# http://trac.wxwidgets.org/changeset/61009
+Patch3:                  wxwidgets-03-changeset_r61009.diff
+# http://trac.wxwidgets.org/ticket/4697
+Patch4:                  wxwidgets-04-wxFileName-ticket-4697.diff
+Patch5:                  wxwidgets-05-setup.h.in.diff
+SUNW_BaseDir:            %{_basedir}
+
+%prep
+rm -rf %{name}-%{src_ver}
+%setup -q -n %{pkg_src_name}-%{src_ver}
+%patch1 -p1
+#%patch2 -p0
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+
+sed -i -e 's,\\$(CC),\\$(CC) \\$(CFLAGS),g' configure
+sed -i -e 's,\\$(CXX),\\$(CXX) \\$(CXXFLAGS),g' configure
+sed -i -e 's,SHARED_LD_CC="${CC} -G -o",SHARED_LD_CC="${CC} \\$(CFLAGS) -G -o",g' configure
+sed -i -e 's,SHARED_LD_CXX="${CXX} -G -o",SHARED_LD_CXX="${CXX} \\$(CXXFLAGS) -G -o",g' configure
+sed -i -e 's,$(CXX) -o $@ $(WXRC_OBJECTS),$(CXX) -o $@ $(WXRC_CXXFLAGS) $(WXRC_OBJECTS),' utils/wxrc/Makefile.in
+# Rename zh dir to zh_CN as zh is a symlink to zh_CN and causing installation
+# problems as a dir.
+sed -i -e 's,zh zh_CN,zh_CN,' Makefile.in
+
+%build
+CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
+if test "x$CPUS" = "x" -o $CPUS = 0; then
+    CPUS=1
+fi
+
+export CPPFLAGS="-I%{xorg_inc}"
+export CC=gcc
+export CXX=g++
+%if %{is64}
+export CFLAGS="%{gcc_optflags64}"
+export CXXFLAGS="%{gcc_cxx_optflags64}"
+%else
+export CFLAGS="%{gcc_optflags}"
+export CXXFLAGS="%{gcc_cxx_optflags}"
+%endif
+%if %using_gld
+  export LDFLAGS="-L%{_libdir} -L%{xorg_lib} -R%{_libdir} -R%{xorg_lib} -lm"
+  CFLAGS="$( echo $CFLAGS | sed 's/ -Xlinker -i//' )"
+  CXXFLAGS="$( echo $CXXFLAGS | sed 's/ -Xlinker -i//' )"
+%else
+  export LDFLAGS="%{_ldflags} -lm"
+  export LD_OPTIONS="-i -L%{_libdir} -L%{xorg_lib} -R%{_libdir}:%{xorg_lib}"
+%endif
+
+%if %{is_s10}
+export CPPFLAGS="${CPPFLAGS} -I/opt/kde4/include"
+%if %{is64}
+export PATH=/opt/kde4/bin/%{_arch64}:%{_bindir}:${PATH}
+export PKG_CONFIG_PATH="/opt/kde4/lib/%{_arch64}/pkgconfig:/usr/lib/%{_arch64}/pkgconfig"
+export PKG_CONFIG="/opt/kde4/bin/%{_arch64}/pkg-config"
+%if %using_gld
+export LDFLAGS="${LDFLAGS} -L/opt/kde4/lib/%{_arch64} -R/opt/kde4/lib/%{_arch64}"
+%else
+export LD_OPTIONS="${LD_OPTIONS} -L/opt/kde4/lib/%{_arch64} -R/opt/kde4/lib/%{_arch64}"
+%endif
+%else
+export PATH=/opt/kde4/bin:%{_bindir}:${PATH}
+export PKG_CONFIG_PATH="/opt/kde4/lib/pkgconfig:/usr/lib/pkgconfig"
+export PKG_CONFIG="/opt/kde4/bin/pkg-config"
+%if %using_gld
+export LDFLAGS="${LDFLAGS} -L/opt/kde4/lib -R/opt/kde4/lib"
+%else
+export LD_OPTIONS="${LD_OPTIONS} -L/opt/kde4/lib -R/opt/kde4/lib"
+%endif
+%endif
+%endif
+
+# keep PATH from being mangled by SDL check (breaks grep -E and tr A-Z a-z)
+perl -pi -e 's,PATH=".*\$PATH",:,' configure
+./configure --prefix=%{_prefix}			\
+	    --bindir=%{_bindir}			\
+	    --includedir=%{_includedir}		\
+            --libdir=%{_libdir}			\
+            --enable-gtk2			\
+%if %{is_s10}
+            --without-gnomeprint		\
+            --without-gnomevfs			\
+            --with-expat                        \
+%else
+            --with-gnomeprint			\
+            --with-gnomevfs			\
+            --without-expat                     \
+%endif
+            --enable-unicode			\
+            --enable-mimetype			\
+            --enable-gui			\
+            --enable-xrc			\
+            --with-gtk				\
+            --with-subdirs			\
+            --with-sdl                          \
+            --with-opengl			\
+            --without-libmspack
+
+sed -i -e 's,${compiler} -o ${outfile} -MMD -MF,${compiler} -c -o ${outfile} -MMD -MF,' bk-make-pch
+
+make -j$CPUS
+cd contrib
+make -j$CPUS
+cd ..
+cd locale
+make allmo
+cd ..
+
+%install
+make install DESTDIR=$RPM_BUILD_ROOT
+cd contrib
+make install DESTDIR=$RPM_BUILD_ROOT
+cd ..
+
+%if %{is64}
+rm -f ${RPM_BUILD_ROOT}%{_prefix}/bin/%{_arch64}/wx-config
+pushd ${RPM_BUILD_ROOT}%{_prefix}/bin/%{_arch64}
+ln -s ../../lib/%{_arch64}/wx/config/gtk2-unicode-release-2.8 wx-config
+%else
+rm -f ${RPM_BUILD_ROOT}%{_prefix}/bin/wx-config
+pushd ${RPM_BUILD_ROOT}%{_prefix}/bin
+ln -s ../lib/wx/config/gtk2-unicode-release-2.8 wx-config
+%endif
+perl -pi -e 's,-pthreads,,' wx-config
+popd
+
+%if %build_l10n
+%else
+# REMOVE l10n FILES
+rm -rf $RPM_BUILD_ROOT%{_datadir}/locale
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/erlang-01-lib-wx-c_src-wxe_gl.h.diff	Sun Jun 06 10:37:12 2010 +0000
@@ -0,0 +1,27 @@
+--- otp_src_R13B04-orig/lib/wx/c_src/wxe_gl.h	2009-03-12 12:25:43.000000000 +0000
++++ otp_src_R13B04/lib/wx/c_src/wxe_gl.h	2010-06-06 05:16:12.457404922 +0000
+@@ -98,20 +98,20 @@
+ #include <inttypes.h>
+ #elif defined(__sun__)
+ #include <inttypes.h>
+-#if defined(__STDC__)
++#if defined(__STDC__) && !defined(_INT64_TYPE)
+ #if defined(__arch64__)
+ typedef long int int64_t;
+ typedef unsigned long int uint64_t;
+ #else
+ typedef long long int int64_t;
+ typedef unsigned long long int uint64_t;
+-#endif /* __arch64__ */
++#endif /* __arch64__ && !_INT64_TYPE */
+ #endif /* __STDC__ */
+-#elif defined( __VMS )
++#elif defined( __VMS ) || defined(__SOL64__)
+ #include <inttypes.h>
+ #elif defined(__SCO__) || defined(__USLC__)
+ #include <stdint.h>
+-#elif defined(__UNIXOS2__) || defined(__SOL64__)
++#elif defined(__UNIXOS2__)
+ typedef long int int32_t;
+ typedef long long int int64_t;
+ typedef unsigned long long int uint64_t;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/wxwidgets-03-changeset_r61009.diff	Sun Jun 06 10:37:12 2010 +0000
@@ -0,0 +1,16 @@
+--- wxWidgets-2.8.10-orig/src/gtk/gsockgtk.cpp	2009-03-06 12:11:40.000000000 +0000
++++ wxWidgets-2.8.10/src/gtk/gsockgtk.cpp	2010-06-04 08:23:48.380627757 +0000
+@@ -15,8 +15,13 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ 
++// newer versions of glib define its own GSocket but we unfortunately use this
++// name in our own (semi-)public header and so can't change it -- rename glib
++// one instead
++#define GSocket GlibGSocket
+ #include <gdk/gdk.h>
+ #include <glib.h>
++#undef GSocket
+ 
+ #include "wx/gsocket.h"
+ #include "wx/unix/gsockunx.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/wxwidgets-04-wxFileName-ticket-4697.diff	Sun Jun 06 10:37:12 2010 +0000
@@ -0,0 +1,11 @@
+--- wxWidgets-2.8.10-orig/include/wx/filename.h	2009-03-06 12:10:52.000000000 +0000
++++ wxWidgets-2.8.10/include/wx/filename.h	2010-06-06 00:40:18.676144021 +0000
+@@ -390,7 +390,7 @@
+ 
+     // get the canonical path separator for this format
+     static wxChar GetPathSeparator(wxPathFormat format = wxPATH_NATIVE)
+-        { return GetPathSeparators(format)[0u]; }
++        { return GetPathSeparators(format)[static_cast<size_t>(0)]; }
+ 
+     // is the char a path separator for this format?
+     static bool IsPathSeparator(wxChar ch, wxPathFormat format = wxPATH_NATIVE);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/wxwidgets-05-setup.h.in.diff	Sun Jun 06 10:37:12 2010 +0000
@@ -0,0 +1,60 @@
+--- wxWidgets-2.8.10-orig/setup.h.in	2009-03-06 12:10:54.000000000 +0000
++++ wxWidgets-2.8.10/setup.h.in	2010-06-06 01:04:49.534713313 +0000
+@@ -937,34 +937,57 @@
+ #undef HAVE_VSSCANF
+ 
+ /* The number of bytes in a char.  */
++#ifndef SIZEOF_CHAR
+ #undef SIZEOF_CHAR
++#endif
+ 
+ /* The number of bytes in a wchar_t.  */
++#ifndef SIZEOF_WCHAR_T
+ #undef SIZEOF_WCHAR_T
++#endif
+ 
++/* Since the sizeof stuff is different in 32 bit and 64 bit builds, it
++   is necessary to specify these SIZEOF_STUFF defines on the command line
++   when building stuff that uses wxwidgets. */
+ /* The number of bytes in a int.  */
++#ifndef SIZEOF_INT
+ #undef SIZEOF_INT
++#endif
+ 
+ /* The number of bytes in a pointer.  */
++#ifndef SIZEOF_VOID_P
+ #undef SIZEOF_VOID_P
++#endif
+ 
+ /* The number of bytes in a long.  */
++#ifndef SIZEOF_LONG
+ #undef SIZEOF_LONG
++#endif
+ 
+ /* The number of bytes in a long long.  */
++#ifndef SIZEOF_LONG_LONG
+ #undef SIZEOF_LONG_LONG
++#endif
+ 
+ /* The number of bytes in a short.  */
++#ifndef SIZEOF_SHORT
+ #undef SIZEOF_SHORT
++#endif
+ 
+ /* The number of bytes in a size_t.  */
++#ifndef SIZEOF_SIZE_T
+ #undef SIZEOF_SIZE_T
++#endif
+ 
+ /* Define if size_t on your machine is the same type as unsigned int. */
++#ifndef wxSIZE_T_IS_UINT
+ #undef wxSIZE_T_IS_UINT
++#endif
+ 
+ /* Define if size_t on your machine is the same type as unsigned long. */
++#ifndef wxSIZE_T_IS_ULONG
+ #undef wxSIZE_T_IS_ULONG
++#endif
+ 
+ /* Define if you have the dlopen function.  */
+ #undef HAVE_DLOPEN