Sophie

Sophie

distrib > Mandriva > 9.2 > i586 > by-pkgid > 7f86227ad272ec55bdd3c2ef8236535e > files > 2

sancho-gui-0.9.4.58-2plf2008.1.src.rpm

%define name		sancho-gui
%define pname		sancho
%define oversion 	0.9.4
%define revision 	58
%define rel 		2
%define release 	%mkrel %rel
%define distsuffix 	plf
%define Summary		Sancho is a gui for p2p core applications (currently mldonkey!)

%define programname 	%{name}-%{oversion}-%{revision}
%define programdir 	%{_libdir}/%{programname}

%define major 		2
%define libname 	%mklibname %name %major

# (12/2007) Do not provide libcairo.so and co
%define _provides_exceptions \\.so

Summary:	%{Summary}
Name:		%{name}
Version:	%{oversion}.%{revision}
Release:	%{release}
Source0:	http://sancho-gui.sourceforge.net/files/2i1btbzopawiz/%{pname}-%{oversion}-%{revision}-linux-gtk.sh
License:	LGPL
Url:		http://sancho-gui.sourceforge.net/
Group:		Networking/File transfer
BuildRoot:	%{_tmppath}/%{name}-%{oversion}.%{revision}-%{release}-buildroot
BuildRequires:	chrpath ImageMagick
Requires:	%{libname} = %{version}-%{release}

%description
Sancho is a gui that connects to a p2p core application. Power
users that use p2p applications usually choose one that has
core/gui separation. Sancho provides an easy to use, powerful,
and configurable gui, currently supporting the gui protocol of
the popular mldonkey core.

The sancho project is written for fun, but also to test some new
and exciting technologies. It is written in Java using the SWT
widget toolkit and can be compiled on multiple platforms with
the gcj compiler to native machine code (java=slow and bulky?
not anymore! no external java runtime required!). Windows, Linux,
OSX and other popular operating systems are supported.

This package is in PLF because it's a p2p application.


%package -n %{libname}
Summary:	Libraries needed by %name
Group:		Development/Java
AutoReq:	No
Requires:	%{name} = %{version}-%{release}


%description -n %{libname}
Libraries needed by %name

This package is in PLF because it's a p2p application.

%prep
sh %{SOURCE0} --tar xf
%build

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{programdir}

chrpath -d sancho

convert distrib/sancho-16.xpm sancho-16.png
convert distrib/sancho-32.xpm sancho-32.png
convert distrib/sancho-48.xpm sancho-48.png

rm -rf distrib/preview.sh
rm -rf distrib/preview.bat
mv distrib/{AUTHORS,ChangeLog,CPL.txt,LGPL.txt,LICENSE.txt,README} .

cp -R lib distrib $RPM_BUILD_ROOT/%{programdir}
cp sancho $RPM_BUILD_ROOT/%{programdir}/sancho-bin


cat <<EOF > %{buildroot}/%{programdir}/distrib/preview.sh
#!/bin/sh
/usr/bin/mplayer /mnt/work/mldonkey/tmp/\$1
EOF


cat <<EOF > %{buildroot}/%{programdir}/sancho
#!/bin/sh
cd %{programdir}/distrib
%{programdir}/sancho-bin "\$@"
EOF


chmod 755 %{buildroot}/%{programdir}/sancho
chmod 755 %{buildroot}/%{programdir}/sancho-bin
chmod 755 %{buildroot}/%{programdir}/distrib/preview.sh
chmod 755 %{buildroot}/%{programdir}/distrib/sendalltorrents


install -d %{buildroot}/%{_menudir}
cat <<EOF > %{buildroot}/%{_menudir}/%{name}
?package(%{name}):command="%{_bindir}/%{name}" \
		icon=%{name}.png \
		needs="x11" \
		section="Internet/File Transfer" \
		title="Sancho"\
		longtitle="%{Summary}" xdg="true"
EOF

mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
cat > $RPM_BUILD_ROOT%{_datadir}/applications/mandriva-%{name}.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=Sancho
Comment=%{Summary}
Exec=%{_bindir}/%{name}
Icon=%{name}
Terminal=false
Type=Application
StartupNotify=true
Categories=GTK;FileTransfer;P2P;X-MandrivaLinux-Internet-FileTransfer;
EOF

install -m644 sancho-16.png -D $RPM_BUILD_ROOT%{_miconsdir}/%{name}.png
install -m644 sancho-32.png -D $RPM_BUILD_ROOT%{_iconsdir}/%{name}.png
install -m644 sancho-48.png -D $RPM_BUILD_ROOT%{_liconsdir}/%{name}.png

install -d %{buildroot}/%{_bindir}
ln -s %{programdir}/sancho %{buildroot}/%{_bindir}/%{name}

%post
%update_menus

%postun
%clean_menus

%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog CPL.txt LGPL.txt LICENSE.txt README 
%{programdir}/distrib/*
%{programdir}/sancho*
%{_datadir}/applications/mandriva*
%{_bindir}/%{name}
%{_menudir}/%{name}
%{_iconsdir}/%{name}.png
%{_liconsdir}/%{name}.png
%{_miconsdir}/%{name}.png


%files -n %{libname}
%defattr(-,root,root)
%{programdir}/lib/*


%changelog
* Tue Dec 25 2007 Anssi Hannula <anssi@zarb.org> 0.9.4.58.2plf2008.1
- do not provide libcairo.so.2 and co, they are private

* Tue Feb 20 2007 Javier Rodas <jrodas@zarb.org> 0.9.4.58-1plf2007.1
- 0.9.4.58
- 2007.1
- Source0 changed, it's now .sh

* Sun Sep 17 2006 Javier Rodas <jrodas@zarb.org> 0.9.4.57-1plf2007.0
- XDG menu
- RPATH deleted from "sancho-bin" file with "chrpath -d"
- "sancho" and "preview.sh" scripts are dynamically created (to solve library path references)
- "sancho2" script deleted (not needed anymore)
- Initial release