libdmtx-vl.spec 5.5 KB

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