mesa/mesa.spec

Tue, 28 Aug 2012 18:36:35 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:36:35 +0200
changeset 579
6b18bb69901e
parent 51
64165e101f08
child 616
1cbb05665045
permissions
-rw-r--r--

Correct the paths of patched scripts, refine password generation,
mitigate fdatasync(2) detection problems, correct dependencies, remove
outdated autoconf components, correct conf file paths and attributes,
complete and correct log file rotation handing, and note warnings
useful for diagnosing builds.

     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:  make, gcc, gcc::with_cxx = yes, autoconf, binutils
    52 BuildPreReq:  X11
    53 PreReq:       X11
    54 AutoReq:      no
    55 AutoReqProv:  no
    57 %description
    58     Mesa is a full-featured 3D graphics rendering library providing the
    59     official OpenGL 2.0 and OpenGL 2.1 APIs. A variety of device drivers
    60     allow Mesa to be used in many different environments ranging from
    61     software emulation to complete hardware acceleration for modern
    62     GPUs.
    64 %track
    65     prog mesa:MesaLib = {
    66         version   = %{version}
    67         url       = http://prdownloads.sourceforge.net/mesa3d/
    68         regex     = MesaLib-(7\.\d+(?:\.\d+)?)\.tar\.bz2
    69     }
    70     prog mesa:MesaGLUT = {
    71         version   = %{version}
    72         url       = http://prdownloads.sourceforge.net/mesa3d/
    73         regex     = MesaGLUT-(7\.\d+(?:\.\d+)?)\.tar\.bz2
    74     }
    75     prog mesa:MesaDemos = {
    76         version   = %{version}
    77         url       = http://prdownloads.sourceforge.net/mesa3d/
    78         regex     = MesaDemos-(7\.\d+(?:\.\d+)?)\.tar\.bz2
    79     }
    81 %prep
    82     #   announce exceptional build requirements
    83     ( echo "This package has exceptional storage requirements:"
    84       echo "  mesa-%{version}-root (500 Mo)"
    85       echo "  Mesa-%{version} (3,5 Go)"
    86       echo "  mesa-%{version}-<date>.<arch>-<os>-<tag>.rpm (200 Mo)"
    87     ) | %{l_rpmtool} msg -b -t notice
    89     %setup -q -n Mesa-%{version}
    90     %setup -q -n Mesa-%{version} -T -D -b 1
    91     %patch -p0
    92 %if "%{with_demos}" == "yes"
    93     %setup -q -n Mesa-%{version} -T -D -b 2
    94 %endif
    95     %{l_shtool} subst \
    96         -e "s;@l_x11bindir@;`%{l_rc} --query x11_bindir`;g" \
    97         configs/default
    98     %{l_shtool} subst \
    99         -e "s;^\(CC\ \ *=\).*;\1 %{l_cc};" \
   100         -e "s;^\(CXX\ \ *=\).*;\1 %{l_cxx};" \
   101         -e "s;^\(CFLAGS\ \ *=\)\(.*\);\1 %{l_cflags -O}\2;" \
   102         -e "s;^\(CXXFLAGS\ \ *=\)\(.*\);\1 %{l_cxxflags -O}\2;" \
   103         -e "s;^\(CPPFLAGS\ \ *=\)\(.*\);\1 %{l_cppflags}\2;" \
   104         -e "s;^\(LDFLAGS\ \ *=\)\(.*\);\1 %{l_ldflags}\2;" \
   105         configs/*
   106     %{l_shtool} subst \
   107         -e 's;^\(EXTRA_LIB_PATH\ *=.*\);\1 -L$(X11LIB_DIR);' \
   108         configs/*
   109     %{l_shtool} subst \
   110         -e "s;\.\./images/;%{l_prefix}/lib/mesa/images/;" \
   111         `find . -name '*.c' -o -name '*.cxx'`
   112     %{l_shtool} subst \
   113         -e 's;\(APP_LIB_DEPS *=.*-l\$(GL_LIB)\);\1 -lstdc++;' \
   114         configs/*
   116 %build
   117     case "%{l_platform -t}" in
   118         *-freebsd*   ) plat="freebsd"          ;;
   119         *-netbsd*    ) plat="netbsd"           ;;
   120         i?86*-linux* ) plat="linux-x86-static" ;;
   121         *-linux*     ) plat="linux-static"     ;;
   122         i?86*-sunos* ) plat="solaris-x86-gcc"  ;;
   123         *-sunos*     ) plat="sunos5-gcc"       ;;
   124         * ) echo "platform %{l_platform -t} not supported" 2>&1; exit 1; ;;
   125     esac
   127     #   begin building broken mesa build logic
   128     ( cd configs && rm -f current && ln -s $plat current )
   129     ( cd src
   130       CC="%{l_cc}" \
   131       CXX="%{l_cxx}" \
   132       CFLAGS="%{l_cflags -O}" \
   133       CXXFLAGS="%{l_cxxflags -O}" \
   134       CPPFLAGS="%{l_cppflags}" \
   135       LDFLAGS="%{l_ldflags}" \
   136       X11LIB_DIR="`%{l_rc} --query x11_libdir`" \
   137       %{l_make} %{l_mflags -O} \
   138           SHELL="%{l_bash}"
   139     ) || exit $?
   141     #   correct broken mesa archive logic
   142     %{l_shtool} mkdir -f -p -m 755 temphack
   143     ( cd temphack
   144       %{l_prefix}/bin/ar -x ../src/mesa/libglapi.a
   145       %{l_prefix}/bin/ar -x ../src/mesa/libmesa.a
   146       %{l_prefix}/bin/ar -d ../lib/libGL.a libglapi.a libmesa.a
   147       %{l_prefix}/bin/ar -ru ../lib/libGL.a *.o
   148     ) || exit $?
   150 %if "%{with_demos}" == "yes"
   151     #   continue building with corrected mesa library
   152     ( cd progs
   153       CC="%{l_cc}" \
   154       CXX="%{l_cxx}" \
   155       CFLAGS="%{l_cflags -O}" \
   156       CXXFLAGS="%{l_cxxflags -O}" \
   157       CPPFLAGS="%{l_cppflags}" \
   158       LDFLAGS="%{l_ldflags}" \
   159       X11LIB_DIR="`%{l_rc} --query x11_libdir`" \
   160       %{l_make} %{l_mflags -O} \
   161           SHELL="%{l_bash}"
   162     ) || exit $?
   163 %endif
   165 %install
   166     rm -rf $RPM_BUILD_ROOT
   167     %{l_shtool} mkdir -f -p -m 755 \
   168         $RPM_BUILD_ROOT%{l_prefix}/lib \
   169         $RPM_BUILD_ROOT%{l_prefix}/include/GL
   170     %{l_shtool} install -c -m 644 \
   171         lib/* $RPM_BUILD_ROOT%{l_prefix}/lib/
   172     %{l_shtool} install -c -m 644 \
   173         include/GL/*.h $RPM_BUILD_ROOT%{l_prefix}/include/GL/
   174 %if "%{with_demos}" == "yes"
   175     %{l_shtool} mkdir -f -p -m 755 \
   176         $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/demos \
   177         $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/images
   178     %{l_shtool} install -s -c -m 755 \
   179         `find progs/demos/ -type f -prune -perm 755 -print` \
   180         `find progs/redbook/ -type f -prune -perm 755 -print` \
   181         `find progs/samples/ -type f -prune -perm 755 -print` \
   182         `find progs/xdemos/ -type f -prune -perm 755 -print` \
   183         $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/demos/
   184     %{l_shtool} install -c -m 644 \
   185         progs/images/* $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/images/
   186 %endif
   187     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
   189 %files -f files
   191 %clean
   192     rm -rf $RPM_BUILD_ROOT

mercurial