%global _use_internal_dependency_generator 0
%global __find_provides %{nil}
%global __find_requires %{nil}

%define texlivesrcver   20120701
%define texlivever      20120701

%define texlivedir	%{_datadir}/texlive
%define build_texlive_src	%{buildroot}%{texlivedir}-sources

%define pkgname		texlive

Summary: A collection of sources for TeX Live packages
Summary(ja): TeX Live のソース集
Name: texlive-sources
Version: 2012
Release: 1%{?_dist_release}
License: distributable
Group: Applications/Publishing
URL: http://www.tug.org/texlive/

## original TeX Live sources
#Source1: ftp://tug.org/historic/systems/texlive/%{version}/%{pkgname}-%{texlivesrcver}-source.tar.xz
Source2: ftp://tug.org/historic/systems/texlive/%{version}/%{pkgname}-%{texlivever}-texmf.tar.xz
Source3: ftp://tug.org/historic/systems/texlive/%{version}/%{pkgname}-%{texlivever}-extra.tar.xz
# Source4: ftp://tug.org/historic/systems/texlive/%{version}/%{name}-%{texlivever}-bin.tar.xz

#%{?nosrc:NoSource: 1}
%{?nosrc:NoSource: 2}
%{?nosrc:NoSource: 3}
#%{?nosrc:NoSource: 4}

BuildRequires: tar
BuildRequires: xz

BuildArch:	noarch
BuildRoot:	%{_tmppath}/%{name}-%{version}-root

Vendor:       Project Vine
Distribution: Vine Linux
Packager:     munepi

%description
This package is a collection of sources for TeX Live packages. 
It contains 
  %{pkgname}-%{texlivever}-texmf.tar.xz, 
  %{pkgname}-%{texlivever}-extra.tar.xz
on ftp://tug.org/historic/systems/texlive/%{version}/. 

This package is used to build texlive package and its related packages 
of Vine Linux. 


%description -l ja
このパッケージは TeX Live のソース集です。
ftp://tug.org/historic/systems/texlive/%{version}/ 上の
  %{pkgname}-%{texlivever}-texmf.tar.xz, 
  %{pkgname}-%{texlivever}-extra.tar.xz
を含んでいます。

このパッケージは Vine Linux の texlive パッケージやその関連パッケージを
ビルドするために使われます。


%prep
[ -n "%{buildroot}" -a "%{buildroot}" != / ] && %__rm -rf %{buildroot}

%build

%install
[ -n "%{buildroot}" -a "%{buildroot}" != / ] && %__rm -rf %{buildroot}

%__mkdir_p %{build_texlive_src}
(cd %{build_texlive_src}
    # %__mkdir_p source || exit 1
    # %__install -m0644 %{SOURCE1} source/ || exit 1

    %__tar Jxf %{SOURCE2} || exit 1
    %__mv %{pkgname}-%{texlivever}-texmf/* . || exit 1
    %__tar Jxf %{SOURCE3} || exit 1
    %__mv %{pkgname}-%{texlivever}-extra/* . || exit 1

    %__rm -r %{pkgname}-%{texlivever}-{texmf,extra} || exit 1
)

%clean
%__rm -rf %{buildroot}

%files
%defattr(-,root,root)
%{texlivedir}-sources

%changelog
* Sat Aug 11 2012 Munehiro Yamamoto <munepi@vinelinux.org> 2012-1
- updated to TeX Live 2012

* Sun Oct 30 2011 Munehiro Yamamoto <munepi@vinelinux.org> 2011-1
- updated to TeX Live 2011

* Sat Nov 06 2010 Munehiro Yamamoto <munepi@vinelinux.org> 2009-2
- supported Vine Linux 5

* Sun May 09 2010 Munehiro Yamamoto <munepi@vinelinux.org> 2009-1
- TeX Live 2009
