cairo.spec 4.5 KB

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