%define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}

Summary:	Text shaping library
Name:		harfbuzz
Version:	1.0.6
Release:	1%{?_dist_release}
License:	MIT
Group:		System Environment/Libraries 
URL:		http://www.freedesktop.org/wiki/Software/HarfBuzz

Source0:	http://www.freedesktop.org/software/harfbuzz/release/%{name}/%{name}-%{version}.tar.bz2

BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildRequires:	glib2-devel
BuildRequires:	cairo-devel
BuildRequires:	freetype2-devel
BuildRequires:	libicu-devel

Vendor:		Project Vine
Distribution:	Vine Linux
Packager:	Takemikaduchi


%description
HarfBuzz is an OpenType text shaping engine.


%package	devel
Summary:        Development tools for %{name}
Summary(ja):    %{name} の開発環境
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:       pkgconfig

%description	devel
Header files and libraries for building a extension library for the
%{name}.


%package        icu
Summary:        ICU library for %{name}
Summary(ja):    %{name} 用 ICU ライブラリ
Group:		System Environment/Libraries 
Requires:       libicu
Requires:       %{name} = %{version}-%{release}

%description    icu
This package contains icu library for %{name}.


%package	icu-devel
Summary:        Development tools for %{name}-icu
Summary(ja):    %{name}-icu の開発環境
Group:          Development/Libraries
Requires:       %{name}-icu = %{version}-%{release}
Requires:       %{name}-devel = %{version}-%{release}
Requires:	libicu-devel
Requires:       pkgconfig

%description	icu-devel
Header files and libraries for building a extension library for the
%{name}-icu.


%package        docs
Summary:        Documentation for %{name}
Summary(ja):    %{name} 用のドキュメント
Group:          Documentation
Requires:       %{name} = %{version}-%{release}
BuildArch:      noarch

%description    docs
This package contains documentation for %{name}.


# compat32
%package -n compat32-%{name}
Summary:	Text shaping library
Group:		System Environment/Libraries
Requires:	%{name} = %{version}-%{release}

%description -n compat32-%{name}
HarfBuzz is an OpenType text shaping engine.


%package -n compat32-%{name}-devel
Summary:        Development tools for %{name}
Summary(ja):    %{name} の開発環境
Group:          Development/Libraries
Requires:       compat32-%{name} = %{version}-%{release}
Requires:       pkgconfig

%description -n compat32-%{name}-devel
Header files and libraries for building a extension library for the
%{name}.



%prep
%setup -q


%build
%configure \
	--disable-static

%{__make} %{?_smp_mflags}


%install
%{__rm} -rf ${RPM_BUILD_ROOT}
%{__make} install DESTDIR=${RPM_BUILD_ROOT}

find $RPM_BUILD_ROOT -name '*.a' -exec rm -f {} \;
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} \;


%clean
%{__rm} -rf ${RPM_BUILD_ROOT}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%post icu -p /sbin/ldconfig

%postun icu -p /sbin/ldconfig

%post -n compat32-%{name} -p /sbin/ldconfig

%postun -n compat32-%{name} -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc COPYING ChangeLog NEWS README
%{_bindir}/hb-ot-shape-closure
%{_bindir}/hb-shape
%{_bindir}/hb-view
%{_libdir}/libharfbuzz.so.*

%files devel
%defattr(-,root,root,-)
%{_includedir}/%{name}
%{_libdir}/libharfbuzz.so
%{_libdir}/pkgconfig/%{name}.pc

%files icu
%defattr(-,root,root,-)
%{_libdir}/libharfbuzz-icu.so.*

%files icu-devel
%defattr(-,root,root,-)
%{_libdir}/libharfbuzz-icu.so
%{_libdir}/pkgconfig/%{name}-icu.pc

%files docs
%defattr(-,root,root,-)
%{_datadir}/gtk-doc/html/%{name}

%if %{build_compat32}
%files -n compat32-%{name}
%defattr(-, root, root,-)
%{_libdir}/libharfbuzz.so.*

%files -n compat32-%{name}-devel
%defattr(-, root, root,-)
%{_libdir}/libharfbuzz.so
%endif


%changelog
* Thu Oct 29 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 1.0.6-1
- new upstream release

* Mon Apr 13 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 0.9.40-1
- new upstream release

* Sat Nov 29 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 0.9.36-1
- new upstream release
- moved icu subpackage to System Environment/Libraries Group

* Sun Oct 26 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9.35-1
- new upstream release

* Fri Mar 28 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9.27-1
- new upstream release

* Mon Dec 30 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9.25-1
- new upstream release

* Sat Oct 26 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9.21-1
- new upstream release
- add BuildRequires: libicu-devel
- add icu, icu-devel, and docs subpackages

* Wed Apr 17 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9.14-1
- new upstream release

* Wed Jan 02 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9.9-1
- new upstream release

* Wed Nov 14 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9.5-1
- new upstream release

* Wed Sep 26 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9.4-1
- initial build

