cairo.spec 4.8 KB

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