%define appsdir	%{_datadir}/rox-filer

Name:		rox-filer
Version:	2.11
Release:        2%{?_dist_release}
Summary:	A fast and powerful graphical file manager
Group:		User Interface/Desktops
License:	GPL
URL:		http://rox.sourceforge.net
Source:		http://downloads.sourceforge.net/rox/%{name}-%{version}.tar.bz2
##Source1:	http://downloads.sourceforge.net/rox/Wrappers-%{wrappers_ver}.tgz
Source3:	ja-2.11-1.po
#Source5:	Wrappers-item2.tgz
#Source6:	eucjp.h
Source7:	rox-ja.1
Source10:	rox-filer.png
#Source20:       rox-index.html
Source21:       rox-welcome
Source22:       rox-welcome.sh
Source23:       rox-info
Source24:       rox-images.tar.bz2
Source30:       rox-welcome.tar.bz2

#Patch10:       rox-filer-2.7-AppRun.patch
#Patch11:       rox-filer-2.7-eucJP.patch
Patch20:        rox-filer-appinfo.patch
Patch30:        rox-update-po.patch
Patch31:        rox-apprun.patch
Requires:	shared-mime-info >= 0.16
Requires:	gtk2 >= 2.4.0, libglade2 >= 2.0.2
Requires:	nkf
%if %{?_dist_release} == "vl5"
#Requires:	pixman
%endif
BuildRequires:	libxml2-devel >= 2.0.0
BuildRequires:	glib2-devel >= 2.4.0
BuildRequires:	gtk2-devel >= 2.4.0 libglade2-devel >= 2.0.0
BuildRequires:	libSM-devel
BuildRequires:	shared-mime-info >= 0.16
%if %{?_dist_release} == "vl5"
#BuildRequires:	pixman-devel
%endif
Conflicts:	rox-base
Obsoletes:	rox
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
Packager:	OKATANA <mkato@par.odn.ne.jp,mosaicist@par.odn.ne.jp>

%description
ROX-Filer is a fast, powerful, and easy to use graphical file
manager. It has full support for drag-and-drop and application
directories.  The filer can also provide a pinboard (allowing you to pin
up files on your desktop background) and panels.  The emphasis is on
uncluttered directory views; menus and prompts only appear when needed.

%description -l ja
ROX-Filer は高速、パワフルかつ使い易い GUI ファイルマネージャで、高度なドラッグ
 & ドロップ機能やサービスを提供します。
また、ピンボード(デスクトップ機能をサポートしていないウィンドウ・マネージャ上で
も、ルートウィンドウにアイコンを張り付け可能にします)とパネル(タスク・バー)を利
用可能にします。
すっきりとしたディレクトリ表示と、必要な時だけのメニューやプロンプトの表示が大
きな特徴です。

%prep
%setup -q -a 0 -a 30
%__cp %{SOURCE3} ROX-Filer/src/po/ja.po
#%__cp %{SOURCE6} ROX-Filer/src/
%__cp %{SOURCE7} .
#%__tar zxvf %{SOURCE5}
#%__install -m 644 %{SOURCE20}  ROX-Filer/Help/index.html
pushd ROX-Filer/Help
  tar jxf %{SOURCE24}
popd

#%patch10 -p1
#%patch11 -p1
%patch20 -p1
%patch30 -p1
%patch31 -p1

%build

pushd ROX-Filer/src/po
./update-po
./make-mo ja
popd

export CFLAGS="%{optflags}"
ROX-Filer/AppRun --compile

%__rm -rf ROX-Filer/src
%__rm -rf ROX-Filer/build


%install
%__rm -rf %{buildroot}

# make install directorys
%__mkdir -p %{buildroot}%{appsdir}
%__mkdir -p %{buildroot}%{_bindir}
%__mkdir -p %{buildroot}%{_mandir}/man1
%__mkdir -p %{buildroot}%{_mandir}/ja/man1
%__mkdir -p %{buildroot}%{_datadir}/mime/packages

# ROX-Filer
%__cp -a ROX-Filer %{buildroot}%{appsdir}/
%__cp -a Welcome %{buildroot}%{appsdir}/
# manpage
%__install -m 644 rox.1 %{buildroot}%{_mandir}/man1/
( cd %{buildroot}%{_mandir}/man1 ; %__ln_s rox.1 ROX-Filer.1 )
%__install -m 644 rox-ja.1 %{buildroot}%{_mandir}/ja/man1/rox.1
( cd %{buildroot}%{_mandir}/ja/man1 ; %__ln_s rox.1 ROX-Filer.1 )

# scripts
%__cat << EOF > %{buildroot}%{_bindir}/rox
#! /bin/sh
rox-welcome -c &
exec %{appsdir}/ROX-Filer/AppRun "\$@"
EOF
%__chmod a+x %{buildroot}%{_bindir}/rox
%__install -m 755 %{SOURCE21} %{SOURCE22} %{SOURCE23} %{buildroot}%{_bindir}/

# mime-info
%__install -m 644 rox.xml %{buildroot}%{_datadir}/mime/packages/
%__cp -a Choices %{buildroot}%{_datadir}/

# icons
%__mkdir -p %{buildroot}%{_datadir}/pixmaps
%__install -m 644 %{SOURCE10} %{buildroot}%{_datadir}/pixmaps/
%__mkdir -p %{buildroot}%{_datadir}/%{name}p
%__install -m 644 %{SOURCE10} %{buildroot}%{_datadir}/%{name}/.DirIcon

# desktop entry
%__mkdir -p %{buildroot}%{_datadir}/applications
%__cat > %{buildroot}%{_datadir}/applications/%{name}.desktop <<EOF
[Desktop Entry]
Name=ROX Filer
Name[ja]=ROX ファイラー
Comment=ROX Filer
Comment[ja]=軽量ファイルマネージャ
Exec=rox
Icon=/usr/share/pixmaps/rox-filer.png
Terminal=false
MultipleArgs=false
Type=Application
Categories=Application;FileManager;Utility;
EOF

%post
if [ -d %{_prefix}/apps/AppsConf ] ; then
    rm -rf %{_prefix}/apps/AppsConf
fi
%{_bindir}/update-mime-database %{_datadir}/mime >& /dev/null

%clean
%__rm -rf %{buildroot}

%files
%defattr (-,root,root)
%doc README*
%{_bindir}/*
%{_mandir}/*/*
%{_datadir}/pixmaps/*
%{_datadir}/mime/packages/*
%{_datadir}/applications/%{name}.desktop
%dir
%defattr (-,root,root)
%{appsdir}
%{_datadir}/Choices

%changelog
* Sun Oct 30 2011 TANAKA hiroaki <mosaicist@par.odn.ne.jp> 2.11-2
-     ROX-Filer maintenance team OKATANA(KATO Masashi, TANAKA hiroaki)
- update welcome message
- update welcome manual


* Tue Oct 18 2011 TANAKA hiroaki <mosaicist@par.odn.ne.jp> 2.11
-     ROX-Filer maintenance team OKATANA(KATO Masashi, TANAKA hiroaki)
- upstream update
- new ja.po

* Fri Feb  5 2010 KATO Masashi <mkato@par.odn.ne.jp> 2.10-2
-     ROX-Filer maintenance team OKATANA(KATO Masashi, TANAKA hiroaki)
- added BuildRequires:	shared-mime-info
- added Welcome AppDir(Source30 rox-welcome.tar.bz2: Replacement of Source20)

* Sat Sep 12 2009 KATO Masashi <mkato@par.odn.ne.jp> 2.10-1
-     ROX-Filer maintenance team OKATANA(KATO Masashi, TANAKA hiroaki)
- upstream update
- added documents
- added welcome message
- changed system directory to /usr/share/rox-filer

* Thu Jul 23 2009 OKATANA <mkato@par.odn.ne.jp,mosaicist@par.odn.ne.jp> 2.9-2
- moved /usr/apps to /usr/share/rox-filer
- droped wrappers-1.0.3 files

* Tue Jun  9 2009 OKATANA <mkato@par.odn.ne.jp,mosaicist@par.odn.ne.jp> 2.9-1
- upstream update
- update ja.po

* Tue May 27 2008 OKATANA <mkato@par.odn.ne.jp,mosaicist@par.odn.ne.jp> 2.8-1vl5
- new Requires: pixman
- new BuildRequires: pixman-devel
- upstream update
- update ja.po

* Tue Jan 29 2008 OKATANA <mkato@par.odn.ne.jp,mosaicist@par.odn.ne.jp> 2.7.1-jp1.0
- rebuild from 2.7.1-0v1

* Mon Jan 21 2008 OKATANA <mkato@par.odn.ne.jp,mosaicist@par.odn.ne.jp> 2.7.1-0vl1,2 
- upstream bug fix
- remove patches

* Mon Dec 31 2007 OKATANA <mkato@par.odn.ne.jp,mosaicist@par.odn.ne.jp> 2.7-0vl1,2
- upstream update
- update ja.po
- add patches
-   (AppRun, appmenu.c, dnd.c, main.c, menu.c, minibuffer.c, run.c)
-   (for eucJP environment)
- add japanese manpage

* Wed Jun 20 2007 OKATANA <mkato@par.odn.ne.jp,mosaicist@par.odn.ne.jp> 2.6.1-0vl1,2
- upstream update
- update ja.po
- remove obsolete patch

* Tue May 22 2007  OKATANA <mkato@par.odn.ne.jp,mosaicist@par.odn.ne.jp> 2.6-jp1.0
- rebuild from 2.6-0vl

* Tue Apr  3 2007 OKATANA <mkato@par.odn.ne.jp,mosaicist@par.odn.ne.jp> 2.6-0vl1,2
- update ja.po
- upstream update

* Sun Aug  6 2006 OKATANA <mkato@par.odn.ne.jp,mosaicist@par.odn.ne.jp> 2.5-0vl1,2
- change package name following upstream
- update ja.po

* Fri Jan 6 2006 OKATANA <mkato@par.odn.ne.jp,mosaicist@par.odn.ne.jp> 2.4.1-0vl1
- upstream update

* Wed Nov 5 2005 OKATANA <mkato@par.odn.ne.jp,mosaicist@par.odn.ne.jp>2.3-jp1.1
- update patch (fix ja.po mistranslate)

* Fri Sep 23 2005 OKATANA <mkato@par.odn.ne.jp,mosaicist@par.odn.ne.jp> 2.3-0vl1
- upstream update

* Sun Mar  6 2005 OKATANA <mkato@par.odn.ne.jp,mosaicist@par.odn.ne.jp> 2.2.0-0vl1
- upstream update
- update patch (fix problems of 'cannot translate sone messages')
- add some apps to Wrappers

* Thu Jan 13 2005 OKATANA <mkato@par.odn.ne.jp,mosaicist@par.odn.ne.jp> 2.1.4
- New version
- include New ja.po
- add New patch
      (fix problems of 'cannot translate sone messages')
- add Wrappers-plus

* Sun Mar 09 2003 OKATANA <mkato@par.odn.ne.jp,mosaicist@par.odn.ne.jp> 1.2.2-1-0vl1
- add jp.po
- (with Japanese runtime messages version)
