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