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