pdflib.spec 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. ##
  2. ## pdflib.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 version
  25. %define V_long 7.0.0
  26. %define V_comp 700
  27. # package information
  28. Name: pdflib
  29. Summary: Library for Generating PDF Documents
  30. URL: http://www.pdflib.de/
  31. Vendor: PDFlib GmbH
  32. Packager: OpenPKG
  33. Distribution: OpenPKG
  34. Class: BASE
  35. Group: Postscript
  36. License: PDFlib
  37. Version: %{V_long}
  38. Release: 20061010
  39. # list of sources
  40. Source0: http://www.pdflib.de/binaries/PDFlib/%{V_comp}/PDFlib-Lite-%{V_long}.tar.gz
  41. Patch0: pdflib.patch
  42. # build information
  43. Prefix: %{l_prefix}
  44. BuildRoot: %{l_buildroot}
  45. BuildPreReq: OpenPKG, openpkg >= 20040130, coreutils, make
  46. PreReq: OpenPKG, openpkg >= 20040130
  47. BuildPreReq: png, zlib, jpeg
  48. PreReq: png, zlib, jpeg
  49. AutoReq: no
  50. AutoReqProv: no
  51. %description
  52. PDFlib is the premier software component if you want to generate PDF
  53. on your server, convert text and graphics, or implement PDF output
  54. in your own products.
  55. %track
  56. prog pdflib = {
  57. version = %{version}
  58. url = http://www.pdflib.de/products/pdflib-family/pdflib-lite/
  59. regex = PDFlib-Lite-(__VER__)\.tar\.gz
  60. }
  61. %prep
  62. %setup -q -n PDFlib-Lite-%{V_long}
  63. rm -rf libs/png
  64. rm -rf libs/jpeg
  65. rm -rf libs/flate
  66. %patch -p0
  67. %{l_shtool} subst \
  68. -e 's;[ \t]*/usr/local/lib${libsuff};;g' \
  69. -e 's;[ \t]*-I/usr/local/include;;g' \
  70. -e 's;[ \t]*/usr/local/include;;g' \
  71. -e 's;[ \t]*-L/usr/local/lib;;g' \
  72. -e 's;[ \t]*/usr/local/lib;;g' \
  73. configure
  74. %build
  75. ECHO="%{l_prefix}/bin/gecho" \
  76. CC="%{l_cc}" \
  77. CFLAGS="%{l_cflags -O}" \
  78. INSTALL="%{l_shtool} install -c" \
  79. PNGLIBINC="%{l_cppflags libpng .}" \
  80. PNGLIBLINK="%{l_prefix}/lib/libpng.a" \
  81. JPEGLIBINC="%{l_cppflags}" \
  82. JPEGLIBLINK="%{l_prefix}/lib/libjpeg.a" \
  83. FLATELIBINC="%{l_cppflags}" \
  84. FLATELIBLINK="%{l_prefix}/lib/libz.a" \
  85. LDFLAGS="%{l_ldflags} -lpng -ljpeg -lz" \
  86. ./configure \
  87. --prefix=%{l_prefix} \
  88. --disable-shared
  89. %{l_make} %{l_mflags}
  90. %install
  91. rm -rf $RPM_BUILD_ROOT
  92. %{l_shtool} mkdir -f -p -m 755 \
  93. $RPM_BUILD_ROOT%{l_prefix}/bin \
  94. $RPM_BUILD_ROOT%{l_prefix}/lib \
  95. $RPM_BUILD_ROOT%{l_prefix}/include \
  96. $RPM_BUILD_ROOT%{l_prefix}/share/pdflib
  97. %{l_shtool} subst \
  98. -e 's;\($(LIBTOOL)\) \($(INSTALL_DATA)\);\1 --mode=install \2;' \
  99. libs/pdflib/Makefile
  100. %{l_make} %{l_mflags} install \
  101. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  102. exec_prefix=$RPM_BUILD_ROOT%{l_prefix} \
  103. INSTALL="%{l_shtool} install -c"
  104. %{l_shtool} subst \
  105. -e 's;installed=no;installed=yes;' \
  106. -e 's;libdir=.*;libdir="%{l_prefix}/lib";' \
  107. $RPM_BUILD_ROOT%{l_prefix}/lib/libpdf.la
  108. %{l_shtool} install -c -s -m 755 \
  109. progs/pdflib/pdfimage \
  110. progs/pdflib/pdfimpose \
  111. progs/pdflib/text2pdf \
  112. $RPM_BUILD_ROOT%{l_prefix}/bin/
  113. %{l_shtool} install -c -m 644 \
  114. doc/pdflib/PDFlib-API-reference.pdf \
  115. doc/pdflib/PDFlib-tutorial.pdf \
  116. $RPM_BUILD_ROOT%{l_prefix}/share/pdflib/
  117. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  118. %{l_files_std} \
  119. '%doc %{l_prefix}/share/pdflib/*'
  120. %files -f files
  121. %clean
  122. rm -rf $RPM_BUILD_ROOT