cairo.spec 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. ##
  2. ## cairo.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 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: cairo
  26. Summary: Cairo Vector Graphics Library
  27. URL: http://cairographics.org/
  28. Vendor: Carl Worth & Keith Packard
  29. Packager: OpenPKG Foundation e.V.
  30. Distribution: OpenPKG Community
  31. Class: EVAL
  32. Group: Graphics
  33. License: MIT-style
  34. Version: 1.4.12
  35. Release: 20071127
  36. # package options
  37. %option with_pdf yes
  38. %option with_ps yes
  39. %option with_png yes
  40. %option with_x11 yes
  41. %option with_threads yes
  42. # list of sources
  43. Source0: http://cairographics.org/releases/cairo-%{version}.tar.gz
  44. Patch0: cairo.patch
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20040130, pkgconfig
  49. PreReq: OpenPKG, openpkg >= 20040130
  50. BuildPreReq: fontconfig, freetype
  51. PreReq: fontconfig, freetype
  52. %if "%{with_png}" == "yes"
  53. BuildPreReq: png >= 1.2.8-20050204, zlib
  54. PreReq: png >= 1.2.8-20050204, zlib
  55. %endif
  56. %if "%{with_ps}" == "yes"
  57. BuildPreReq: zlib
  58. PreReq: zlib
  59. %endif
  60. %if "%{with_x11}" == "yes"
  61. BuildPreReq: x11, xrender
  62. PreReq: x11, xrender
  63. %endif
  64. AutoReq: no
  65. AutoReqProv: no
  66. %description
  67. Cairo is a vector graphics library designed to provide high-quality
  68. display and print output. Currently supported output targets include
  69. the X Window System, OpenGL, in-memory image buffers, and image
  70. files (PNG and PostScript). Cairo is designed to produce identical
  71. output on all output media while taking advantage of display
  72. hardware acceleration when available. Cairo provides a stateful
  73. user-level API with capabilities similar to the PDF 1.4 imaging
  74. model. Cairo provides operations including stroking and filling
  75. Bezier cubic splines, transforming and compositing translucent
  76. images, and antialiased text rendering.
  77. %track
  78. prog cairo = {
  79. version = %{version}
  80. url = http://cairographics.org/releases/
  81. regex = \bcairo-(__VER__)\.tar\.gz
  82. }
  83. %prep
  84. %setup -q
  85. %patch -p0
  86. %build
  87. %{l_shtool} subst \
  88. -e 's;libpng12;libpng;g' \
  89. configure
  90. export CC="%{l_cc}"
  91. export CFLAGS="%{l_cflags -O}"
  92. export CPPFLAGS="%{l_cppflags}"
  93. export LDFLAGS="%{l_ldflags}"
  94. %if "%{with_x11}" == "yes"
  95. CPPFLAGS="$CPPFLAGS -I`%{l_rc} --query x11_incdir`"
  96. LDFLAGS="$LDFLAGS -L`%{l_rc} --query x11_libdir`"
  97. %endif
  98. %if "%{with_png}" == "yes"
  99. export PNG_CFLAGS="%{l_cppflags}"
  100. export PNG_LIBS="%{l_ldflags} -lpng -lz"
  101. %endif
  102. %if "%{with_threads}" != "yes"
  103. CPPFLAGS="$CPPFLAGS -DCAIRO_NO_MUTEX=1"
  104. %endif
  105. export PKG_CONFIG="%{l_prefix}/bin/pkg-config"
  106. ./configure \
  107. --cache-file=./config.cache \
  108. --prefix=%{l_prefix} \
  109. %if "%{with_png}" == "yes"
  110. --enable-png \
  111. %else
  112. --disable-png \
  113. %endif
  114. %if "%{with_pdf}" == "yes"
  115. --enable-pdf \
  116. %else
  117. --disable-pdf \
  118. %endif
  119. %if "%{with_ps}" == "yes"
  120. --enable-ps \
  121. %else
  122. --disable-ps \
  123. %endif
  124. %if "%{with_x11}" == "yes"
  125. --with-x \
  126. --x-includes=`%{l_rc} --query x11_incdir` \
  127. --x-libraries=`%{l_rc} --query x11_libdir` \
  128. --enable-xlib \
  129. %else
  130. --disable-xlib \
  131. %endif
  132. %if "%{with_threads}" == "yes"
  133. --enable-pthread \
  134. %else
  135. --disable-pthread \
  136. %endif
  137. --enable-freetype \
  138. --disable-xcb \
  139. --disable-gl \
  140. --disable-shared
  141. %{l_make} %{l_mflags -O}
  142. %install
  143. rm -rf $RPM_BUILD_ROOT
  144. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  145. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/gtk-doc
  146. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  147. %{l_files_std}
  148. %files -f files
  149. %clean
  150. rm -rf $RPM_BUILD_ROOT