%{!?_licensedir:%global license %doc}

Name:           libXaw3dXft
Version:        1.6.2e
Release:        1%{?dist}
Group:          System Environment/Libraries
License:        GPLv3+
URL:            http://sourceforge.net/projects/sf-xpaint
Summary:        An extended version of Xaw3d with support for UTF8
Source0:        http://sourceforge.net/projects/sf-xpaint/files/libxaw3dxft/%{name}-%{version}.tar.bz2

BuildRequires:  gcc
BuildRequires:  bison
BuildRequires:  flex
BuildRequires:  libX11-devel
BuildRequires:  libXmu-devel
BuildRequires:  libXft-devel

Requires(post):         /sbin/ldconfig
Requires(postun):       /sbin/ldconfig


%description
Xaw3dxft is an extended version of Xaw3d, developed as part of xpaint
with support for UTF8 input and UTF8 encoding of text, and rendering
text with the Freetype library and Truetype fonts.

It should be mostly compatible with the original Xaw3d library, except
for font management: everything using the old X11 core font routines
should be replaced by their freetype equivalents.


%package devel
Group:          System Environment/Libraries
Summary:        Development files for %{name}
Requires:       %{name} = %{version}-%{release}


%description devel
This package contains the libraries and header files that are needed
for writing applications with %{name}.


%package static
Group:          System Environment/Libraries
Summary:        Static libraries for %{name}
Requires:       %{name}-devel = %{version}-%{release}


%description static
This package contains the static libraries that are needed for writing
applications with %{name}.


%prep
%setup -q

%{__sed} -i -e 's|/usr/lib|%{_libdir}|g' "configure"


%build
%configure --enable-internationalization --enable-arrow-scrollbars

%{make_build}


%install
%{make_install}

%{__rm} -rf "%{buildroot}%{_datadir}/doc"

#find "%{buildroot}" -type f -name '*.a' -delete
#find "%{buildroot}" -type f -name '*.la' -delete


%post -p /sbin/ldconfig


%postun -p /sbin/ldconfig


%files
%doc Changelog README README.xaw3d Xdefault src/README.XAW3D
%license COPYING
%{_libdir}/libXaw3dxft*.so.*


%files devel
%doc Changelog README README.xaw3d Xdefault src/README.XAW3D
%license COPYING
%{_includedir}/X11/Xaw3dxft
%{_libdir}/libXaw3dxft.so
%{_libdir}/pkgconfig/libxaw3dxft.pc


%files static
%doc Changelog README README.xaw3d Xdefault src/README.XAW3D
%license COPYING
%{_libdir}/libXaw3dxft.a
%{_libdir}/libXaw3dxft.la


%changelog
* Mon Feb 18 2019 Tomasz Tomasik <scx.mail@gmail.com> - 1.6.2e-1
- Update to 1.6.2e
- Add static subpackage
- Spec cleanups
- Rebuild for EL7

* Mon Feb 18 2019 Tomasz Tomasik <scx.mail@gmail.com> - 1.6.2d-3.2
- Fixes for Fedora >= 29
- Rebuild for EL7

* Mon Feb 18 2019 Tomasz Tomasik <scx.mail@gmail.com> - 1.6.2d-3.1
- Rebuild for EL7

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.2d-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.2d-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sun May 10 2015 Paulo Roma <roma@lcg.ufrj.br> - 1.6.2d-1
- Update to 1.6.2d

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.2b-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.2b-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue Sep 03 2013 Paulo Roma <roma@lcg.ufrj.br> 1.6.2b-1
- Initial version.