| 1 | %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} |
|---|
| 2 | %{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"] ')} |
|---|
| 3 | |
|---|
| 4 | %global ruby_arch %(ruby -rrbconfig -e 'puts Config::CONFIG["archdir"]') |
|---|
| 5 | |
|---|
| 6 | Name: libdmtx |
|---|
| 7 | Summary: Library for working with Data Matrix 2D bar-codes |
|---|
| 8 | Version: 0.7.2 |
|---|
| 9 | Release: 8%{?_dist_release} |
|---|
| 10 | |
|---|
| 11 | Group: System Environment/Libraries |
|---|
| 12 | License: LGPLv2+ |
|---|
| 13 | URL: http://www.libdmtx.org/ |
|---|
| 14 | Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2 |
|---|
| 15 | Patch0: %{name}-0.7.2-php54.patch |
|---|
| 16 | Patch1: %{name}-0.7.2-ruby19.patch |
|---|
| 17 | |
|---|
| 18 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
|---|
| 19 | |
|---|
| 20 | BuildRequires: ImageMagick-devel |
|---|
| 21 | # required for tests |
|---|
| 22 | BuildRequires: SDL_image-devel |
|---|
| 23 | BuildRequires: libGLU-devel |
|---|
| 24 | BuildRequires: libpng-devel |
|---|
| 25 | # language bindings |
|---|
| 26 | BuildRequires: php5-devel |
|---|
| 27 | BuildRequires: python-devel |
|---|
| 28 | BuildRequires: ruby |
|---|
| 29 | BuildRequires: ruby-devel |
|---|
| 30 | #BuildRequires: java-1.6.0-devel |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | %description |
|---|
| 34 | libdmtx is open source software for reading and writing Data Matrix 2D |
|---|
| 35 | bar-codes on Linux, Unix, OS X, Windows, and mobile devices. At its core |
|---|
| 36 | libdmtx is a shared library, allowing C/C++ programs to use its capabilities |
|---|
| 37 | without restrictions or overhead. |
|---|
| 38 | |
|---|
| 39 | The included utility programs, dmtxread and dmtxwrite, provide the official |
|---|
| 40 | interface to libdmtx from the command line, and also serve as a good reference |
|---|
| 41 | for programmers who wish to write their own programs that interact with |
|---|
| 42 | libdmtx. All of the software in the libdmtx package is distributed under |
|---|
| 43 | the LGPLv2 and can be used freely under these terms. |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | %package devel |
|---|
| 47 | Summary: Development files for %{name} |
|---|
| 48 | Group: Development/Libraries |
|---|
| 49 | Requires: %{name} = %{version}-%{release} |
|---|
| 50 | |
|---|
| 51 | %description devel |
|---|
| 52 | The %{name}-devel package contains libraries and header files for |
|---|
| 53 | developing applications that use %{name}. |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | %package utils |
|---|
| 57 | Summary: Utilities for %{name} |
|---|
| 58 | Group: Applications/System |
|---|
| 59 | Requires: %{name} = %{version}-%{release} |
|---|
| 60 | |
|---|
| 61 | %description utils |
|---|
| 62 | The %{name}-utils package contains utilities that use %{name}. |
|---|
| 63 | |
|---|
| 64 | # language bindings |
|---|
| 65 | %package -n php-libdmtx |
|---|
| 66 | Summary: PHP bindings for %{name} |
|---|
| 67 | Group: System Environment/Libraries |
|---|
| 68 | License: GPLv2+ |
|---|
| 69 | Requires: %{name} = %{version}-%{release} |
|---|
| 70 | Requires: php5 |
|---|
| 71 | |
|---|
| 72 | %description -n php-libdmtx |
|---|
| 73 | The php-%{name} package contains bindings for using %{name} from PHP. |
|---|
| 74 | |
|---|
| 75 | %package -n python-libdmtx |
|---|
| 76 | Summary: Python bindings for %{name} |
|---|
| 77 | Group: System Environment/Libraries |
|---|
| 78 | Requires: %{name} = %{version}-%{release} |
|---|
| 79 | |
|---|
| 80 | %description -n python-libdmtx |
|---|
| 81 | The python-%{name} package contains bindings for using %{name} from Python. |
|---|
| 82 | |
|---|
| 83 | %package -n ruby-libdmtx |
|---|
| 84 | Summary: Ruby bindings for %{name} |
|---|
| 85 | Group: System Environment/Libraries |
|---|
| 86 | Requires: %{name} = %{version}-%{release} |
|---|
| 87 | Provides: ruby(%{name}) = %{version} |
|---|
| 88 | |
|---|
| 89 | %description -n ruby-libdmtx |
|---|
| 90 | The ruby-%{name} package contains bindings for using %{name} from Ruby. |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | %prep |
|---|
| 94 | %setup -q |
|---|
| 95 | %patch0 -p1 -b .php54 |
|---|
| 96 | %patch1 -p1 -b .ruby19 |
|---|
| 97 | |
|---|
| 98 | # fix permissions |
|---|
| 99 | chmod a-x wrapper/{php,python}/README |
|---|
| 100 | |
|---|
| 101 | |
|---|
| 102 | %build |
|---|
| 103 | %configure --disable-static |
|---|
| 104 | make %{?_smp_mflags} |
|---|
| 105 | |
|---|
| 106 | # temporary installation required by the language wrappers |
|---|
| 107 | make install DESTDIR=/tmp |
|---|
| 108 | |
|---|
| 109 | # language wrappers must be built separately |
|---|
| 110 | pushd wrapper |
|---|
| 111 | pushd php |
|---|
| 112 | phpize |
|---|
| 113 | %configure --disable-static |
|---|
| 114 | |
|---|
| 115 | # Don't use rpath! |
|---|
| 116 | sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool |
|---|
| 117 | sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool |
|---|
| 118 | |
|---|
| 119 | make EXTRA_CFLAGS="-I/tmp%{_includedir}" DMTX_SHARED_LIBADD="-L/tmp%{_libdir} -ldmtx" |
|---|
| 120 | popd |
|---|
| 121 | |
|---|
| 122 | pushd python |
|---|
| 123 | # fix paths |
|---|
| 124 | sed -i.orig -e "s|/usr/local/include|/tmp%{_includedir}|" -e "s|/usr/local/lib|/tmp%{_libdir}|" setup.py |
|---|
| 125 | python setup.py build |
|---|
| 126 | chmod 0755 build/lib.*/*.so |
|---|
| 127 | popd |
|---|
| 128 | |
|---|
| 129 | pushd ruby |
|---|
| 130 | ruby extconf.rb |
|---|
| 131 | make CPPFLAGS="-I/tmp%{_includedir}" LIBPATH="-L/tmp%{_libdir} -ldmtx" |
|---|
| 132 | popd |
|---|
| 133 | |
|---|
| 134 | #pushd java |
|---|
| 135 | #make LIBDMTX_LA="/tmp%{_libdir}/libdmtx.so" |
|---|
| 136 | #popd |
|---|
| 137 | popd |
|---|
| 138 | |
|---|
| 139 | |
|---|
| 140 | %install |
|---|
| 141 | rm -rf $RPM_BUILD_ROOT |
|---|
| 142 | make install DESTDIR=$RPM_BUILD_ROOT |
|---|
| 143 | find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' |
|---|
| 144 | |
|---|
| 145 | pushd wrapper |
|---|
| 146 | pushd php |
|---|
| 147 | make install INSTALL_ROOT=$RPM_BUILD_ROOT |
|---|
| 148 | popd |
|---|
| 149 | |
|---|
| 150 | pushd python |
|---|
| 151 | python setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT |
|---|
| 152 | popd |
|---|
| 153 | |
|---|
| 154 | pushd ruby |
|---|
| 155 | make install RUBYARCHDIR=$RPM_BUILD_ROOT%{ruby_arch} |
|---|
| 156 | popd |
|---|
| 157 | |
|---|
| 158 | #pushd java |
|---|
| 159 | #popd |
|---|
| 160 | popd |
|---|
| 161 | |
|---|
| 162 | |
|---|
| 163 | %check |
|---|
| 164 | make check |
|---|
| 165 | pushd test |
|---|
| 166 | for t in simple unit |
|---|
| 167 | do |
|---|
| 168 | ./${t}_test/${t}_test |
|---|
| 169 | done |
|---|
| 170 | popd |
|---|
| 171 | |
|---|
| 172 | |
|---|
| 173 | %clean |
|---|
| 174 | rm -rf $RPM_BUILD_ROOT |
|---|
| 175 | |
|---|
| 176 | |
|---|
| 177 | %post -p /sbin/ldconfig |
|---|
| 178 | |
|---|
| 179 | %postun -p /sbin/ldconfig |
|---|
| 180 | |
|---|
| 181 | |
|---|
| 182 | %files |
|---|
| 183 | %defattr(-,root,root,-) |
|---|
| 184 | %doc AUTHORS COPYING.LESSER ChangeLog KNOWNBUG NEWS README README.linux TODO |
|---|
| 185 | %{_libdir}/%{name}.so.* |
|---|
| 186 | |
|---|
| 187 | %files devel |
|---|
| 188 | %defattr(-,root,root,-) |
|---|
| 189 | %doc |
|---|
| 190 | %{_includedir}/* |
|---|
| 191 | %{_libdir}/%{name}.so |
|---|
| 192 | %{_libdir}/pkgconfig/%{name}.pc |
|---|
| 193 | %{_mandir}/man3/%{name}.3* |
|---|
| 194 | |
|---|
| 195 | %files utils |
|---|
| 196 | %defattr(-,root,root,-) |
|---|
| 197 | %{_bindir}/dmtx* |
|---|
| 198 | %{_mandir}/man1/dmtx*.1* |
|---|
| 199 | |
|---|
| 200 | %files -n php-libdmtx |
|---|
| 201 | %defattr(-,root,root,-) |
|---|
| 202 | %doc COPYING wrapper/php/README |
|---|
| 203 | %{_libdir}/php5/*.so |
|---|
| 204 | |
|---|
| 205 | %files -n python-libdmtx |
|---|
| 206 | %defattr(-,root,root,-) |
|---|
| 207 | %doc wrapper/python/README |
|---|
| 208 | %{python_sitearch}/* |
|---|
| 209 | |
|---|
| 210 | %files -n ruby-libdmtx |
|---|
| 211 | %defattr(-,root,root,-) |
|---|
| 212 | %doc wrapper/ruby/README |
|---|
| 213 | %{ruby_arch}/*.so |
|---|
| 214 | |
|---|
| 215 | |
|---|
| 216 | %changelog |
|---|
| 217 | * Wed Aug 14 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.7.2-8 |
|---|
| 218 | - rebuild with ImageMagick-6.8.6.8 |
|---|
| 219 | - add Patch0 (%%{name}-0.7.2-php54.patch) from fedora |
|---|
| 220 | - add Patch1 (%%{name}-0.7.2-ruby19.patch) from fedora |
|---|
| 221 | |
|---|
| 222 | * Sun Mar 11 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.7.2-7 |
|---|
| 223 | - rebuild with ImageMagick-6.7.5.10 |
|---|
| 224 | |
|---|
| 225 | * Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.7.2-6 |
|---|
| 226 | - rebuild with python-2.7.2 |
|---|
| 227 | |
|---|
| 228 | |
|---|
| 229 | * Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.2-4 |
|---|
| 230 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild |
|---|
| 231 | |
|---|
| 232 | * Wed Nov 17 2010 Dan Horák <dan[at]danny.cz> 0.7.2-3 |
|---|
| 233 | - updated license for the php subpackage |
|---|
| 234 | - run few tests |
|---|
| 235 | |
|---|
| 236 | * Sat May 29 2010 Dan Horák <dan[at]danny.cz> 0.7.2-2 |
|---|
| 237 | - added language bindigs |
|---|
| 238 | |
|---|
| 239 | * Wed Feb 3 2010 Dan Horák <dan[at]danny.cz> 0.7.2-1 |
|---|
| 240 | - initial Fedora version |
|---|