%define pkg_version	2.2.0
%define pkg_release	1%{?_dist_release}

Summary:	A GTK+ based user interface for cron and at
Summary(ja): 	cron と at 用の GUI 設定ツール
Name:		gnome-schedule
Version:	%{pkg_version}
Release: 	%{pkg_release}
Source0:	%{name}-%{version}.tar.gz
Source1:	gnome-schedule.desktop
Source2:	gnome-schedule-2.0.2-ja.po
Source3:	gnome-schedule-2.0.2-ja.mo
License:	GPL
Group:		Applications/System
URL:		http://gnome-schedule.sourceforge.net/

Requires:	pygtk2 > 2.3, pygtk2-libglade, gnome-python
Requires:	at, vixie-cron, scrollkeeper
BuildRequires:	pygtk2-devel > 2.3, pygtk2-libglade
BuildRequires:at, vixie-cron, gnome-doc-utils

%if %{?_dist_release} == vl4
Requires:	gnome-python-extras
BuildRequires:	gnome-python-extras
%else
BuildRequires:	gnome-python-devel
%endif


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

Packager:	kazutaka

%description
Gnome Schedule is a graphical user interface for creating,
modifying, and deleting cron and at jobs.

%description -l ja
Gnome Schedule は、cron や at で実行するジョブを GUI から
登録・変更・削除できるツールです。


%prep

%setup -q


%build
%configure --disable-scrollkeeper
%{__make}


%install
%{__rm} -rf ${RPM_BUILD_ROOT}
%{__make} install DESTDIR=$RPM_BUILD_ROOT
%{__cp} -f %{SOURCE1} ${RPM_BUILD_ROOT}/%{_datadir}/applications/gnome-schedule.desktop

# install japanese message catalog
%{__install} -d -m755 ${RPM_BUILD_ROOT}/%{_datadir}/locale/ja
%{__install} -d -m755 ${RPM_BUILD_ROOT}/%{_datadir}/locale/ja/LC_MESSAGES
%{__install} -m644 %{SOURCE3} ${RPM_BUILD_ROOT}/%{_datadir}/locale/ja/LC_MESSAGES/gnome-schedule.mo

%find_lang %{name}

%post
scrollkeeper-update > /dev/null 2>&1 || :

%postun
scrollkeeper-update > /dev/null 2>&1 || :


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


%files -f %{name}.lang
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README TODO
%{_bindir}/gnome-schedule
%{_bindir}/gnome-schedule-export
%{_bindir}/gnome-schedule-import
%{_datadir}/gnome-schedule
%{_datadir}/gnome/help/gnome-schedule
%{_datadir}/omf/gnome-schedule
%{_datadir}/pixmaps/gnome-schedule
%{_datadir}/applications/gnome-schedule.desktop

%changelog
* Tue Jun 26 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 2.2.0-1
- new upstream release
- deleted Requires: gnome-python-applet and BuildRequires:gnome-python-applet

* Fri Apr 29 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.0.2-3
- rebuild with rpm-4.8.1

* Mon May 11 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 2.0.2-2
- spec in utf-8 (only for VineSeed/Vine 5.0)

* Mon Apr 14 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 2.0.2-1
- initial build for Vine Linux
