1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mesa/mesa.spec Thu Jan 08 10:18:50 2009 +0100 1.3 @@ -0,0 +1,189 @@ 1.4 +## 1.5 +## mesa.spec -- OpenPKG RPM Package Specification 1.6 +## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> 1.7 +## 1.8 +## Permission to use, copy, modify, and distribute this software for 1.9 +## any purpose with or without fee is hereby granted, provided that 1.10 +## the above copyright notice and this permission notice appear in all 1.11 +## copies. 1.12 +## 1.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 1.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 1.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 1.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 1.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 1.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 1.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1.24 +## SUCH DAMAGE. 1.25 +## 1.26 + 1.27 +# package information 1.28 +Name: mesa 1.29 +Summary: OpenGL Toolkit 1.30 +URL: http://www.mesa3d.org/ 1.31 +Vendor: Brian Paul 1.32 +Packager: OpenPKG Foundation e.V. 1.33 +Distribution: OpenPKG Community 1.34 +Class: EVAL 1.35 +Group: XWindow 1.36 +License: LGPL 1.37 +Version: 7.2 1.38 +Release: 20081126 1.39 + 1.40 +# package options 1.41 +%option with_demos no 1.42 + 1.43 +# list of sources 1.44 +Source0: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaLib-%{version}.tar.bz2 1.45 +Source1: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaGLUT-%{version}.tar.bz2 1.46 +Source2: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaDemos-%{version}.tar.bz2 1.47 +Patch0: mesa.patch 1.48 + 1.49 +# build information 1.50 +Prefix: %{l_prefix} 1.51 +BuildRoot: %{l_buildroot} 1.52 +BuildPreReq: OpenPKG, openpkg >= 20040130 1.53 +PreReq: OpenPKG, openpkg >= 20040130 1.54 +BuildPreReq: X11, gcc, make, autoconf, binutils 1.55 +PreReq: X11 1.56 +AutoReq: no 1.57 +AutoReqProv: no 1.58 + 1.59 +%description 1.60 + Mesa is a full-featured 3D graphics rendering library providing the 1.61 + official OpenGL 2.0 and OpenGL 2.1 APIs. A variety of device drivers 1.62 + allow Mesa to be used in many different environments ranging from 1.63 + software emulation to complete hardware acceleration for modern 1.64 + GPUs. 1.65 + 1.66 +%track 1.67 + prog mesa:MesaLib = { 1.68 + version = %{version} 1.69 + url = http://prdownloads.sourceforge.net/mesa3d/ 1.70 + regex = MesaLib-(7\.\d+(?:\.\d+)?)\.tar\.bz2 1.71 + } 1.72 + prog mesa:MesaGLUT = { 1.73 + version = %{version} 1.74 + url = http://prdownloads.sourceforge.net/mesa3d/ 1.75 + regex = MesaGLUT-(7\.\d+(?:\.\d+)?)\.tar\.bz2 1.76 + } 1.77 + prog mesa:MesaDemos = { 1.78 + version = %{version} 1.79 + url = http://prdownloads.sourceforge.net/mesa3d/ 1.80 + regex = MesaDemos-(7\.\d+(?:\.\d+)?)\.tar\.bz2 1.81 + } 1.82 + 1.83 +%prep 1.84 + # announce exceptional build requirements 1.85 + ( echo "This package has exceptional storage requirements:" 1.86 + echo " mesa-%{version}-root (500 Mo)" 1.87 + echo " Mesa-%{version} (3,5 Go)" 1.88 + echo " mesa-%{version}-<date>.<arch>-<os>-<tag>.rpm (200 Mo)" 1.89 + ) | %{l_rpmtool} msg -b -t notice 1.90 + 1.91 + %setup -q -n Mesa-%{version} 1.92 + %setup -q -n Mesa-%{version} -T -D -b 1 1.93 + %patch -p0 1.94 +%if "%{with_demos}" == "yes" 1.95 + %setup -q -n Mesa-%{version} -T -D -b 2 1.96 +%endif 1.97 + %{l_shtool} subst \ 1.98 + -e "s;@l_x11bindir@;`%{l_rc} --query x11_bindir`;g" \ 1.99 + configs/default 1.100 + %{l_shtool} subst \ 1.101 + -e "s;^\(CC\ \ *=\).*;\1 %{l_cc};" \ 1.102 + -e "s;^\(CXX\ \ *=\).*;\1 %{l_cxx};" \ 1.103 + -e "s;^\(CFLAGS\ \ *=\)\(.*\);\1 %{l_cflags -O}\2;" \ 1.104 + -e "s;^\(CXXFLAGS\ \ *=\)\(.*\);\1 %{l_cxxflags -O}\2;" \ 1.105 + -e "s;^\(CPPFLAGS\ \ *=\)\(.*\);\1 %{l_cppflags}\2;" \ 1.106 + -e "s;^\(LDFLAGS\ \ *=\)\(.*\);\1 %{l_ldflags}\2;" \ 1.107 + configs/* 1.108 + %{l_shtool} subst \ 1.109 + -e 's;^\(EXTRA_LIB_PATH\ *=.*\);\1 -L$(X11LIB_DIR);' \ 1.110 + configs/* 1.111 + %{l_shtool} subst \ 1.112 + -e "s;\.\./images/;%{l_prefix}/lib/mesa/images/;" \ 1.113 + `find . -name '*.c' -or -name '*.cxx'` 1.114 + 1.115 +%build 1.116 + case "%{l_platform -t}" in 1.117 + *-freebsd* ) plat="freebsd" ;; 1.118 + *-netbsd* ) plat="netbsd" ;; 1.119 + i?86*-linux* ) plat="linux-x86-static" ;; 1.120 + *-linux* ) plat="linux-static" ;; 1.121 + i?86*-sunos* ) plat="solaris-x86-gcc" ;; 1.122 + *-sunos* ) plat="sunos5-gcc" ;; 1.123 + * ) echo "platform %{l_platform -t} not supported" 2>&1; exit 1; ;; 1.124 + esac 1.125 + 1.126 + # begin building broken mesa build logic 1.127 + ( cd configs && rm -f current && ln -s $plat current ) 1.128 + ( cd src 1.129 + CC="%{l_cc}" \ 1.130 + CXX="%{l_cxx}" \ 1.131 + CFLAGS="%{l_cflags -O}" \ 1.132 + CXXFLAGS="%{l_cxxflags -O}" \ 1.133 + CPPFLAGS="%{l_cppflags}" \ 1.134 + LDFLAGS="%{l_ldflags}" \ 1.135 + X11LIB_DIR="`%{l_rc} --query x11_libdir`" \ 1.136 + %{l_make} %{l_mflags -O} \ 1.137 + SHELL="%{l_bash}" 1.138 + ) || exit $? 1.139 + 1.140 + # correct broken mesa archive logic 1.141 + %{l_shtool} mkdir -f -p -m 755 temphack 1.142 + ( cd temphack 1.143 + %{l_prefix}/bin/ar -x ../src/mesa/libglapi.a 1.144 + %{l_prefix}/bin/ar -x ../src/mesa/libmesa.a 1.145 + %{l_prefix}/bin/ar -d ../lib/libGL.a libglapi.a libmesa.a 1.146 + %{l_prefix}/bin/ar -ru ../lib/libGL.a *.o 1.147 + ) || exit $? 1.148 + 1.149 +%if "%{with_demos}" == "yes" 1.150 + # continue building with corrected mesa library 1.151 + ( cd progs 1.152 + CC="%{l_cc}" \ 1.153 + CXX="%{l_cxx}" \ 1.154 + CFLAGS="%{l_cflags -O}" \ 1.155 + CXXFLAGS="%{l_cxxflags -O}" \ 1.156 + CPPFLAGS="%{l_cppflags}" \ 1.157 + LDFLAGS="%{l_ldflags}" \ 1.158 + X11LIB_DIR="`%{l_rc} --query x11_libdir`" \ 1.159 + %{l_make} %{l_mflags -O} \ 1.160 + SHELL="%{l_bash}" 1.161 + ) || exit $? 1.162 +%endif 1.163 + 1.164 +%install 1.165 + rm -rf $RPM_BUILD_ROOT 1.166 + %{l_shtool} mkdir -f -p -m 755 \ 1.167 + $RPM_BUILD_ROOT%{l_prefix}/lib \ 1.168 + $RPM_BUILD_ROOT%{l_prefix}/include/GL 1.169 + %{l_shtool} install -c -m 644 \ 1.170 + lib/* $RPM_BUILD_ROOT%{l_prefix}/lib/ 1.171 + %{l_shtool} install -c -m 644 \ 1.172 + include/GL/*.h $RPM_BUILD_ROOT%{l_prefix}/include/GL/ 1.173 +%if "%{with_demos}" == "yes" 1.174 + %{l_shtool} mkdir -f -p -m 755 \ 1.175 + $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/demos \ 1.176 + $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/images 1.177 + %{l_shtool} install -s -c -m 755 \ 1.178 + `find progs/demos/ -type f -prune -perm 755 -print` \ 1.179 + `find progs/redbook/ -type f -prune -perm 755 -print` \ 1.180 + `find progs/samples/ -type f -prune -perm 755 -print` \ 1.181 + `find progs/xdemos/ -type f -prune -perm 755 -print` \ 1.182 + $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/demos/ 1.183 + %{l_shtool} install -c -m 644 \ 1.184 + progs/images/* $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/images/ 1.185 +%endif 1.186 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} 1.187 + 1.188 +%files -f files 1.189 + 1.190 +%clean 1.191 + rm -rf $RPM_BUILD_ROOT 1.192 +