]>
Commit | Line | Data |
---|---|---|
abc44f29 AM |
1 | %bcond_with ruby |
2 | %bcond_without test | |
3 | Summary: Library for working with Data Matrix 2D bar-codes | |
4 | Name: libdmtx | |
5 | Version: 0.7.2 | |
d5ca58af | 6 | Release: 2 |
abc44f29 AM |
7 | License: LGPL v2+ |
8 | Group: Libraries | |
9 | URL: http://www.libdmtx.org/ | |
10 | Source0: http://downloads.sourceforge.net/libdmtx/%{name}-%{version}.tar.bz2 | |
11 | # Source0-md5: 0684cf3857591e777b57248d652444ae | |
12 | BuildRequires: ImageMagick-devel | |
1aaa332f | 13 | BuildRequires: pkgconfig |
14 | BuildRequires: python-modules | |
15 | BuildRequires: rpm-pythonprov | |
abc44f29 AM |
16 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
17 | # required for tests | |
18 | BuildRequires: OpenGL-GLU-devel | |
19 | BuildRequires: SDL_image-devel | |
20 | BuildRequires: libpng-devel | |
21 | # language bindings | |
22 | #BuildRequires: java-1.6.0-devel | |
23 | BuildRequires: php-devel | |
24 | BuildRequires: python-devel | |
25 | %if %{with ruby} | |
26 | BuildRequires: ruby | |
27 | BuildRequires: ruby-devel | |
28 | %endif | |
29 | ||
30 | %description | |
31 | libdmtx is open source software for reading and writing Data Matrix 2D | |
32 | bar-codes on Linux, Unix, OS X, Windows, and mobile devices. At its | |
33 | core libdmtx is a shared library, allowing C/C++ programs to use its | |
34 | capabilities without restrictions or overhead. | |
35 | ||
36 | The included utility programs, dmtxread and dmtxwrite, provide the | |
37 | official interface to libdmtx from the command line, and also serve as | |
38 | a good reference for programmers who wish to write their own programs | |
39 | that interact with libdmtx. All of the software in the libdmtx package | |
40 | is distributed under the LGPLv2 and can be used freely under these | |
41 | terms. | |
42 | ||
43 | %package devel | |
44 | Summary: Development files for %{name} | |
45 | Group: Development/Libraries | |
46 | Requires: %{name} = %{version}-%{release} | |
47 | ||
48 | %description devel | |
49 | The %{name}-devel package contains libraries and header files for | |
50 | developing applications that use %{name}. | |
51 | ||
52 | %package utils | |
53 | Summary: Utilities for %{name} | |
54 | Group: Applications/System | |
55 | Requires: %{name} = %{version}-%{release} | |
56 | ||
57 | %description utils | |
58 | The %{name}-utils package contains utilities that use %{name}. | |
59 | ||
60 | # language bindings | |
61 | %package -n php-libdmtx | |
62 | Summary: PHP bindings for %{name} | |
63 | License: GPL v2+ | |
64 | Group: Libraries | |
65 | Requires: %{name} = %{version}-%{release} | |
66 | Requires: php-common | |
67 | ||
68 | %description -n php-libdmtx | |
69 | The php-%{name} package contains bindings for using %{name} from PHP. | |
70 | ||
71 | %package -n python-libdmtx | |
72 | Summary: Python bindings for %{name} | |
73 | Group: Libraries | |
74 | Requires: %{name} = %{version}-%{release} | |
75 | ||
76 | %description -n python-libdmtx | |
77 | The python-%{name} package contains bindings for using %{name} from | |
78 | Python. | |
79 | ||
80 | %package -n ruby-libdmtx | |
81 | Summary: Ruby bindings for %{name} | |
82 | Group: Libraries | |
83 | Requires: %{name} = %{version}-%{release} | |
84 | Provides: ruby(%{name}) = %{version} | |
85 | ||
86 | %description -n ruby-libdmtx | |
87 | The ruby-%{name} package contains bindings for using %{name} from | |
88 | Ruby. | |
89 | ||
90 | %prep | |
91 | %setup -q | |
92 | ||
93 | # fix permissions | |
94 | chmod 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 | |
103 | install -d tmp | |
104 | %{__make} install \ | |
105 | DESTDIR=$(pwd)/tmp | |
106 | ||
107 | # language wrappers must be built separately | |
108 | cd wrapper/php | |
109 | phpize | |
110 | %configure \ | |
111 | --disable-static \ | |
112 | ||
113 | # Don't use rpath! | |
114 | sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool | |
115 | sed -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" | |
120 | cd .. | |
121 | ||
122 | cd python | |
123 | # fix paths | |
124 | sed -i.orig -e "s|%{_prefix}/local/include|$(pwd)/../../tmp%{_includedir}|" -e "s|%{_prefix}/local/lib|$(pwd)/../../tmp%{_libdir}|" setup.py | |
125 | python setup.py build | |
126 | chmod 0755 build/lib.*/*.so | |
127 | cd .. | |
128 | ||
129 | %if %{with ruby} | |
130 | cd ruby | |
131 | ruby extconf.rb | |
132 | %{__make} \ | |
133 | CPPFLAGS="-I$(pwd)/../../tmp%{_includedir}" \ | |
134 | LIBPATH="-L$(pwd)/../../tmp%{_libdir} -ldmtx" | |
135 | cd .. | |
136 | %endif | |
137 | ||
138 | #cd java | |
139 | #make LIBDMTX_LA="/tmp%{_libdir}/libdmtx.so" | |
140 | #cd .. | |
141 | cd .. | |
142 | ||
143 | %if %{with test} | |
144 | %{__make} check | |
145 | cd test | |
146 | for t in simple unit | |
147 | do | |
148 | ./${t}_test/${t}_test | |
149 | done | |
150 | %endif | |
151 | ||
152 | %install | |
153 | rm -rf $RPM_BUILD_ROOT | |
154 | ||
155 | %{__make} install \ | |
156 | DESTDIR=$RPM_BUILD_ROOT | |
157 | ||
158 | find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' | |
159 | ||
160 | cd wrapper | |
161 | %{__make} -C php install \ | |
162 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
163 | ||
164 | cd python | |
165 | python setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT | |
166 | cd .. | |
167 | ||
168 | %if %{with ruby} | |
169 | %{__make} -C ruby install \ | |
170 | DESTDIR=$RPM_BUILD_ROOT | |
171 | %endif | |
172 | ||
173 | #pushd java | |
174 | #popd | |
175 | cd .. | |
176 | ||
177 | %clean | |
178 | rm -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 |