5 %bcond_with ruby # build Ruby bindings
6 %bcond_without python # build Python2 bindings
7 %bcond_without php # build PHP bindings
8 %bcond_without tests # build without tests
10 Summary: Library for working with Data Matrix 2D bar-codes
16 Source0: http://downloads.sourceforge.net/libdmtx/%{name}-%{version}.tar.bz2
17 # Source0-md5: 0684cf3857591e777b57248d652444ae
18 URL: http://www.libdmtx.org/
19 BuildRequires: ImageMagick-devel
20 BuildRequires: pkgconfig
21 BuildRequires: python-modules
22 BuildRequires: rpm-pythonprov
23 BuildRequires: rpmbuild(macros) >= 1.219
25 BuildRequires: OpenGL-GLU-devel
26 BuildRequires: SDL_image-devel
27 BuildRequires: libpng-devel
30 BuildRequires: %{php_name}-devel
33 BuildRequires: python-devel
37 BuildRequires: ruby-devel
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42 libdmtx is open source software for reading and writing Data Matrix 2D
43 bar-codes on Linux, Unix, OS X, Windows, and mobile devices. At its
44 core libdmtx is a shared library, allowing C/C++ programs to use its
45 capabilities without restrictions or overhead.
47 The included utility programs, dmtxread and dmtxwrite, provide the
48 official interface to libdmtx from the command line, and also serve as
49 a good reference for programmers who wish to write their own programs
50 that interact with libdmtx.
53 Summary: Development files for %{name}
54 Group: Development/Libraries
55 Requires: %{name} = %{version}-%{release}
58 The %{name}-devel package contains libraries and header files for
59 developing applications that use %{name}.
62 Summary: Utilities for %{name}
63 Group: Applications/System
64 Requires: %{name} = %{version}-%{release}
67 The %{name}-utils package contains utilities that use %{name}.
69 %package -n %{php_name}-dmtx
70 Summary: PHP bindings for %{name}
72 Group: Development/Languages/PHP
73 Requires: %{name} = %{version}-%{release}
74 %{?requires_php_extension}
75 Provides: php(dmtx) = %{version}
76 Obsoletes: php-libdmtx < 0.7.2-4
78 %description -n %{php_name}-dmtx
79 This package contains bindings for using %{name} from PHP.
81 %package -n python-pydmtx
82 Summary: Python bindings for %{name}
83 Group: Libraries/Python
84 Requires: %{name} = %{version}-%{release}
85 Obsoletes: python-libdmtx < 0.7.2-4
87 %description -n python-pydmtx
88 This package contains bindings for using %{name} from Python.
90 %package -n ruby-libdmtx
91 Summary: Ruby bindings for %{name}
93 Requires: %{name} = %{version}-%{release}
94 Provides: ruby(%{name}) = %{version}
96 %description -n ruby-libdmtx
97 The ruby-%{name} package contains bindings for using %{name} from
104 chmod a-x wrapper/{php,python}/README
112 # temporary installation required by the language wrappers
117 # language wrappers must be built separately
127 EXTRA_CFLAGS="-I$(pwd)/../../tmp%{_includedir}" \
128 DMTX_SHARED_LIBADD="-L$(pwd)/../../tmp%{_libdir} -ldmtx"
135 sed -i.orig -e "s|%{_prefix}/local/include|$(pwd)/../../tmp%{_includedir}|" -e "s|%{_prefix}/local/lib|$(pwd)/../../tmp%{_libdir}|" setup.py
136 %{__python} setup.py build
137 chmod 0755 build/lib.*/*.so
145 CPPFLAGS="-I$(pwd)/../../tmp%{_includedir}" \
146 LIBPATH="-L$(pwd)/../../tmp%{_libdir} -ldmtx"
151 #make LIBDMTX_LA="/tmp%{_libdir}/libdmtx.so"
158 for t in simple unit; do
159 ./${t}_test/${t}_test
164 rm -rf $RPM_BUILD_ROOT
166 DESTDIR=$RPM_BUILD_ROOT
168 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libdmtx.la
172 %{__make} -C php install \
173 INSTALL_ROOT=$RPM_BUILD_ROOT
175 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
176 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/dmtx.ini
177 ; Enable dmtx extension module
184 %{__python} setup.py install \
187 --root=$RPM_BUILD_ROOT
193 %{__make} -C ruby install \
194 DESTDIR=$RPM_BUILD_ROOT
198 rm -rf $RPM_BUILD_ROOT
200 %post -p /sbin/ldconfig
201 %postun -p /sbin/ldconfig
204 %defattr(644,root,root,755)
205 %doc AUTHORS COPYING.LESSER ChangeLog KNOWNBUG NEWS README README.linux TODO
206 %attr(755,root,root) %{_libdir}/libdmtx.so.*.*.*
207 %ghost %{_libdir}/libdmtx.so.0
210 %defattr(644,root,root,755)
211 %attr(755,root,root) %{_libdir}/%{name}.so
212 %{_includedir}/dmtx.h
213 %{_pkgconfigdir}/%{name}.pc
214 %{_mandir}/man3/%{name}.3*
217 %defattr(644,root,root,755)
218 %attr(755,root,root) %{_bindir}/dmtxquery
219 %attr(755,root,root) %{_bindir}/dmtxread
220 %attr(755,root,root) %{_bindir}/dmtxwrite
221 %{_mandir}/man1/dmtxquery.1*
222 %{_mandir}/man1/dmtxread.1*
223 %{_mandir}/man1/dmtxwrite.1*
226 %files -n %{php_name}-dmtx
227 %defattr(644,root,root,755)
228 %doc COPYING wrapper/php/README
229 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/dmtx.ini
230 %attr(755,root,root) %{php_extensiondir}/dmtx.so
234 %files -n python-pydmtx
235 %defattr(644,root,root,755)
236 %doc wrapper/python/README
237 %{py_sitedir}/pydmtx.py[co]
238 %attr(755,root,root) %{py_sitedir}/_pydmtx.so
239 %{py_sitedir}/pydmtx-*.egg-info
243 %files -n ruby-libdmtx
244 %defattr(644,root,root,755)
245 %doc wrapper/ruby/README
246 %attr(755,root,root) %{ruby_sitearchdir}/*.so