8 %bcond_with ruby # build Ruby bindings
9 %bcond_without python # build Python2 bindings
10 %bcond_without php # build PHP bindings
11 %bcond_without tests # build without tests
13 Summary: Library for working with Data Matrix 2D bar-codes
19 Source0: http://downloads.sourceforge.net/libdmtx/%{name}-%{version}.tar.bz2
20 # Source0-md5: 0684cf3857591e777b57248d652444ae
21 URL: http://www.libdmtx.org/
22 BuildRequires: ImageMagick-devel
23 BuildRequires: pkgconfig
24 BuildRequires: python-modules
25 BuildRequires: rpm-pythonprov
26 BuildRequires: rpmbuild(macros) >= 1.219
28 BuildRequires: OpenGL-GLU-devel
29 BuildRequires: SDL_image-devel
30 BuildRequires: libpng-devel
33 BuildRequires: %{php_name}-devel
36 BuildRequires: python-devel
40 BuildRequires: ruby-devel
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 libdmtx is open source software for reading and writing Data Matrix 2D
46 bar-codes on Linux, Unix, OS X, Windows, and mobile devices. At its
47 core libdmtx is a shared library, allowing C/C++ programs to use its
48 capabilities without restrictions or overhead.
50 The included utility programs, dmtxread and dmtxwrite, provide the
51 official interface to libdmtx from the command line, and also serve as
52 a good reference for programmers who wish to write their own programs
53 that interact with libdmtx.
56 Summary: Development files for %{name}
57 Group: Development/Libraries
58 Requires: %{name} = %{version}-%{release}
61 The %{name}-devel package contains libraries and header files for
62 developing applications that use %{name}.
65 Summary: Utilities for %{name}
66 Group: Applications/System
67 Requires: %{name} = %{version}-%{release}
70 The %{name}-utils package contains utilities that use %{name}.
72 %package -n %{php_name}-dmtx
73 Summary: PHP bindings for %{name}
75 Group: Development/Languages/PHP
76 Requires: %{name} = %{version}-%{release}
77 %{?requires_php_extension}
78 Provides: php(dmtx) = %{version}
79 Obsoletes: php-libdmtx < 0.7.2-4
81 %description -n %{php_name}-dmtx
82 This package contains bindings for using %{name} from PHP.
84 %package -n python-pydmtx
85 Summary: Python bindings for %{name}
86 Group: Libraries/Python
87 Requires: %{name} = %{version}-%{release}
88 Obsoletes: python-libdmtx < 0.7.2-4
90 %description -n python-pydmtx
91 This package contains bindings for using %{name} from Python.
93 %package -n ruby-libdmtx
94 Summary: Ruby bindings for %{name}
96 Requires: %{name} = %{version}-%{release}
97 Provides: ruby(%{name}) = %{version}
99 %description -n ruby-libdmtx
100 The ruby-%{name} package contains bindings for using %{name} from
107 chmod a-x wrapper/{php,python}/README
115 # temporary installation required by the language wrappers
120 # language wrappers must be built separately
130 EXTRA_CFLAGS="-I$(pwd)/../../tmp%{_includedir}" \
131 DMTX_SHARED_LIBADD="-L$(pwd)/../../tmp%{_libdir} -ldmtx"
138 sed -i.orig -e "s|%{_prefix}/local/include|$(pwd)/../../tmp%{_includedir}|" -e "s|%{_prefix}/local/lib|$(pwd)/../../tmp%{_libdir}|" setup.py
139 %{__python} setup.py build
140 chmod 0755 build/lib.*/*.so
148 CPPFLAGS="-I$(pwd)/../../tmp%{_includedir}" \
149 LIBPATH="-L$(pwd)/../../tmp%{_libdir} -ldmtx"
154 #make LIBDMTX_LA="/tmp%{_libdir}/libdmtx.so"
161 for t in simple unit; do
162 ./${t}_test/${t}_test
167 rm -rf $RPM_BUILD_ROOT
169 DESTDIR=$RPM_BUILD_ROOT
171 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libdmtx.la
175 %{__make} -C php install \
176 INSTALL_ROOT=$RPM_BUILD_ROOT
178 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
179 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/dmtx.ini
180 ; Enable dmtx extension module
187 %{__python} setup.py install \
190 --root=$RPM_BUILD_ROOT
196 %{__make} -C ruby install \
197 DESTDIR=$RPM_BUILD_ROOT
201 rm -rf $RPM_BUILD_ROOT
203 %post -p /sbin/ldconfig
204 %postun -p /sbin/ldconfig
207 %defattr(644,root,root,755)
208 %doc AUTHORS COPYING.LESSER ChangeLog KNOWNBUG NEWS README README.linux TODO
209 %attr(755,root,root) %{_libdir}/libdmtx.so.*.*.*
210 %ghost %{_libdir}/libdmtx.so.0
213 %defattr(644,root,root,755)
214 %attr(755,root,root) %{_libdir}/%{name}.so
215 %{_includedir}/dmtx.h
216 %{_pkgconfigdir}/%{name}.pc
217 %{_mandir}/man3/%{name}.3*
220 %defattr(644,root,root,755)
221 %attr(755,root,root) %{_bindir}/dmtxquery
222 %attr(755,root,root) %{_bindir}/dmtxread
223 %attr(755,root,root) %{_bindir}/dmtxwrite
224 %{_mandir}/man1/dmtxquery.1*
225 %{_mandir}/man1/dmtxread.1*
226 %{_mandir}/man1/dmtxwrite.1*
229 %files -n %{php_name}-dmtx
230 %defattr(644,root,root,755)
231 %doc COPYING wrapper/php/README
232 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/dmtx.ini
233 %attr(755,root,root) %{php_extensiondir}/dmtx.so
237 %files -n python-pydmtx
238 %defattr(644,root,root,755)
239 %doc wrapper/python/README
240 %{py_sitedir}/pydmtx.py[co]
241 %attr(755,root,root) %{py_sitedir}/_pydmtx.so
242 %{py_sitedir}/pydmtx-*.egg-info
246 %files -n ruby-libdmtx
247 %defattr(644,root,root,755)
248 %doc wrapper/ruby/README
249 %attr(755,root,root) %{ruby_sitearchdir}/*.so