tiff.spec 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. ##
  2. ## tiff.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2017 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package information
  24. Name: tiff
  25. Summary: Tag Image File Format (TIFF) Image Library
  26. URL: http://simplesystems.org/libtiff/
  27. Vendor: Sam Leffler
  28. Packager: OpenPKG Foundation e.V.
  29. Distribution: OpenPKG Community
  30. Class: BASE
  31. Group: Graphics
  32. License: GPL
  33. Version: 4.0.9
  34. Release: 20171119
  35. # package options
  36. %option with_cxx no
  37. # list of sources
  38. Source0: ftp://download.osgeo.org/libtiff/tiff-%{version}.tar.gz
  39. # build information
  40. BuildPreReq: OpenPKG, openpkg >= 20160101, make
  41. PreReq: OpenPKG, openpkg >= 20160101
  42. BuildPreReq: jpeg, zlib
  43. PreReq: jpeg, zlib
  44. %if "%{with_cxx}" == "yes"
  45. BuildPreReq: gcc
  46. PreReq: gcc
  47. %endif
  48. %description
  49. Tag Image File Format (TIFF) is a widely used format for storing
  50. Timage data. he library, along with associated tool programs, should
  51. Thandle most of your needs for reading and writing TIFF images.
  52. %track
  53. prog tiff = {
  54. version = %{version}
  55. url = ftp://download.osgeo.org/libtiff/
  56. regex = tiff-((\d+\.)*\d+)\.tar\.gz
  57. }
  58. %prep
  59. %setup -q
  60. %{l_shtool} subst \
  61. -e 's;== "x";= "x";' \
  62. -e 's;\[^-_$as_cr_alnum];[^+-_$as_cr_alnum];' \
  63. -e 's;\(echo \$ac_feature | sed \)\(.\)\([^\`]*\);\1\2\3 | sed \2s/+/x/g\2;g' \
  64. -e '/LINENO: error: C[+]* preprocessor/{N;N;N;N;s/.*/:/;}' \
  65. configure
  66. %build
  67. %if "%{with_cxx}" == "yes"
  68. # conditionally build libtiff_cxx with C++ streams
  69. CC="%{l_cc}" \
  70. CXX="%{l_cxx}" \
  71. CFLAGS="%{l_cflags -O}" \
  72. CXXFLAGS="%{l_cxxflags -O}" \
  73. CPPFLAGS="%{l_cppflags}" \
  74. LDFLAGS="%{l_ldflags}" \
  75. ./configure \
  76. --prefix=%{l_prefix} \
  77. --includedir=%{l_prefix}/include/tiff \
  78. --disable-shared \
  79. --enable-static \
  80. --enable-cxx \
  81. --with-zlib-include-dir=%{l_prefix}/include \
  82. --with-zlib-lib-dir=%{l_prefix}/lib \
  83. --with-jpeg-include-dir=%{l_prefix}/include \
  84. --with-jpeg-lib-dir=%{l_prefix}/lib \
  85. --disable-lzma \
  86. --without-x
  87. %{l_make} %{l_mflags -O}
  88. # save C++ library for later installation, and clean out the rest
  89. %{l_shtool} mkdir -f -p -m 755 tmpcxx/.libs
  90. mv libtiff/.libs/libtiff.a tmpcxx/.libs/libtiff_cxx.a
  91. mv libtiff/.libs/libtiff.lai tmpcxx/.libs/libtiff_cxx.lai
  92. mv libtiff/libtiff.la tmpcxx/libtiff_cxx.la
  93. ln -s ../libtiff_cxx.la tmpcxx/.libs/libtiff_cxx.la
  94. %{l_shtool} subst \
  95. -e 's;libtiff;libtiff_cxx;g' \
  96. tmpcxx/.libs/libtiff_cxx.lai \
  97. tmpcxx/.libs/libtiff_cxx.la
  98. %{l_make} %{l_mflags -O} distclean
  99. %endif
  100. # unconditionally build libtiff without C++ streams
  101. CC="%{l_cc}" \
  102. CXX="" \
  103. CFLAGS="%{l_cflags -O}" \
  104. CXXFLAGS="" \
  105. CPPFLAGS="%{l_cppflags}" \
  106. LDFLAGS="%{l_ldflags}" \
  107. ./configure \
  108. --prefix=%{l_prefix} \
  109. --mandir=%{l_prefix}/man \
  110. --includedir=%{l_prefix}/include/tiff \
  111. --disable-shared \
  112. --enable-static \
  113. --disable-cxx \
  114. --with-zlib-include-dir=%{l_prefix}/include \
  115. --with-zlib-include-dir=%{l_prefix}/include \
  116. --with-zlib-lib-dir=%{l_prefix}/lib \
  117. --with-jpeg-include-dir=%{l_prefix}/include \
  118. --with-jpeg-lib-dir=%{l_prefix}/lib \
  119. --disable-lzma \
  120. --without-x
  121. %{l_make} %{l_mflags -O}
  122. %install
  123. %{l_make} %{l_mflags -O} install DESTDIR=$RPM_BUILD_ROOT
  124. %if "%{with_cxx}" == "yes"
  125. # conditionally install libtiff_cxx just like the Makefile does
  126. ( cd tmpcxx
  127. ../libtool --mode=install \
  128. `grep "^INSTALL =" ../libtiff/Makefile | %{l_shtool} subst -e 's;[^=]*= \(.*\)$;\1;'` \
  129. libtiff_cxx.la \
  130. $RPM_BUILD_ROOT%{l_prefix}/lib
  131. ) || exit $?
  132. %endif
  133. ( cd $RPM_BUILD_ROOT%{l_prefix}/man/man3
  134. for manpage in *.3tiff; do
  135. base=`echo $manpage | sed -e 's;\.3tiff$;;'`
  136. mv $base.3tiff $base.3
  137. done
  138. ) || exit $?
  139. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
  140. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  141. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  142. %files -f files
  143. %clean