File zint.spec of Package zint
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define so_ver 2_4
Name: zint
Version: 2.4.0
Release: 1
License: GPLv3+
Summary: Barcode generator library
Url: http://www.zint.org.uk
Group: Productivity/Graphics/Other
Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.src.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# patch to disable creation of rpaths
Patch0: %{name}-rpath.patch
# patch to fix desktop file categories
Patch1: %{name}-desktop.patch
BuildRequires: cmake
BuildRequires: desktop-file-utils
BuildRequires: libpng-devel
BuildRequires: libqt4-devel
BuildRequires: zlib-devel
%description
Zint is a C library for encoding data in several barcode variants. The
bundled command-line utility provides a simple interface to the library.
Features of the library:
- Over 50 symbologies including all ISO/IEC standards, like QR codes.
- Unicode translation for symbologies which support Latin-1 and
Kanji character sets.
- Full GS1 support including data verification and automated insertion of
FNC1 characters.
- Support for encoding binary data including NULL (ASCII 0) characters.
- Health Industry Barcode (HIBC) encoding capabilities.
- Output in PNG, EPS and SVG formats with user adjustable sizes and colors.
- Verification stage for SBN, ISBN and ISBN-13 data.
%package qt
Summary: Zint Barcode Studio
Group: Productivity/Graphics/Other
%description qt
Zint Barcode Studio is a Qt-based GUI which allows desktop users to generate
barcodes which can then be embedded in documents or HTML pages.
%package -n libzint%{so_ver}
Summary: Zint library
Group: Development/Libraries/C and C++
%description -n libzint%{so_ver}
Zint library.
%package -n libzint-devel
Summary: Development files for Zint library
Group: Development/Libraries/C and C++
Requires: libzint%{so_ver} = %{version}
%description -n libzint-devel
C library and header files needed to develop applications that use
the Zint library. The API documentation can be found on the project website:
http://www.zint.org.uk/zintSite/Manual.aspx
%package -n libQZint%{so_ver}
Summary: Qt version of Zint library
Group: Development/Libraries/C and C++
%description -n libQZint%{so_ver}
Qt version of Zint library.
%package -n libQZint-devel
Summary: Development files for Qt version of Zint library
Group: Development/Libraries/C and C++
Requires: libQZint%{so_ver} = %{version}
Requires: libzint-devel = %{version}
%description -n libQZint-devel
C library and header files needed to develop applications that use libQZint.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
# remove BSD-licensed file required for Windows only (just to ensure that this package is plain GPLv3+)
rm -f backend/ms_stdint.h
# remove bundled getopt sources (we use the corresponding package instead)
rm -f frontend/getopt*.*
%build
%if "%{?_lib}" == "lib64"
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIB_SUFFIX=64 .
%else
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} .
%endif
make VERBOSE=1 %{?_smp_mflags}
%install
%make_install
rm -rf %{buildroot}%{_datadir}/cmake
install -D -p -m 644 %{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
install -D -p -m 644 %{name}-qt.desktop %{buildroot}%{_datadir}/applications/%{name}-qt.desktop
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}-qt.desktop
%clean
rm -rf %{buildroot}
%post -n libzint%{so_ver} -p /sbin/ldconfig
%postun -n libzint%{so_ver} -p /sbin/ldconfig
%post -n libQZint%{so_ver} -p /sbin/ldconfig
%postun -n libQZint%{so_ver} -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc COPYING README TODO
%{_bindir}/%{name}
%files qt
%defattr(-,root,root,-)
%{_bindir}/%{name}-qt
%{_datadir}/applications/%{name}-qt.desktop
%{_datadir}/pixmaps/%{name}.png
%files -n libzint%{so_ver}
%defattr(-,root,root,-)
%{_libdir}/libzint.so.*
%files -n libzint-devel
%defattr(-,root,root,-)
%{_includedir}/%{name}.h
%{_libdir}/libzint.so
%files -n libQZint%{so_ver}
%defattr(-,root,root,-)
%{_libdir}/libQZint.so.*
%files -n libQZint-devel
%defattr(-,root,root,-)
%{_includedir}/qzint.h
%{_libdir}/libQZint.so
%changelog