%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

Summary:	Simple scripting language for Web browsing
Summary(ja): 	ウェブ・ブラウジング用のシンプルなスクリプト言語
Name:		python-twill
Version:	0.9
Release: 	4%{?_dist_release}
Source0:	http://darcs.idyll.org/~t/projects/twill-%{version}.tar.gz
License:	MIT
Group:		Applications/Internet
URL:		http://twill.idyll.org/

Requires:	python, python-clientform
Requires:	python-mechanize, pyparsing
BuildRequires:	python-devel python-setuptools
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildArch:	noarch

Vendor: Project Vine
Distribution: Vine Linux
Packager: Takemikaduchi

%description
twill is a simple language that allows users to browse the Web from
a command-line interface. 
With twill, you can navigate through Web sites that use forms, cookies,
and most standard Web features.

%description -l ja
twill はコマンドライン・インターフェースからウェブ・ブラウジングを可能に
するシンプルな言語です。
twill を使うことで、フォームやクッキー等の標準的なウェブで使用される要素
を操作できます。


%prep
%setup -q -n twill-%{version}
# Don't use the included mechanize, pyparsing, ClientForm or subprocess
#%{__rm} -rf twill/other_packages/_mechanize_dist/


%build
%{__python} setup.py build


%install
%{__rm} -rf ${RPM_BUILD_ROOT}
%{__python} setup.py install -O1 --skip-build \
            --root ${RPM_BUILD_ROOT} \
            --single-version-externally-managed


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


%files
%defattr(-,root,root)
%doc README.txt doc/LICENSE.txt doc/ANNOUNCE-*.txt
%doc doc/index.txt doc/examples.txt doc/browsing.txt doc/commands.txt
%doc doc/ChangeLog doc/developer.txt doc/advocacy/simple-example.txt
%doc doc/extensions.txt doc/python-api.txt doc/other.txt doc/testing.txt
%{python_sitelib}/twill/
%{python_sitelib}/twill-*.egg-info/
%{_bindir}/twill-fork
%{_bindir}/twill-sh


%changelog
* Sun Jan 12 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9-4
- rebuild with VineSeed environment

* Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9-3
- rebuild with python-2.7.2

* Tue Feb 02 2010 Shu KONNO <owa@bg.wakwak.com> 0.9-2
- rebuild with python-2.6

* Sun Dec 28 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.9-1
- initial build for Vine Linux
