tiff.spec 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. ##
  2. ## tiff.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: tiff
  26. Summary: Tag Image File Format (TIFF) Image Library
  27. URL: http://www.remotesensing.org/libtiff/
  28. Vendor: Sam Leffler
  29. Packager: OpenPKG
  30. Distribution: OpenPKG
  31. Class: BASE
  32. Group: Graphics
  33. License: GPL
  34. Version: 3.8.0
  35. Release: 20060111
  36. # package options
  37. %option with_cxx no
  38. # list of sources
  39. Source0: ftp://ftp.remotesensing.org/pub/libtiff/tiff-%{version}.tar.gz
  40. # build information
  41. Prefix: %{l_prefix}
  42. BuildRoot: %{l_buildroot}
  43. BuildPreReq: OpenPKG, openpkg >= 20040130, make
  44. PreReq: OpenPKG, openpkg >= 20040130
  45. BuildPreReq: jpeg, zlib
  46. PreReq: jpeg, zlib
  47. %if "%{with_cxx}" == "yes"
  48. BuildPreReq: gcc
  49. PreReq: gcc
  50. %endif
  51. AutoReq: no
  52. AutoReqProv: no
  53. %description
  54. Tag Image File Format (TIFF) is a widely used format for storing
  55. Timage data. he library, along with associated tool programs, should
  56. Thandle most of your needs for reading and writing TIFF images.
  57. %track
  58. prog tiff = {
  59. version = %{version}
  60. url = ftp://ftp.remotesensing.org/pub/libtiff/
  61. regex = tiff-((\d+\.)*\d+)\.tar\.gz
  62. }
  63. %prep
  64. %setup -q
  65. %{l_shtool} subst \
  66. -e 's;== "x";= "x";' \
  67. -e 's;enable_c++;enable_cxx;' \
  68. -e 's;\[^-_$as_cr_alnum];[^+-_$as_cr_alnum];' \
  69. -e 's;\(echo \$ac_feature | sed \)\(.\)\([^\`]*\);\1\2\3 | sed \2s/+/x/g\2;g' \
  70. -e '/LINENO: error: C[+]* preprocessor/{N;N;N;N;s/.*/:/;}' \
  71. configure
  72. %build
  73. %if "%{with_cxx}" == "yes"
  74. # conditionally build libtiff_cxx with C++ streams
  75. CC="%{l_cc}" \
  76. CXX="%{l_cxx}" \
  77. CFLAGS="%{l_cflags -O}" \
  78. CXXFLAGS="%{l_cxxflags -O}" \
  79. CPPFLAGS="%{l_cppflags}" \
  80. LDFLAGS="%{l_ldflags}" \
  81. ./configure \
  82. --prefix=%{l_prefix} \
  83. --includedir=%{l_prefix}/include/tiff \
  84. --disable-shared \
  85. --enable-static \
  86. --enable-c++ \
  87. --with-zlib-include-dir=%{l_prefix}/include \
  88. --with-zlib-lib-dir=%{l_prefix}/lib \
  89. --with-jpeg-include-dir=%{l_prefix}/include \
  90. --with-jpeg-lib-dir=%{l_prefix}/lib \
  91. --without-x
  92. %{l_make} %{l_mflags -O}
  93. # save C++ library for later installation, and clean out the rest
  94. %{l_shtool} mkdir -f -p -m 755 tmpcxx/.libs
  95. mv libtiff/.libs/libtiff.a tmpcxx/.libs/libtiff_cxx.a
  96. mv libtiff/.libs/libtiff.lai tmpcxx/.libs/libtiff_cxx.lai
  97. mv libtiff/libtiff.la tmpcxx/libtiff_cxx.la
  98. ln -s ../libtiff_cxx.la tmpcxx/.libs/libtiff_cxx.la
  99. %{l_shtool} subst \
  100. -e 's;libtiff;libtiff_cxx;g' \
  101. tmpcxx/.libs/libtiff_cxx.lai \
  102. tmpcxx/.libs/libtiff_cxx.la
  103. %{l_make} %{l_mflags -O} distclean
  104. %endif
  105. # unconditionally build libtiff without C++ streams
  106. CC="%{l_cc}" \
  107. CXX="" \
  108. CFLAGS="%{l_cflags -O}" \
  109. CXXFLAGS="" \
  110. CPPFLAGS="%{l_cppflags}" \
  111. LDFLAGS="%{l_ldflags}" \
  112. ./configure \
  113. --prefix=%{l_prefix} \
  114. --includedir=%{l_prefix}/include/tiff \
  115. --disable-shared \
  116. --enable-static \
  117. --disable-c++ \
  118. --with-zlib-include-dir=%{l_prefix}/include \
  119. --with-zlib-include-dir=%{l_prefix}/include \
  120. --with-zlib-lib-dir=%{l_prefix}/lib \
  121. --with-jpeg-include-dir=%{l_prefix}/include \
  122. --with-jpeg-lib-dir=%{l_prefix}/lib \
  123. --without-x
  124. %{l_make} %{l_mflags -O}
  125. %install
  126. rm -rf $RPM_BUILD_ROOT
  127. %{l_make} %{l_mflags -O} install DESTDIR=$RPM_BUILD_ROOT
  128. %if "%{with_cxx}" == "yes"
  129. # conditionally install libtiff_cxx just like the Makefile does
  130. ( cd tmpcxx
  131. ../libtool --mode=install \
  132. `grep "^INSTALL =" ../libtiff/Makefile | %{l_shtool} subst -e 's;[^=]*= \(.*\)$;\1;'` \
  133. libtiff_cxx.la \
  134. $RPM_BUILD_ROOT%{l_prefix}/lib
  135. ) || exit $?
  136. %endif
  137. ( cd $RPM_BUILD_ROOT%{l_prefix}/man/man3
  138. for manpage in *.3tiff; do
  139. base=`echo $manpage | sed -e 's;\.3tiff$;;'`
  140. mv $base.3tiff $base.3
  141. done
  142. ) || exit $?
  143. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
  144. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  145. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  146. %files -f files
  147. %clean
  148. rm -rf $RPM_BUILD_ROOT