Summary:	Multi-purpose calculator library
Summary(ja):	多目的電卓ライブラリ
Name:		libqalculate
Version:	0.9.7
Release:	5%{?_dist_release}

License:	GPLv2+
Group:		System Environment/Libraries
URL:		http://qalculate.sourceforge.net/

Source0:	http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Patch1:		libqalculate-0.9.7-pkgconfig_private.patch

BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildRequires:  cln-devel
BuildRequires:	glib2-devel
BuildRequires:	libxml2-devel
BuildRequires:  ncurses-devel
BuildRequires:	readline-devel
BuildRequires:	perl-XML-Parser
BuildRequires:  gettext

%description
This library underpins the Qalculate! multi-purpose desktop calculator for GNU/Linux

%package	devel
Summary:	Development tools for the Qalculate calculator library
Summary(ja):	Qalculate 電卓ライブラリの開発用ファイル
Group:		Development/Libraries
Requires:	%{name} = %{version}-%{release}
Requires:       cln-devel
Requires:	glib2-devel
Requires:       libxml2-devel
Requires:       pkgconfig

%description	devel
The libqalculate-devel package contains the header files needed for development
with libqalculate.

%package -n	qalculate
Summary:	Multi-purpose calculator, text mode interface
Summary(ja):	テキストインターフェースの多目的電卓
Group:		Applications/Engineering
Requires:	%{name} = %{version}-%{release}

%description -n	qalculate
Qalculate! is a multi-purpose desktop calculator for GNU/Linux. It is
small and simple to use but with much power and versatility underneath.
Features include customizable functions, units, arbitrary precision, plotting.
This package provides the text-mode interface for Qalculate! The GTK and QT
frontends are provided by qalculate-gtk and qalculate-kde packages resp.

%prep
%setup -q
%patch1 -p1 -b .pkgconfig_private

%build
%configure --disable-static
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}

%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install
%find_lang %{name}
rm -f %{buildroot}/%{_libdir}/*.la

rm -rf docs_to_include
mkdir -p docs_to_include
mv %{buildroot}%{_docdir}/%{name}-%{version}/reference docs_to_include

%clean
rm -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING TODO
%{_libdir}/libqalculate.so.*
%{_datadir}/qalculate/

%files devel
%defattr(-,root,root,-)
%doc COPYING docs_to_include/*
%{_libdir}/libqalculate.so
%{_libdir}/pkgconfig/libqalculate.pc
%{_includedir}/libqalculate/

%files -n qalculate
%defattr(-,root,root,-)
%{_bindir}/qalc

%changelog
* Thu Jun 30 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.9.7-5
- rebuild with gcc-5.4.0

* Sun Mar 22 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> - 0.9.7-4
- rebuilt with readline 6.3

* Wed Oct 29 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> - 0.9.7-3
- added Japanese summary
- added Patch1 from fc
- moved API documents to devel package

* Mon May 21 2012 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 0.9.7-2
- rebuild with rpm-4.8.1-3

* Thu Sep 23 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 0.9.7-1
- new upstream release
- built with rpm-4.8.1

* Sun Aug 30 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 0.9.6-9
- Initial build for Vine Linux

* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.6-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Jul 06 2009 Rex Dieter <rdieter@fedoraproject.org> 0.9.6-7
- move auto*foo to prep stage
- trim pkg-config-related deps (#509840)

* Sun Jul 05 2009 Deji Akingunola <dakingun@gmail.com> - 0.9.6-6
- Rebuild for cln-1.3.0

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Wed Feb 27 2008 Deji Akingunola <dakingun@gmail.com> - 0.9.6-4
- Rebuild (with patch) for cln-1.2

* Sun Feb 10 2008 Deji Akingunola <dakingun@gmail.com> - 0.9.6-3
- Rebuild for gcc43

* Sat Aug 25 2007 Deji Akingunola <dakingun@gmail.com> - 0.9.6-2
- Rebuild

* Fri Aug 03 2007 Deji Akingunola <dakingun@gmail.com> - 0.9.6-2
- License tag update

* Sun Jul 01 2007 Deji Akingunola <dakingun@gmail.com> - 0.9.6-1
- Update to new release

* Tue Jan 02 2007 Deji Akingunola <dakingun@gmail.com> - 0.9.5-1
- New release

* Mon Aug 28 2006 Deji Akingunola <dakingun@gmail.com> - 0.9.4-4
- Rebuild for FC6

* Thu Jun 28 2006 Deji Akingunola <dakingun@gmail.com> - 0.9.4-3
- Arbitrarily bump the release field to fix broken update path

* Wed Jun 27 2006 Deji Akingunola <dakingun@gmail.com> - 0.9.4-1
- New version 0.9.4

* Tue Apr 30 2006 Deji Akingunola <dakingun@gmail.com> - 0.9.3-2
- More BRs from Paul Howarth (#193481)

* Thu Mar 30 2006 Deji Akingunola <dakingun@gmail.com> - 0.9.3-1
- Update to newer version

* Mon Feb 13 2006 Deji Akingunola <dakingun@gmail.com> - 0.9.2-2
- Rebuild for Fedora Extras 5

* Tue Dec 27 2005 Deji Akingunola <dakingun@gmail.com> - 0.9.2-1
- Upgrade to new version

* Sat Nov 05 2005 Deji Akingunola <dakingun@gmail.com> - 0.9.0-1
- Upgrade to new version

* Mon Oct 17 2005 Deji Akingunola <deji.aking@gmail.com> - 0.8.2-3
- Add patch to allow build with cln-1.1.10

* Mon Oct 17 2005 Deji Akingunola <deji.aking@gmail.com> - 0.8.2-2
- Bump the release tag to make even with FC-4 and FC-3 branches

* Tue Oct 11 2005 Paul Howarth <paul@city-fan.org> - 0.8.2-1
- Split off separate qalculate subpackage
- Update to 0.8.2

* Mon Oct 10 2005 Paul Howarth <paul@city-fan.org> - 0.8.1.2-2
- Don't include static libraries
- Include license text
- Don't include README, which only contains a URL
- Include AUTHORS & TODO
- Remove redundant manual dependencies
- Split off separate devel subpackage
- Be more explicit in %%files list
- Add %%post and %%postun scripts to run ldconfig
- Use DESTDIR with make instead of %%makeinstall
- Add buildreqs readline-devel and ncurses-devel

* Wed Oct 05 2005 Deji Akingunola <deji.aking@gmail.com> - 0.8.1.2-1
- Initial package