mesa.spec 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. ##
  2. ## mesa.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  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: PLUS
  32. Group: XWindow
  33. License: LGPL
  34. Version: 6.5
  35. Release: 20061015
  36. # package options
  37. %option with_demos no
  38. # list of sources
  39. Source0: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaLib-%{version}.tar.bz2
  40. Source1: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaGLUT-%{version}.tar.bz2
  41. Source2: http://osdn.dl.sourceforge.net/sourceforge/mesa3d/MesaDemos-%{version}.tar.bz2
  42. Patch0: mesa.patch
  43. Patch1: mesa.patch.demos
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20040130, X11, gcc, make, autoconf
  48. PreReq: OpenPKG, openpkg >= 20040130, X11
  49. AutoReq: no
  50. AutoReqProv: no
  51. %description
  52. Mesa is a 3-D graphics library with an API which is very similar to
  53. that of OpenGL. To the extent that Mesa utilizes the OpenGL command
  54. syntax or state machine, it is being used with authorization from
  55. Silicon Graphics, Inc. (SGI).
  56. %track
  57. prog mesa:MesaLib = {
  58. version = %{version}
  59. url = http://prdownloads.sourceforge.net/mesa3d/
  60. regex = MesaLib-(6\.\d+)\.tar\.bz2
  61. }
  62. prog mesa:MesaGLUT = {
  63. version = %{version}
  64. url = http://prdownloads.sourceforge.net/mesa3d/
  65. regex = MesaGLUT-(6\.\d+)\.tar\.bz2
  66. }
  67. prog mesa:MesaDemos = {
  68. version = %{version}
  69. url = http://prdownloads.sourceforge.net/mesa3d/
  70. regex = MesaDemos-(6\.\d+)\.tar\.bz2
  71. }
  72. %prep
  73. %setup -q -n Mesa-%{version}
  74. %setup -q -n Mesa-%{version} -T -D -b 1
  75. %patch -p0
  76. %if "%{with_demos}" == "yes"
  77. %setup -q -n Mesa-%{version} -T -D -b 2
  78. chmod 644 progs/demos/glslnoise.c
  79. %patch -p0 -P 1
  80. %endif
  81. %{l_shtool} subst \
  82. -e "s;@l_x11bindir@;`%{l_rc} --query x11_bindir`;g" \
  83. configs/default
  84. %build
  85. case "%{l_platform -t}" in
  86. *-freebsd* ) plat="freebsd" ;;
  87. *-netbsd* ) plat="netbsd" ;;
  88. i?86*-linux* ) plat="linux-x86-static" ;;
  89. *-linux* ) plat="linux-static" ;;
  90. i?86*-sunos* ) plat="solaris-x86-gcc" ;;
  91. *-sunos* ) plat="sunos5-gcc" ;;
  92. * ) echo "platform %{l_platform -t} not supported" 2>&1; exit 1; ;;
  93. esac
  94. CC="%{l_cc}" \
  95. CXX="%{l_cxx}" \
  96. CFLAGS="%{l_cflags -O}" \
  97. CXXFLAGS="%{l_cxxflags -O}" \
  98. CPPFLAGS="%{l_cppflags}" \
  99. LDFLAGS="%{l_ldflags}" \
  100. X11LIB_DIR="`%{l_rc} --query x11_libdir`" \
  101. %{l_make} %{l_mflags} $plat
  102. %install
  103. rm -rf $RPM_BUILD_ROOT
  104. %{l_shtool} mkdir -f -p -m 755 \
  105. $RPM_BUILD_ROOT%{l_prefix}/lib \
  106. $RPM_BUILD_ROOT%{l_prefix}/include/GL
  107. %{l_shtool} install -c -m 644 \
  108. lib/* $RPM_BUILD_ROOT%{l_prefix}/lib/
  109. %{l_shtool} install -c -m 644 \
  110. include/GL/*.h $RPM_BUILD_ROOT%{l_prefix}/include/GL/
  111. %if "%{with_demos}" == "yes"
  112. %{l_shtool} mkdir -f -p -m 755 \
  113. $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/demos \
  114. $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/images
  115. %{l_shtool} install -s -c -m 755 \
  116. `find progs/demos/ -type f -prune -perm 755 -print` \
  117. `find progs/redbook/ -type f -prune -perm 755 -print` \
  118. `find progs/samples/ -type f -prune -perm 755 -print` \
  119. `find progs/xdemos/ -type f -prune -perm 755 -print` \
  120. $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/demos/
  121. %{l_shtool} install -c -m 644 \
  122. progs/images/* $RPM_BUILD_ROOT%{l_prefix}/lib/mesa/images/
  123. %endif
  124. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  125. %files -f files
  126. %clean
  127. rm -rf $RPM_BUILD_ROOT