Summary:	Application which notifies about package updates
Summary(ja): 	パッケージの更新を通知するアプリケーション
Name:		update-watch
Version:	1.1.1
Release: 	3%{?_dist_release}
Source0:	%{name}-%{version}.tar.bz2

License:	GPL
Group:		Applications/System
#URL:		

Requires: 	gambas2-runtime >= 1.9.48
Requires:	gambas2-gb-gui >= 1.9.48
Requires:	gambas2-gb-form >= 1.9.48
Requires:	gambas2-gb-gtk >= 1.9.48
Requires:	gksu
BuildRequires:	gambas2-ide >= 1.9.48
#BuildArch:	noarch
AutoReqProv:	no

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

Packager:	kazutaka


%description
Update-watch will check for the availability of new packages for your
system on a daily basis. When it detects new versions of the packages 
installed on the system are available, it will add an icon on the desktop 
notification area.

This program is developed with Gambas.

If you are using KDE, install gambas2-gb-qt sub package and then
this program switch to use Qt toolkit.

%description -l ja
update-watch は更新可能なパッケージがないか1日1回自動的にチェックします。
システムにインストールされたパッケージのより新しいバージョンを検出すると、
デスクトップの通知エリアにアイコンを表示します。

このプログラムは Gambas で開発されています。

KDE を使っている場合は、gambas2-gb-qt サブパッケージをインストール
すると、ツールキットに Qt が使用されるようになります。

%prep
%setup -q -n update-watch
touch run-apt-update


%build
pushd src/%{name}
%{_bindir}/gbc2 -a -t -p 
%{_bindir}/gba2
popd


%install
%{__rm} -rf ${RPM_BUILD_ROOT}
%{__install} -d ${RPM_BUILD_ROOT}/%{_bindir}
%{__install} -d ${RPM_BUILD_ROOT}/%{_sysconfdir}/apt/apt.conf.d
%{__install} -d ${RPM_BUILD_ROOT}/%{_sysconfdir}/cron.daily
%{__install} -d ${RPM_BUILD_ROOT}/%{_sysconfdir}/rc.d/init.d
%{__install} -d ${RPM_BUILD_ROOT}/%{_sysconfdir}/rc.d/rc0.d
%{__install} -d ${RPM_BUILD_ROOT}/%{_sysconfdir}/rc.d/rc6.d
%{__install} -d ${RPM_BUILD_ROOT}/%{_sysconfdir}/xdg/autostart
%{__install} -d ${RPM_BUILD_ROOT}/%{_prefix}/lib/update-watch
%{__install} -d ${RPM_BUILD_ROOT}/%{_datadir}/apt/scripts
%{__install} -d ${RPM_BUILD_ROOT}/%{_datadir}/pixmaps
%{__install} -d ${RPM_BUILD_ROOT}/%{_localstatedir}/lib/update-watch

%{__install} -m 755 src/%{name}/update-watch.gambas ${RPM_BUILD_ROOT}/%{_bindir}/update-watch
%{__install} -m 644 src/%{name}/%{name}.png         ${RPM_BUILD_ROOT}/%{_datadir}/pixmaps/
%{__install} -m 755 delayed_launch_update-watch.sh  ${RPM_BUILD_ROOT}/%{_bindir}/
%{__install} -m 644 update-watch.conf    ${RPM_BUILD_ROOT}/%{_sysconfdir}/apt/apt.conf.d/
%{__install} -m 755 update-watch.lua     ${RPM_BUILD_ROOT}/%{_datadir}/apt/scripts/
%{__install} -m 755 check-reboot.lua     ${RPM_BUILD_ROOT}/%{_datadir}/apt/scripts/
%{__install} -m 755 check-upgrades.lua   ${RPM_BUILD_ROOT}/%{_prefix}/lib/update-watch/
%{__install} -m 755 apt-update.sh        ${RPM_BUILD_ROOT}/%{_prefix}/lib/update-watch/
%{__install} -m 644 reboot.list          ${RPM_BUILD_ROOT}/%{_prefix}/lib/update-watch/
%{__install} -m 755 update-watch-cleanup ${RPM_BUILD_ROOT}/%{_sysconfdir}/rc.d/init.d
%{__install} -m 755 update-watch.cron    ${RPM_BUILD_ROOT}/%{_sysconfdir}/cron.daily/
%{__install} -m 755 update-watch.desktop ${RPM_BUILD_ROOT}/%{_sysconfdir}/xdg/autostart/
%{__install} -m 644 run-apt-update       ${RPM_BUILD_ROOT}/%{_localstatedir}/lib/update-watch
%{__install} -m 644 update-watch-red.png ${RPM_BUILD_ROOT}/%{_datadir}/pixmaps/

# crete symlink
( cd ${RPM_BUILD_ROOT}/%{_sysconfdir}/rc.d/rc0.d
  %{__ln_s} ../init.d/update-watch-cleanup ./S00update-watch-cleanup
  cd ${RPM_BUILD_ROOT}/%{_sysconfdir}/rc.d/rc6.d
  %{__ln_s} ../init.d/update-watch-cleanup ./S00update-watch-cleanup
)


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


%files
%defattr(-,root,root)
%doc AUTHORS COPYING README ChangeLog help
%{_bindir}/update-watch
%{_bindir}/delayed_launch_update-watch.sh
%{_sysconfdir}/apt/apt.conf.d/update-watch.conf
%{_sysconfdir}/cron.daily/update-watch.cron
%{_sysconfdir}/rc.d/init.d/update-watch-cleanup
%{_sysconfdir}/rc.d/rc0.d/S00update-watch-cleanup
%{_sysconfdir}/rc.d/rc6.d/S00update-watch-cleanup
%{_sysconfdir}/xdg/autostart/update-watch.desktop
%{_prefix}/lib/update-watch
%{_localstatedir}/lib/update-watch
%{_datadir}/apt/scripts/update-watch.lua
%{_datadir}/apt/scripts/check-reboot.lua
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/pixmaps/update-watch-red.png


%changelog
* Mon Jan 18 2010 Kazutaka HARADA <kazutaka@vinelinux.org> 1.1.1-3
- change %%{_libdir} to %%{_prefix}/lib (to use same directory on x86_64) 

* Mon Jan 18 2010 Kazutaka HARADA <kazutaka@vinelinux.org> 1.1.1-2
- remove BuildArch: noarch (<BTS:VineLinux:883>)

* Sun Aug 09 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.1.1-1
- source udpate

* Sat Aug 08 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.1.0-1
- source udpate

* Sun Aug 02 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.0.5-1
- source udpate
- add apt-update.sh in %install: fix for <BTS:VineLinux:0741&0743>

* Tue Jul 28 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.0.4-1
- source update

* Sun Jul 26 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.0.3-1
- source update
- change source archive structure
- add documents

* Thu Jul 23 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.0.2-1
- source update
- change trayicon menu name to "Upgrade all" <BTS:VineLinux:0730>
- update help file (Source11)
- update reboot.list (Source7): add dbus

* Fri Jun 26 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.0.1-1
- source update

* Thu May 07 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.0.0-1
- source update
- add html help file

* Thu May 07 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.5.1-1
- source update

* Mon May 04 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.5.0-1
- source update
- update Source3 (to fix multiple user environment problem)
- add application icon

* Fri Apr 24 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.4.4-1
- source update
- add Packager: kazutaka

* Sat Mar 21 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.4.3-1
- source update
- drop Source21 reboot icons (user stock icon instead) 

* Sun Oct 19 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.4.2-1
- source update
- add icons as Source20 & 21
- add shell script Sourced9 for delayed autostart

* Thu Sep 25 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.4.1-1
- source update

* Thu Jul 31 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.4.0-1
- source update

* Fri Jul 25 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.3.2-1
- source update
- add Source8 (update-watch-cleanup) to fix reboot notification error

* Wed Jul 23 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.3.1-1
- source update
- update Source3 "check-upgrade.lua" to handle allow-duplicated 
  packages correctly

* Mon Jul 21 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.3.0-1
- source update
- update update-watch.conf
- add check-reboot.lua and reboot.list as Source6 & Source7

* Mon Jun 30 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.2.4-1
- source upate

* Mon Jun 23 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.2.3-1
- source upate

* Fri Jun 20 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.2.2-1
- source upate

* Wed Jun 18 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.2.1-1
- source upate

* Wed Jun 18 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.2.0-1
- source upate

* Tue Jun 17 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.1.3-1
- source upate

* Sat Jun 14 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.1.2-2
- change directory of run-apt-update to %%{_localstatedir}/lib/update-watch

* Wed Jun 13 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.1.2-1
- source upate
- add update-watch.desktop to start automatically

* Thu Jun 12 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.1.1-1
- initial build for Vine Linux

