diff -r fa4856f209c2 -r 673ed164f8e5 mesa/mesa.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mesa/mesa.spec Thu Jan 08 10:18:50 2009 +0100 @@ -0,0 +1,189 @@ +## +## mesa.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2008 OpenPKG Foundation e.V. +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +# package information +Name: mesa +Summary: OpenGL Toolkit +URL: http://www.mesa3d.org/ +Vendor: Brian Paul +Packager: OpenPKG Foundation e.V. +Distribution: OpenPKG Community +Class: EVAL +Group: XWindow +License: LGPL +Version: 7.2 +Release: 20081126 + +# package options +%option with_demos no + +# list of sources +Source0: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaLib-%{version}.tar.bz2 +Source1: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaGLUT-%{version}.tar.bz2 +Source2: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaDemos-%{version}.tar.bz2 +Patch0: mesa.patch + +# build information +Prefix: %{l_prefix} +BuildRoot: %{l_buildroot} +BuildPreReq: OpenPKG, openpkg >= 20040130 +PreReq: OpenPKG, openpkg >= 20040130 +BuildPreReq: X11, gcc, make, autoconf, binutils +PreReq: X11 +AutoReq: no +AutoReqProv: no + +%description + Mesa is a full-featured 3D graphics rendering library providing the + official OpenGL 2.0 and OpenGL 2.1 APIs. A variety of device drivers + allow Mesa to be used in many different environments ranging from + software emulation to complete hardware acceleration for modern + GPUs. + +%track + prog mesa:MesaLib = { + version = %{version} + url = http://prdownloads.sourceforge.net/mesa3d/ + regex = MesaLib-(7\.\d+(?:\.\d+)?)\.tar\.bz2 + } + prog mesa:MesaGLUT = { + version = %{version} + url = http://prdownloads.sourceforge.net/mesa3d/ + regex = MesaGLUT-(7\.\d+(?:\.\d+)?)\.tar\.bz2 + } + prog mesa:MesaDemos = { + version = %{version} + url = http://prdownloads.sourceforge.net/mesa3d/ + regex = MesaDemos-(7\.\d+(?:\.\d+)?)\.tar\.bz2 + } + +%prep + # announce exceptional build requirements + ( echo "This package has exceptional storage requirements:" + echo " mesa-%{version}-root (500 Mo)" + echo " Mesa-%{version} (3,5 Go)" + echo " mesa-%{version}-.--.rpm (200 Mo)" + ) | %{l_rpmtool} msg -b -t notice + + %setup -q -n Mesa-%{version} + %setup -q -n Mesa-%{version} -T -D -b 1 + %patch -p0 +%if "%{with_demos}" == "yes" + %setup -q -n Mesa-%{version} -T -D -b 2 +%endif + %{l_shtool} subst \ + -e "s;@l_x11bindir@;`%{l_rc} --query x11_bindir`;g" \ + configs/default + %{l_shtool} subst \ + -e "s;^\(CC\ \ *=\).*;\1 %{l_cc};" \ + -e "s;^\(CXX\ \ *=\).*;\1 %{l_cxx};" \ + -e "s;^\(CFLAGS\ \ *=\)\(.*\);\1 %{l_cflags -O}\2;" \ + -e "s;^\(CXXFLAGS\ \ *=\)\(.*\);\1 %{l_cxxflags -O}\2;" \ + -e "s;^\(CPPFLAGS\ \ *=\)\(.*\);\1 %{l_cppflags}\2;" \ + -e "s;^\(LDFLAGS\ \ *=\)\(.*\);\1 %{l_ldflags}\2;" \ + configs/* + %{l_shtool} subst \ + -e 's;^\(EXTRA_LIB_PATH\ *=.*\);\1 -L$(X11LIB_DIR);' \ + configs/* + %{l_shtool} subst \ + -e "s;\.\./images/;%{l_prefix}/lib/mesa/images/;" \ + `find . -name '*.c' -or -name '*.cxx'` + +%build + case "%{l_platform -t}" in + *-freebsd* ) plat="freebsd" ;; + *-netbsd* ) plat="netbsd" ;; + i?86*-linux* ) plat="linux-x86-static" ;; + *-linux* ) plat="linux-static" ;; + i?86*-sunos* ) plat="solaris-x86-gcc" ;; + *-sunos* ) plat="sunos5-gcc" ;; + * ) echo "platform %{l_platform -t} not supported" 2>&1; exit 1; ;; + esac + + # begin building broken mesa build logic + ( cd configs && rm -f current && ln -s $plat current ) + ( cd src + CC="%{l_cc}" \ + CXX="%{l_cxx}" \ + CFLAGS="%{l_cflags -O}" \ + CXXFLAGS="%{l_cxxflags -O}" \ + CPPFLAGS="%{l_cppflags}" \ + LDFLAGS="%{l_ldflags}" \ + X11LIB_DIR="`%{l_rc} --query x11_libdir`" \ + %{l_make} %{l_mflags -O} \ + SHELL="%{l_bash}" + ) || exit $? + + # correct broken mesa archive logic + %{l_shtool} mkdir -f -p -m 755 temphack + ( cd temphack + %{l_prefix}/bin/ar -x ../src/mesa/libglapi.a + %{l_prefix}/bin/ar -x ../src/mesa/libmesa.a + %{l_prefix}/bin/ar -d ../lib/libGL.a libglapi.a libmesa.a + %{l_prefix}/bin/ar -ru ../lib/libGL.a *.o + ) || exit $? + +%if "%{with_demos}" == "yes" + # continue building with corrected mesa library + ( cd progs + CC="%{l_cc}" \ + CXX="%{l_cxx}" \ + CFLAGS="%{l_cflags -O}" \ + CXXFLAGS="%{l_cxxflags -O}" \ + CPPFLAGS="%{l_cppflags}" \ + LDFLAGS="%{l_ldflags}" \ + X11LIB_DIR="`%{l_rc} --query x11_libdir`" \ + %{l_make} %{l_mflags -O} \ + SHELL="%{l_bash}" + ) || exit $? +%endif + +%install + rm -rf $RPM_BUILD_ROOT + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/lib \ + $RPM_BUILD_ROOT%{l_prefix}/include/GL + %{l_shtool} install -c -m 644 \ + lib/* $RPM_BUILD_ROOT%{l_prefix}/lib/ + %{l_shtool} install -c -m 644 \ + include/GL/*.h $RPM_BUILD_ROOT%{l_prefix}/include/GL/ +%if "%{with_demos}" == "yes" + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/demos \ + $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/images + %{l_shtool} install -s -c -m 755 \ + `find progs/demos/ -type f -prune -perm 755 -print` \ + `find progs/redbook/ -type f -prune -perm 755 -print` \ + `find progs/samples/ -type f -prune -perm 755 -print` \ + `find progs/xdemos/ -type f -prune -perm 755 -print` \ + $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/demos/ + %{l_shtool} install -c -m 644 \ + progs/images/* $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/images/ +%endif + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} + +%files -f files + +%clean + rm -rf $RPM_BUILD_ROOT +