mesa/mesa.spec

Fri, 09 Jan 2009 00:17:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 09 Jan 2009 00:17:00 +0100
changeset 51
64165e101f08
parent 35
f9bd3f5f28c7
child 85
e6a1cd7ed6ba
permissions
-rw-r--r--

Correct for mixed usage of ISO C and ISO C++ language constructs.

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

mercurial