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