mesa/mesa.spec

Thu, 08 Jan 2009 18:28:40 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 08 Jan 2009 18:28:40 +0100
changeset 45
d2954f86e9e6
parent 34
673ed164f8e5
child 51
64165e101f08
permissions
-rw-r--r--

Depend on sed, grep, and binutils, because libtool hard codes values.
This unfortunate dependency change is necessary because the main
program script calls helper tools from hard coded paths. Please
see /pfx/bin/libtool:77 for the example SED="/pfx/bin/sed".

michael@34 1 ##
michael@34 2 ## mesa.spec -- OpenPKG RPM Package Specification
michael@34 3 ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@34 4 ##
michael@34 5 ## Permission to use, copy, modify, and distribute this software for
michael@34 6 ## any purpose with or without fee is hereby granted, provided that
michael@34 7 ## the above copyright notice and this permission notice appear in all
michael@34 8 ## copies.
michael@34 9 ##
michael@34 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@34 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@34 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@34 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@34 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@34 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@34 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@34 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@34 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@34 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@34 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@34 21 ## SUCH DAMAGE.
michael@34 22 ##
michael@34 23
michael@34 24 # package information
michael@34 25 Name: mesa
michael@34 26 Summary: OpenGL Toolkit
michael@34 27 URL: http://www.mesa3d.org/
michael@34 28 Vendor: Brian Paul
michael@34 29 Packager: OpenPKG Foundation e.V.
michael@34 30 Distribution: OpenPKG Community
michael@34 31 Class: EVAL
michael@34 32 Group: XWindow
michael@34 33 License: LGPL
michael@34 34 Version: 7.2
michael@35 35 Release: 20090106
michael@34 36
michael@34 37 # package options
michael@34 38 %option with_demos no
michael@34 39
michael@34 40 # list of sources
michael@34 41 Source0: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaLib-%{version}.tar.bz2
michael@34 42 Source1: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaGLUT-%{version}.tar.bz2
michael@34 43 Source2: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaDemos-%{version}.tar.bz2
michael@34 44 Patch0: mesa.patch
michael@34 45
michael@34 46 # build information
michael@34 47 Prefix: %{l_prefix}
michael@34 48 BuildRoot: %{l_buildroot}
michael@34 49 BuildPreReq: OpenPKG, openpkg >= 20040130
michael@34 50 PreReq: OpenPKG, openpkg >= 20040130
michael@34 51 BuildPreReq: X11, gcc, make, autoconf, binutils
michael@34 52 PreReq: X11
michael@34 53 AutoReq: no
michael@34 54 AutoReqProv: no
michael@34 55
michael@34 56 %description
michael@34 57 Mesa is a full-featured 3D graphics rendering library providing the
michael@34 58 official OpenGL 2.0 and OpenGL 2.1 APIs. A variety of device drivers
michael@34 59 allow Mesa to be used in many different environments ranging from
michael@34 60 software emulation to complete hardware acceleration for modern
michael@34 61 GPUs.
michael@34 62
michael@34 63 %track
michael@34 64 prog mesa:MesaLib = {
michael@34 65 version = %{version}
michael@34 66 url = http://prdownloads.sourceforge.net/mesa3d/
michael@34 67 regex = MesaLib-(7\.\d+(?:\.\d+)?)\.tar\.bz2
michael@34 68 }
michael@34 69 prog mesa:MesaGLUT = {
michael@34 70 version = %{version}
michael@34 71 url = http://prdownloads.sourceforge.net/mesa3d/
michael@34 72 regex = MesaGLUT-(7\.\d+(?:\.\d+)?)\.tar\.bz2
michael@34 73 }
michael@34 74 prog mesa:MesaDemos = {
michael@34 75 version = %{version}
michael@34 76 url = http://prdownloads.sourceforge.net/mesa3d/
michael@34 77 regex = MesaDemos-(7\.\d+(?:\.\d+)?)\.tar\.bz2
michael@34 78 }
michael@34 79
michael@34 80 %prep
michael@34 81 # announce exceptional build requirements
michael@34 82 ( echo "This package has exceptional storage requirements:"
michael@34 83 echo " mesa-%{version}-root (500 Mo)"
michael@34 84 echo " Mesa-%{version} (3,5 Go)"
michael@34 85 echo " mesa-%{version}-<date>.<arch>-<os>-<tag>.rpm (200 Mo)"
michael@34 86 ) | %{l_rpmtool} msg -b -t notice
michael@34 87
michael@34 88 %setup -q -n Mesa-%{version}
michael@34 89 %setup -q -n Mesa-%{version} -T -D -b 1
michael@34 90 %patch -p0
michael@34 91 %if "%{with_demos}" == "yes"
michael@34 92 %setup -q -n Mesa-%{version} -T -D -b 2
michael@34 93 %endif
michael@34 94 %{l_shtool} subst \
michael@34 95 -e "s;@l_x11bindir@;`%{l_rc} --query x11_bindir`;g" \
michael@34 96 configs/default
michael@34 97 %{l_shtool} subst \
michael@34 98 -e "s;^\(CC\ \ *=\).*;\1 %{l_cc};" \
michael@34 99 -e "s;^\(CXX\ \ *=\).*;\1 %{l_cxx};" \
michael@34 100 -e "s;^\(CFLAGS\ \ *=\)\(.*\);\1 %{l_cflags -O}\2;" \
michael@34 101 -e "s;^\(CXXFLAGS\ \ *=\)\(.*\);\1 %{l_cxxflags -O}\2;" \
michael@34 102 -e "s;^\(CPPFLAGS\ \ *=\)\(.*\);\1 %{l_cppflags}\2;" \
michael@34 103 -e "s;^\(LDFLAGS\ \ *=\)\(.*\);\1 %{l_ldflags}\2;" \
michael@34 104 configs/*
michael@34 105 %{l_shtool} subst \
michael@34 106 -e 's;^\(EXTRA_LIB_PATH\ *=.*\);\1 -L$(X11LIB_DIR);' \
michael@34 107 configs/*
michael@34 108 %{l_shtool} subst \
michael@34 109 -e "s;\.\./images/;%{l_prefix}/lib/mesa/images/;" \
michael@35 110 `find . -name '*.c' -o -name '*.cxx'`
michael@34 111
michael@34 112 %build
michael@34 113 case "%{l_platform -t}" in
michael@34 114 *-freebsd* ) plat="freebsd" ;;
michael@34 115 *-netbsd* ) plat="netbsd" ;;
michael@34 116 i?86*-linux* ) plat="linux-x86-static" ;;
michael@34 117 *-linux* ) plat="linux-static" ;;
michael@34 118 i?86*-sunos* ) plat="solaris-x86-gcc" ;;
michael@34 119 *-sunos* ) plat="sunos5-gcc" ;;
michael@34 120 * ) echo "platform %{l_platform -t} not supported" 2>&1; exit 1; ;;
michael@34 121 esac
michael@34 122
michael@34 123 # begin building broken mesa build logic
michael@34 124 ( cd configs && rm -f current && ln -s $plat current )
michael@34 125 ( cd src
michael@34 126 CC="%{l_cc}" \
michael@34 127 CXX="%{l_cxx}" \
michael@34 128 CFLAGS="%{l_cflags -O}" \
michael@34 129 CXXFLAGS="%{l_cxxflags -O}" \
michael@34 130 CPPFLAGS="%{l_cppflags}" \
michael@34 131 LDFLAGS="%{l_ldflags}" \
michael@34 132 X11LIB_DIR="`%{l_rc} --query x11_libdir`" \
michael@34 133 %{l_make} %{l_mflags -O} \
michael@34 134 SHELL="%{l_bash}"
michael@34 135 ) || exit $?
michael@34 136
michael@34 137 # correct broken mesa archive logic
michael@34 138 %{l_shtool} mkdir -f -p -m 755 temphack
michael@34 139 ( cd temphack
michael@34 140 %{l_prefix}/bin/ar -x ../src/mesa/libglapi.a
michael@34 141 %{l_prefix}/bin/ar -x ../src/mesa/libmesa.a
michael@34 142 %{l_prefix}/bin/ar -d ../lib/libGL.a libglapi.a libmesa.a
michael@34 143 %{l_prefix}/bin/ar -ru ../lib/libGL.a *.o
michael@34 144 ) || exit $?
michael@34 145
michael@34 146 %if "%{with_demos}" == "yes"
michael@34 147 # continue building with corrected mesa library
michael@34 148 ( cd progs
michael@34 149 CC="%{l_cc}" \
michael@34 150 CXX="%{l_cxx}" \
michael@34 151 CFLAGS="%{l_cflags -O}" \
michael@34 152 CXXFLAGS="%{l_cxxflags -O}" \
michael@34 153 CPPFLAGS="%{l_cppflags}" \
michael@34 154 LDFLAGS="%{l_ldflags}" \
michael@34 155 X11LIB_DIR="`%{l_rc} --query x11_libdir`" \
michael@34 156 %{l_make} %{l_mflags -O} \
michael@34 157 SHELL="%{l_bash}"
michael@34 158 ) || exit $?
michael@34 159 %endif
michael@34 160
michael@34 161 %install
michael@34 162 rm -rf $RPM_BUILD_ROOT
michael@34 163 %{l_shtool} mkdir -f -p -m 755 \
michael@34 164 $RPM_BUILD_ROOT%{l_prefix}/lib \
michael@34 165 $RPM_BUILD_ROOT%{l_prefix}/include/GL
michael@34 166 %{l_shtool} install -c -m 644 \
michael@34 167 lib/* $RPM_BUILD_ROOT%{l_prefix}/lib/
michael@34 168 %{l_shtool} install -c -m 644 \
michael@34 169 include/GL/*.h $RPM_BUILD_ROOT%{l_prefix}/include/GL/
michael@34 170 %if "%{with_demos}" == "yes"
michael@34 171 %{l_shtool} mkdir -f -p -m 755 \
michael@34 172 $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/demos \
michael@34 173 $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/images
michael@34 174 %{l_shtool} install -s -c -m 755 \
michael@34 175 `find progs/demos/ -type f -prune -perm 755 -print` \
michael@34 176 `find progs/redbook/ -type f -prune -perm 755 -print` \
michael@34 177 `find progs/samples/ -type f -prune -perm 755 -print` \
michael@34 178 `find progs/xdemos/ -type f -prune -perm 755 -print` \
michael@34 179 $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/demos/
michael@34 180 %{l_shtool} install -c -m 644 \
michael@34 181 progs/images/* $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/images/
michael@34 182 %endif
michael@34 183 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
michael@34 184
michael@34 185 %files -f files
michael@34 186
michael@34 187 %clean
michael@34 188 rm -rf $RPM_BUILD_ROOT
michael@34 189

mercurial