libcaca/libcaca.spec
Tomáš Chvátal 610141ffca Accepting request 568533 from openSUSE:Factory:Staging:O:DVD
- Switch to git repack service in order to get all the latest fixes
  * like python3 porting of the bindings
- Update to version 0.99.beta19+git20171002.da28e96:
  * img2text.c: fix width arg case in example
  * ruby: require 'caca' instead of 'caca.so'
  * Only fail the check-copyright test if more than 10 files are affected.
  * Try to run Coverity from Travis CI.
  * Add some missing breaks (thanks coverity)
  * Fix header copyright.
  * Fix a bug into the autorepeat trigger.
- Refresh patches:
  * libcaca-ruby_am_cflags.patch
  * libcaca-ruby_vendor_install.patch

- Fix URL
- Mention github repo containing more changes
- Format with spec-cleaner
- Remove support for older distros lets stick with latest only
- Remove for years disabled mono and java integration code snippets
- Use python macros to build python instead of waiting for autotools
- Convert to pkgconfig style dependencies

OBS-URL: https://build.opensuse.org/request/show/568533
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/libcaca?expand=0&rev=42
2018-01-23 11:04:42 +00:00

251 lines
7.2 KiB
RPMSpec

#
# spec file for package libcaca
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without python2
Name: libcaca
Version: 0.99.beta19+git20171002.da28e96
Release: 0
Summary: Library for Colour ASCII Art, text mode graphics
License: WTFPL
Group: Development/Languages/C and C++
Url: http://caca.zoy.org/
# Git: https://github.com/cacalabs/libcaca
#Source0: http://caca.zoy.org/files/libcaca/%{name}-%{version}.tar.gz
Source0: %{name}-%{version}.tar.xz
Source1: baselibs.conf
Patch1: libcaca-0.99-texbuild.patch
Patch2: libcaca-X11_test.patch
Patch4: libcaca-ruby_am_cflags.patch
Patch5: libcaca-ruby_vendor_install.patch
Patch7: libcaca-0.99.beta16-missing-GLU.patch
Patch9: caca-no-build-date.patch
Patch10: libcaca-ncurses6.patch
BuildRequires: %{python_module setuptools}
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: freeglut-devel
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: ncurses-devel
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRequires: ruby-devel
BuildRequires: pkgconfig(ftgl)
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(glu)
BuildRequires: pkgconfig(imlib2)
BuildRequires: pkgconfig(slang)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(zlib)
%description
libcaca is the Colour AsCii Art library. It provides high level
functions for colour text drawing, simple primitives for line, polygon
and ellipse drawing, as well as powerful image to text conversion
routines.
%package -n libcaca0
Summary: Library for Colour ASCII Art, text mode graphics
Group: Development/Languages/C and C++
Provides: libcaca = %{version}
Obsoletes: libcaca < %{version}
%description -n libcaca0
libcaca is the Colour AsCii Art library. It provides high level
functions for colour text drawing, simple primitives for line, polygon
and ellipse drawing, as well as powerful image to text conversion
routines.
%package devel
Summary: Library for Colour ASCII Art, text mode graphics
Group: Development/Languages/C and C++
Requires: %{name} = %{version}
Requires: %{name}0-plugins = %{version}
%description devel
This package contains the header files and static libraries needed to
compile applications or shared objects that use libcaca.
%package -n python2-caca
Summary: Python2 support for libcaca
Group: Development/Languages/Python
Requires: %{name} = %{version}
Provides: %{name}-python = %{version}
Obsoletes: %{name}-python < %{version}
Provides: python-%{name} = %{version}
BuildArch: noarch
%description -n python2-caca
This package contains all that is needed to use libcaca from python2.
%package -n python3-caca
Summary: Python3 support for libcaca
Group: Development/Languages/Python
Requires: %{name} = %{version}
BuildArch: noarch
%description -n python3-caca
This package contains all that is needed to use libcaca from python3.
%package -n libcaca0-plugins
Summary: Plugins for libcaca
Group: Development/Languages/C and C++
Requires: %{name} = %{version}
%description -n libcaca0-plugins
This package contains gl and x11 plugins for caca.
%package ruby
Summary: Ruby bindings for libcaca
Group: Development/Languages/Ruby
Requires: %{name} = %{version}
Requires: ruby
%description ruby
All that is needed to use libcaca from ruby code.
%package -n caca-utils
Summary: Colour ASCII Art Text mode graphics utilities based on libcaca
Group: Amusements/Toys/Graphics
Requires: imlib2-loaders
%description -n caca-utils
This package contains utilities and demonstration programs for libcaca,
the Colour AsCii Art library.
cacaview is a simple image viewer for the terminal. It opens most image
formats such as JPEG, PNG, GIF etc. and renders them on the terminal
using ASCII art. The user can zoom and scroll the image, set the
dithering method or enable anti-aliasing.
cacaball is a tiny graphic program that renders animated ASCII
metaballs on the screen, cacafire is a port of AALib's aafire and
displays burning ASCII art flames, and cacademo is a simple application
that shows the libcaca rendering features such as line and ellipses
drawing, triangle filling and sprite blitting.
%prep
%setup -q
%patch2
%patch4
%patch5
%patch7
%patch9
%patch1
%patch10 -p1
RUBY="ruby-`echo %{rb_ver} | sed 's|\.[^\.]*$||'`"
find . -type f -exec sed -i "s|ruby-1.9|$RUBY|" \{\} \;
%build
autoreconf -fvi
export CFLAGS="$CFLAGS %{optflags} -I../caca/"
export CXXFLAGS="$CXXFLAGS %{optflags}"
%configure \
--enable-slang \
--enable-ncurses \
--enable-x11 \
--enable-imlib2 \
--enable-gl \
--enable-csharp=no \
--enable-doc \
--enable-shared=yes \
--enable-static=no \
--enable-conio=no \
--enable-plugins \
--enable-java=no \
--enable-python=no
make %{?_smp_mflags} V=1
pushd python
export LD_LIBRARY_PATH=$PWD/../caca/.libs/:$LD_LIBRARY_PATH
export LANG=en_US.UTF-8
%python_build
popd
%install
%make_install
find %{buildroot} -type f -name "*.la" -delete -print
pushd python
export LD_LIBRARY_PATH=$PWD/../caca/.libs/:$LD_LIBRARY_PATH
export LANG=en_US.UTF-8
%python_install
popd
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%fdupes -s %{buildroot}%{_mandir}/
%post -n libcaca0 -p /sbin/ldconfig
%postun -n libcaca0 -p /sbin/ldconfig
%post -n libcaca0-plugins -p /sbin/ldconfig
%postun -n libcaca0-plugins -p /sbin/ldconfig
%files -n libcaca0
%doc AUTHORS ChangeLog COPYING NEWS NOTES README THANKS
%{_libdir}/*.so.*
%files devel
%{_datadir}/doc/libcaca-dev
%dir %{_libdir}/caca
%{_libdir}/*.so
%{_libdir}/caca/libx11_plugin.so
%{_libdir}/caca/libgl_plugin.so
%{_bindir}/caca-config
%{_libdir}/pkgconfig/*.pc
%{_includedir}/*
%{_mandir}/man1/caca-config.1*
%{_mandir}/man3/*
%files ruby
%{rb_vendorarch}/*
%{rb_vendorlib}/caca.rb
%if %{with python2}
%files -n python2-caca
%{python2_sitelib}/*
%endif
%files -n python3-caca
%{python3_sitelib}/*
%files -n libcaca0-plugins
%dir %{_libdir}/caca
%{_libdir}/caca/libgl_plugin.so.0
%{_libdir}/caca/libgl_plugin.so.0.0.0
%{_libdir}/caca/libx11_plugin.so.0
%{_libdir}/caca/libx11_plugin.so.0.0.0
%files -n caca-utils
%{_bindir}/cacademo
%{_bindir}/cacafire
%{_bindir}/cacaview
%{_bindir}/cacaplay
%{_bindir}/cacaclock
%{_bindir}/cacaserver
%{_bindir}/img2txt
%{_datadir}/libcaca
%{_mandir}/man1/cacademo.1*
%{_mandir}/man1/cacafire.1*
%{_mandir}/man1/cacaview.1*
%{_mandir}/man1/cacaplay.1*
%{_mandir}/man1/cacaserver.1*
%{_mandir}/man1/img2txt.1*
%changelog