libdmtx-vl.spec 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
  2. %{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"] ')}
  3. %global ruby_arch %(ruby -rrbconfig -e 'puts Config::CONFIG["archdir"]')
  4. Name: libdmtx
  5. Summary: Library for working with Data Matrix 2D bar-codes
  6. Version: 0.7.2
  7. Release: 9%{?_dist_release}
  8. Group: System Environment/Libraries
  9. License: LGPLv2+
  10. URL: http://www.libdmtx.org/
  11. Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
  12. Patch0: %{name}-0.7.2-php54.patch
  13. Patch1: %{name}-0.7.2-ruby19.patch
  14. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
  15. BuildRequires: ImageMagick-devel
  16. # required for tests
  17. BuildRequires: SDL_image-devel
  18. BuildRequires: libGLU-devel
  19. BuildRequires: libpng-devel
  20. # language bindings
  21. BuildRequires: php5-devel
  22. BuildRequires: python-devel
  23. BuildRequires: ruby
  24. BuildRequires: ruby-devel
  25. #BuildRequires: java-1.6.0-devel
  26. %description
  27. libdmtx is open source software for reading and writing Data Matrix 2D
  28. bar-codes on Linux, Unix, OS X, Windows, and mobile devices. At its core
  29. libdmtx is a shared library, allowing C/C++ programs to use its capabilities
  30. without restrictions or overhead.
  31. The included utility programs, dmtxread and dmtxwrite, provide the official
  32. interface to libdmtx from the command line, and also serve as a good reference
  33. for programmers who wish to write their own programs that interact with
  34. libdmtx. All of the software in the libdmtx package is distributed under
  35. the LGPLv2 and can be used freely under these terms.
  36. %package devel
  37. Summary: Development files for %{name}
  38. Group: Development/Libraries
  39. Requires: %{name} = %{version}-%{release}
  40. %description devel
  41. The %{name}-devel package contains libraries and header files for
  42. developing applications that use %{name}.
  43. %package utils
  44. Summary: Utilities for %{name}
  45. Group: Applications/System
  46. Requires: %{name} = %{version}-%{release}
  47. %description utils
  48. The %{name}-utils package contains utilities that use %{name}.
  49. # language bindings
  50. %package -n php-libdmtx
  51. Summary: PHP bindings for %{name}
  52. Group: System Environment/Libraries
  53. License: GPLv2+
  54. Requires: %{name} = %{version}-%{release}
  55. Requires: php5
  56. %description -n php-libdmtx
  57. The php-%{name} package contains bindings for using %{name} from PHP.
  58. %package -n python-libdmtx
  59. Summary: Python bindings for %{name}
  60. Group: System Environment/Libraries
  61. Requires: %{name} = %{version}-%{release}
  62. %description -n python-libdmtx
  63. The python-%{name} package contains bindings for using %{name} from Python.
  64. %package -n ruby-libdmtx
  65. Summary: Ruby bindings for %{name}
  66. Group: System Environment/Libraries
  67. Requires: %{name} = %{version}-%{release}
  68. Provides: ruby(%{name}) = %{version}
  69. %description -n ruby-libdmtx
  70. The ruby-%{name} package contains bindings for using %{name} from Ruby.
  71. %prep
  72. %setup -q
  73. %patch0 -p1 -b .php54
  74. %patch1 -p1 -b .ruby19
  75. # fix permissions
  76. chmod a-x wrapper/{php,python}/README
  77. %build
  78. %configure --disable-static
  79. make %{?_smp_mflags}
  80. # temporary installation required by the language wrappers
  81. make install DESTDIR=/tmp
  82. # language wrappers must be built separately
  83. pushd wrapper
  84. pushd php
  85. phpize
  86. %configure --disable-static
  87. # Don't use rpath!
  88. sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
  89. sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
  90. make EXTRA_CFLAGS="-I/tmp%{_includedir}" DMTX_SHARED_LIBADD="-L/tmp%{_libdir} -ldmtx"
  91. popd
  92. pushd python
  93. # fix paths
  94. sed -i.orig -e "s|/usr/local/include|/tmp%{_includedir}|" -e "s|/usr/local/lib|/tmp%{_libdir}|" setup.py
  95. python setup.py build
  96. chmod 0755 build/lib.*/*.so
  97. popd
  98. pushd ruby
  99. ruby extconf.rb
  100. make CPPFLAGS="-I/tmp%{_includedir}" LIBPATH="-L/tmp%{_libdir} -ldmtx"
  101. popd
  102. #pushd java
  103. #make LIBDMTX_LA="/tmp%{_libdir}/libdmtx.so"
  104. #popd
  105. popd
  106. %install
  107. rm -rf $RPM_BUILD_ROOT
  108. make install DESTDIR=$RPM_BUILD_ROOT
  109. find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
  110. pushd wrapper
  111. pushd php
  112. make install INSTALL_ROOT=$RPM_BUILD_ROOT
  113. popd
  114. pushd python
  115. python setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
  116. popd
  117. pushd ruby
  118. make install RUBYARCHDIR=$RPM_BUILD_ROOT%{ruby_arch}
  119. popd
  120. #pushd java
  121. #popd
  122. popd
  123. %check
  124. make check
  125. pushd test
  126. for t in simple unit
  127. do
  128. ./${t}_test/${t}_test
  129. done
  130. popd
  131. %clean
  132. rm -rf $RPM_BUILD_ROOT
  133. %post -p /sbin/ldconfig
  134. %postun -p /sbin/ldconfig
  135. %files
  136. %defattr(-,root,root,-)
  137. %doc AUTHORS COPYING.LESSER ChangeLog KNOWNBUG NEWS README README.linux TODO
  138. %{_libdir}/%{name}.so.*
  139. %files devel
  140. %defattr(-,root,root,-)
  141. %doc
  142. %{_includedir}/*
  143. %{_libdir}/%{name}.so
  144. %{_libdir}/pkgconfig/%{name}.pc
  145. %{_mandir}/man3/%{name}.3*
  146. %files utils
  147. %defattr(-,root,root,-)
  148. %{_bindir}/dmtx*
  149. %{_mandir}/man1/dmtx*.1*
  150. %files -n php-libdmtx
  151. %defattr(-,root,root,-)
  152. %doc COPYING wrapper/php/README
  153. %{_libdir}/php5/*.so
  154. %files -n python-libdmtx
  155. %defattr(-,root,root,-)
  156. %doc wrapper/python/README
  157. %{python_sitearch}/*
  158. %files -n ruby-libdmtx
  159. %defattr(-,root,root,-)
  160. %doc wrapper/ruby/README
  161. %{ruby_arch}/*.so
  162. %changelog
  163. * Wed Jul 02 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.7.2-9
  164. - rebuild with ImageMagick-6.8.9.5
  165. * Wed Aug 14 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.7.2-8
  166. - rebuild with ImageMagick-6.8.6.8
  167. - add Patch0 (%%{name}-0.7.2-php54.patch) from fedora
  168. - add Patch1 (%%{name}-0.7.2-ruby19.patch) from fedora
  169. * Sun Mar 11 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.7.2-7
  170. - rebuild with ImageMagick-6.7.5.10
  171. * Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.7.2-6
  172. - rebuild with python-2.7.2
  173. * Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.2-4
  174. - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
  175. * Wed Nov 17 2010 Dan Horák <dan[at]danny.cz> 0.7.2-3
  176. - updated license for the php subpackage
  177. - run few tests
  178. * Sat May 29 2010 Dan Horák <dan[at]danny.cz> 0.7.2-2
  179. - added language bindigs
  180. * Wed Feb 3 2010 Dan Horák <dan[at]danny.cz> 0.7.2-1
  181. - initial Fedora version