# Copyright (c) 2008 oc2pus
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments to toni@links2linux.de
#
# *** This spec is modified for Vine Linux ***

# norootforbuild

%define _prefix	/usr
# %define _SO_nr	0

Name:			libzen
Version:		0.4.31
Release:		1%{?_dist_release}
Summary:		Shared library for libmediainfo and medianfo-*
Summary(ja):		libmediainfo 及び mediainfo-* 用の共有ライブラリ
Group:			System Environment/Libraries
License:		BSD
URL:			http://zenlib.sourceforge.net/
Source:			http://mediaarea.net/download/source/libzen/0.4.31/libzen_%{version}.tar.bz2
BuildRoot:		%{_tmppath}/%{name}-%{version}-root
# BuildRequires:		dos2unix
BuildRequires:		nkf
BuildRequires:		doxygen
## Need GCC3
BuildRequires:		gcc-c++

Packager:		babasaki

%description
Shared library for libmediainfo and medianfo-*.

%description -l ja
libmediainfo 及び mediainfo-* 用の共有ライブラリです。

%package -n libzen-devel
Summary:	Include files and mandatory libraries for development
Summary(ja):	libzen の開発用のヘッダとライブラリファイル
Group:		Development/Libraries
Requires:	%{name} = %{version}-%{release}

%description -n libzen-devel
Include files and mandatory libraries for development.

%description -n libzen-devel -l ja
libzen の開発用のヘッダとライブラリファイルです。

%prep
%setup -q -n ZenLib
## dos2unix     *.txt Source/Doc/*.html
nkf --unix --overwrite *.txt Source/Doc/*.html

%__chmod 644 *.txt Source/Doc/*.html

%build
export CFLAGS="$RPM_OPT_FLAGS"
export CPPFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS"

pushd Source/Doc/
	doxygen Doxyfile
popd
cp Source/Doc/*.html ./

pushd Project/GNU/Library
	%__chmod +x autogen
	./autogen
	%configure --enable-shared --disable-static

	%__make clean
	%__make %{?jobs:-j%{jobs}}
popd

%install
pushd Project/GNU/Library
	%__make install-strip DESTDIR=%{buildroot}
popd

# Zenlib headers and ZenLib-config
%__install -dm 755 %{buildroot}%{_includedir}/ZenLib
%__install -m 644 Source/ZenLib/*.h \
	%{buildroot}%{_includedir}/ZenLib
for i in Base64 HTTP_Client Format/Html Format/Http TinyXml; do
	%__install -dm 755 %{buildroot}%{_includedir}/ZenLib/$i
#	%__install -m 644 Source/ZenLib/$i/*.h \
#		%{buildroot}%{_includedir}/ZenLib/$i
done

%__sed -i -e 's|Version: |Version: %{version}|g' \
	Project/GNU/Library/libzen.pc
%__install -dm 755 %{buildroot}%{_libdir}/pkgconfig
%__install -m 644 Project/GNU/Library/libzen.pc \
	%{buildroot}%{_libdir}/pkgconfig

# remove unpackaged files
rm -f ${RPM_BUILD_ROOT}/%{_libdir}/*.la


%clean
[ -d "%{buildroot}" -a "%{buildroot}" != "" ] && %__rm -rf "%{buildroot}"

%post -n libzen -p /sbin/ldconfig

%postun -n libzen -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc History.txt License.txt ReadMe.txt
%{_libdir}/libzen.so.*

%files -n libzen-devel
%defattr(-,root,root,-)
%doc Documentation.html
%doc Doc/*
%{_bindir}/libzen-config
%dir %{_includedir}/ZenLib
%{_includedir}/ZenLib/*
%{_libdir}/libzen.so
%{_libdir}/pkgconfig/*.pc

%changelog
* Tue May 12 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 0.4.31-1
- new upstream release

* Mon Oct 14 2013 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.4.29-1
- new upstream release

* Sat Sep 15 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.4.28-1
- new upstream release

* Sun May 13 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.4.26-1
- new upstream release

* Sun Jan 15 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.4.23-1
- new upstream release

* Tue Sep 27 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.4.22-1
- new upstream release

* Fri Jul 15 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.4.20-1
- new upstream release

* Sat Dec 25 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.4.17-1
- new upstream release

* Mon Sep 27 2010 Shu KONNO <owa@bg.wakwak.com> 0.4.15-4
- rebuilt with rpm-4.8.1 for pkg-config

* Sat Aug 28 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.4.15-3
- fixed Group to System Environment/Libraries

* Sat Jul 24 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.4.15-2
- fix %install (add install directory)

* Tue Jun 15 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.4.15-1
- new upstream release

* Tue Jul 28 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.4.3-1
- new upstream release
- change spec file name to libzen-vl.spec
- add japanese summary and description
- change group for -devel sub package to Development/Libraries
- add configure option --disable-static
- remove unpackaged file (.la)
- add Packager tag

* Thu Jan 01 2009 Jerome Martinez <zen@mediaarea.net> - 0.3.6-0
- See History.txt for more info and real dates
- Previous packages made by Toni Graffy <toni@links2linux.de>
