]> git.pld-linux.org Git - packages/dmtx-utils.git/blame - libdmtx.spec
rename python subpackage to python-pydmtx
[packages/dmtx-utils.git] / libdmtx.spec
CommitLineData
bd7d2349
ER
1# TODO
2# - java bindings
3#
4# Conditional build:
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
9
abc44f29
AM
10Summary: Library for working with Data Matrix 2D bar-codes
11Name: libdmtx
12Version: 0.7.2
854a0d8b 13Release: 4
abc44f29
AM
14License: LGPL v2+
15Group: Libraries
abc44f29
AM
16Source0: http://downloads.sourceforge.net/libdmtx/%{name}-%{version}.tar.bz2
17# Source0-md5: 0684cf3857591e777b57248d652444ae
bd7d2349 18URL: http://www.libdmtx.org/
abc44f29 19BuildRequires: ImageMagick-devel
1aaa332f 20BuildRequires: pkgconfig
21BuildRequires: python-modules
22BuildRequires: rpm-pythonprov
bd7d2349
ER
23BuildRequires: rpmbuild(macros) >= 1.219
24%if %{with tests}
abc44f29
AM
25BuildRequires: OpenGL-GLU-devel
26BuildRequires: SDL_image-devel
27BuildRequires: libpng-devel
bd7d2349
ER
28%endif
29%if %{with php}
30BuildRequires: %{php_name}-devel
31%endif
32%if %{with python}
abc44f29 33BuildRequires: python-devel
bd7d2349 34%endif
abc44f29
AM
35%if %{with ruby}
36BuildRequires: ruby
37BuildRequires: ruby-devel
38%endif
bd7d2349 39BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
abc44f29
AM
40
41%description
42libdmtx is open source software for reading and writing Data Matrix 2D
43bar-codes on Linux, Unix, OS X, Windows, and mobile devices. At its
44core libdmtx is a shared library, allowing C/C++ programs to use its
45capabilities without restrictions or overhead.
46
47The included utility programs, dmtxread and dmtxwrite, provide the
48official interface to libdmtx from the command line, and also serve as
49a good reference for programmers who wish to write their own programs
bd7d2349 50that interact with libdmtx.
abc44f29 51
bd7d2349 52%package devel
abc44f29
AM
53Summary: Development files for %{name}
54Group: Development/Libraries
55Requires: %{name} = %{version}-%{release}
56
bd7d2349 57%description devel
abc44f29
AM
58The %{name}-devel package contains libraries and header files for
59developing applications that use %{name}.
60
bd7d2349 61%package utils
abc44f29
AM
62Summary: Utilities for %{name}
63Group: Applications/System
64Requires: %{name} = %{version}-%{release}
65
bd7d2349 66%description utils
abc44f29
AM
67The %{name}-utils package contains utilities that use %{name}.
68
bd7d2349 69%package -n %{php_name}-dmtx
abc44f29
AM
70Summary: PHP bindings for %{name}
71License: GPL v2+
bd7d2349 72Group: Development/Languages/PHP
abc44f29 73Requires: %{name} = %{version}-%{release}
bd7d2349
ER
74%{?requires_php_extension}
75Provides: php(dmtx) = %{version}
76Obsoletes: php-libdmtx < 0.7.2-4
abc44f29 77
bd7d2349
ER
78%description -n %{php_name}-dmtx
79This package contains bindings for using %{name} from PHP.
abc44f29 80
f498c99a 81%package -n python-pydmtx
abc44f29 82Summary: Python bindings for %{name}
bd7d2349 83Group: Libraries/Python
abc44f29 84Requires: %{name} = %{version}-%{release}
f498c99a 85Obsoletes: python-libdmtx < 0.7.2-4
abc44f29 86
f498c99a
ER
87%description -n python-pydmtx
88This package contains bindings for using %{name} from Python.
abc44f29 89
bd7d2349 90%package -n ruby-libdmtx
abc44f29
AM
91Summary: Ruby bindings for %{name}
92Group: Libraries
93Requires: %{name} = %{version}-%{release}
94Provides: ruby(%{name}) = %{version}
95
96%description -n ruby-libdmtx
97The ruby-%{name} package contains bindings for using %{name} from
98Ruby.
99
100%prep
101%setup -q
102
103# fix permissions
104chmod a-x wrapper/{php,python}/README
105
106%build
107%configure \
bd7d2349 108 --disable-static
abc44f29 109
bd7d2349 110%{__make}
abc44f29
AM
111
112# temporary installation required by the language wrappers
113install -d tmp
114%{__make} install \
115 DESTDIR=$(pwd)/tmp
116
117# language wrappers must be built separately
bd7d2349
ER
118cd wrapper
119
120%if %{with php}
121cd php
abc44f29
AM
122phpize
123%configure \
124 --disable-static \
125
abc44f29
AM
126%{__make} \
127 EXTRA_CFLAGS="-I$(pwd)/../../tmp%{_includedir}" \
128 DMTX_SHARED_LIBADD="-L$(pwd)/../../tmp%{_libdir} -ldmtx"
129cd ..
bd7d2349 130%endif
abc44f29 131
bd7d2349 132%if %{with python}
abc44f29
AM
133cd python
134# fix paths
135sed -i.orig -e "s|%{_prefix}/local/include|$(pwd)/../../tmp%{_includedir}|" -e "s|%{_prefix}/local/lib|$(pwd)/../../tmp%{_libdir}|" setup.py
bd7d2349 136%{__python} setup.py build
abc44f29
AM
137chmod 0755 build/lib.*/*.so
138cd ..
bd7d2349 139%endif
abc44f29
AM
140
141%if %{with ruby}
142cd ruby
143ruby extconf.rb
144%{__make} \
145 CPPFLAGS="-I$(pwd)/../../tmp%{_includedir}" \
146 LIBPATH="-L$(pwd)/../../tmp%{_libdir} -ldmtx"
147cd ..
148%endif
149
150#cd java
151#make LIBDMTX_LA="/tmp%{_libdir}/libdmtx.so"
152#cd ..
153cd ..
154
bd7d2349 155%if %{with tests}
abc44f29
AM
156%{__make} check
157cd test
bd7d2349 158for t in simple unit; do
abc44f29
AM
159 ./${t}_test/${t}_test
160done
161%endif
162
163%install
164rm -rf $RPM_BUILD_ROOT
abc44f29
AM
165%{__make} install \
166 DESTDIR=$RPM_BUILD_ROOT
167
bd7d2349 168%{__rm} $RPM_BUILD_ROOT%{_libdir}/libdmtx.la
abc44f29
AM
169
170cd wrapper
bd7d2349 171%if %{with php}
abc44f29
AM
172%{__make} -C php install \
173 INSTALL_ROOT=$RPM_BUILD_ROOT
174
bd7d2349
ER
175install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
176cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/dmtx.ini
177; Enable dmtx extension module
178extension=dmtx.so
179EOF
180%endif
181
182%if %{with python}
abc44f29 183cd python
bd7d2349
ER
184%{__python} setup.py install \
185 --skip-build \
186 --optimize=2 \
187 --root=$RPM_BUILD_ROOT
abc44f29 188cd ..
bd7d2349
ER
189%py_postclean
190%endif
abc44f29
AM
191
192%if %{with ruby}
193%{__make} -C ruby install \
194 DESTDIR=$RPM_BUILD_ROOT
195%endif
196
abc44f29
AM
197%clean
198rm -rf $RPM_BUILD_ROOT
199
bd7d2349
ER
200%post -p /sbin/ldconfig
201%postun -p /sbin/ldconfig
abc44f29
AM
202
203%files
204%defattr(644,root,root,755)
205%doc AUTHORS COPYING.LESSER ChangeLog KNOWNBUG NEWS README README.linux TODO
bd7d2349
ER
206%attr(755,root,root) %{_libdir}/libdmtx.so.*.*.*
207%ghost %{_libdir}/libdmtx.so.0
abc44f29
AM
208
209%files devel
210%defattr(644,root,root,755)
abc44f29 211%attr(755,root,root) %{_libdir}/%{name}.so
bd7d2349 212%{_includedir}/dmtx.h
abc44f29
AM
213%{_pkgconfigdir}/%{name}.pc
214%{_mandir}/man3/%{name}.3*
215
216%files utils
217%defattr(644,root,root,755)
bd7d2349
ER
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*
224
225%if %{with php}
226%files -n %{php_name}-dmtx
abc44f29
AM
227%defattr(644,root,root,755)
228%doc COPYING wrapper/php/README
bd7d2349
ER
229%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/dmtx.ini
230%attr(755,root,root) %{php_extensiondir}/dmtx.so
231%endif
abc44f29 232
bd7d2349 233%if %{with python}
f498c99a 234%files -n python-pydmtx
abc44f29
AM
235%defattr(644,root,root,755)
236%doc wrapper/python/README
bd7d2349
ER
237%{py_sitedir}/pydmtx.py[co]
238%attr(755,root,root) %{py_sitedir}/_pydmtx.so
239%{py_sitedir}/pydmtx-*.egg-info
240%endif
abc44f29
AM
241
242%if %{with ruby}
243%files -n ruby-libdmtx
244%defattr(644,root,root,755)
245%doc wrapper/ruby/README
246%attr(755,root,root) %{ruby_sitearchdir}/*.so
247%endif
This page took 0.107053 seconds and 4 git commands to generate.