Sophie

Sophie

distrib > Mandriva > 2006.0 > x86_64 > by-pkgid > cb5a914e1b4e742c516ae3f0084bd8a9 > files > 4

helixplayer-1.0.5-1mdk.src.rpm


%define name	helixplayer
%define version	1.0.5
%define release	1mdk

Name:		%{name}
Version:	%{version}
Release:	%{release}
Summary:	A multimedia player
Source0:	hxplay-1.0.5-source.tar.bz2
Patch0:		helixplayer-1.0.5-fix-include.patch.bz2
# imported from fedora
Patch1:		HelixPlayer-1.0.3-disable-asm.patch.bz2
Patch2:		helixplayer-1.0.5-gcc4-detection-fix.patch.bz2
License:	GPL
Group:		Video
Url:		http://www.helixcommunity.org
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires:	libtheora-devel
BuildRequires:	libogg-devel
BuildRequires:	gtk+2-devel >= 2.2.0
BuildRequires:	libalsa-devel
BuildRequires: 	X11-devel
BuildRequires:  libvorbis-devel
BuildRequires:  python
Requires:	helixplayer-codecs = %{version}

%description
The Helix Player is the Helix Community's open source media player for 
consumers. It is being developed to have a rich and usable graphical 
interface and support a variety of open media formats like Ogg Vorbis, 
Theora etc.

%package mozilla-plugin
Summary:	Mozilla plugin for %{name}
Group:		Networking/WWW
Requires:	%{name} == %{version}
Requires:	mozilla
%description mozilla-plugin
Mozilla plugin for %{name}.

%package helix-codecs
Summary:	Codecs pack for %{name}
Group:		Video
Requires:	%{name}
Provides:	helixplayer-codecs = %{version}
%description helix-codecs
Codecs pack for %{name}

%prep
%setup -q -n hxplay-1.0.5
%patch0
%patch1 -p1
%patch2
%build
echo 'SetSDKPath("oggvorbissdk", "/usr")' > buildrc
export BUILDRC=./buildrc
echo $BUILDRC
%make

# for the %doc section.
cp ./player/installer/archive/temp/{README,LICENSE} ./

%install
rm -rf $RPM_BUILD_ROOT

# this build system leave the program in: 
# %buildroot/player/installer/archive/temp

# preparing directory structure
install -d -m 755 $RPM_BUILD_ROOT%{_bindir}
install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}
install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/plugins
install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/lib
install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/share
install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/share/default
install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/share/hxplay
install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/common
install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/codecs
install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/share/locale
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/locale

# Let's go !

# since all that we want to install is in this directory ...
cd player/installer/archive/temp

# install and correct the .mo, populate the %name.lang with locale files
rm -f  ../../../../%name.lang
cd share/locale
for i in *; do \
( install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/locale/$i; \
  install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/share/locale/$i
  install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/locale/$i/LC_MESSAGES ; \
  install -m 644 $i/*.mo -D $RPM_BUILD_ROOT%{_datadir}/locale/$i/LC_MESSAGES ;\
  mv $RPM_BUILD_ROOT%{_datadir}/locale/$i/LC_MESSAGES/player.mo $RPM_BUILD_ROOT%{_datadir}/locale/$i/LC_MESSAGES/hxplay.mo ; \
  mv $RPM_BUILD_ROOT%{_datadir}/locale/$i/LC_MESSAGES/widget.mo $RPM_BUILD_ROOT%{_datadir}/locale/$i/LC_MESSAGES/libgtkhx.mo; \
  if [ -f $i/README ]; then \
	install -m 644 $i/README $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/share/locale/$i/README ; \
	echo "%{_libdir}/%{name}-%{version}/share/locale/$i/README" >> ../../../../../../%name.lang ; \
  fi; \
  if [ -f $i/LICENSE ]; then \
	install -m 644 $i/LICENSE $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/share/locale/$i/LICENSE ; \
	echo "%{_libdir}/%{name}-%{version}/share/locale/$i/LICENSE" >> ../../../../../../%name.lang ; \
  fi; \
  echo "%dir %{_libdir}/%{name}-%{version}/share/locale/$i" >> ../../../../../../%name.lang; )
done

cd ../..

# get locale
%find_lang hxplay
%find_lang libgtkhx
# add locale files to dir.
cat hxplay.lang libgtkhx.lang >> ../../../../%name.lang

# Set the HELIX_LIBS var in the script:

perl -pi -e 's|# HELIX_LIBS="/usr/local/HelixPlayer"|HELIX_LIBS=%{_libdir}/%{name}-%{version}|' hxplay

install -m755 {hxplay.bin,hxplay} -D $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}
install -m755 lib/libgtkhx.so -D  $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/lib/libgtkhx.so
install -m755 plugins/*.so -D $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/plugins
install -m755 common/*.so -D $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/common
install -m644 share/hxplay/*.png -D $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/share/hxplay
install -m644 share/default/*.png -D $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/share/default


# Create the link in %{_bindir} ( hxplay binary must be in his directory with 
# plugin and ressources
ln -s %{_libdir}/%{name}-%{version}/hxplay $RPM_BUILD_ROOT%{_bindir}/hxplay

# mozilla plugin
install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/mozilla/plugins
install -m755 mozilla/* -D $RPM_BUILD_ROOT%{_libdir}/mozilla/plugins

# codecs
install -m755 codecs/*.so -D $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/codecs
install -m755 plugins/*.so -D $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/plugins
install -m755 common/*.so -D $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/common


# Menu icons
install -m644 share/icons/hxplay_16x16.png -D $RPM_BUILD_ROOT%{_miconsdir}/%{name}.png
install -m644 share/icons/hxplay_32x32.png -D $RPM_BUILD_ROOT%{_iconsdir}/%{name}.png
install -m644 share/icons/hxplay_48x48.png -D $RPM_BUILD_ROOT%{_liconsdir}/%{name}.png

# menu entries
mkdir -p  $RPM_BUILD_ROOT%{_menudir}
cat << EOF > $RPM_BUILD_ROOT%{_menudir}/%{name}
?package(%{name}):command="/usr/bin/hxplay" \
icon="helixplayer.png" needs="X11"\
section="Multimedia/Video" startup_notify="false" \
title="HelixPlayer" longtitle="A multimedia player" \
mimetypes="application/x-ogg,application/ogg,text/vnd.rn-realtext,image/vnd.rn-realpix,application/smil,application/streamingmedia,application/sdp,video/3gpp,video/3gpp-encrypted,audio/3gpp,audio/3gpp-encrypted,audio/amr,audio/amr-encrypted,audio/amr-wb,audio/amr-wb-encrypted,audio/x-rn-3gpp-amr,audio/x-rn-3gpp-amr-encrypted,audio/x-rn-3gpp-amr-wb,audio/x-rn-3gpp-amr-wb-encrypted,video/3gpp2,audio/3gpp2" accept_url="true" \
multiple_files="true"
EOF

%post
%{update_menus}

%postun
%{clean_menus}


%clean
rm -rf $RPM_BUILD_ROOT

%files -f %name.lang
%defattr(-,root,root)
%doc README LICENSE

%dir %{_libdir}/%{name}-%{version}
%dir %{_libdir}/%{name}-%{version}/share
%dir %{_libdir}/%{name}-%{version}/lib
%dir %{_libdir}/%{name}-%{version}/common
%dir %{_libdir}/%{name}-%{version}/plugins
%dir %{_libdir}/%{name}-%{version}/codecs
%dir %{_libdir}/%{name}-%{version}/share/default
%dir %{_libdir}/%{name}-%{version}/share/hxplay
%dir %{_libdir}/%{name}-%{version}/share/locale

%{_libdir}/%{name}-%{version}/hxplay
%{_libdir}/%{name}-%{version}/hxplay.bin
%{_libdir}/%{name}-%{version}/share/default/*
%{_libdir}/%{name}-%{version}/share/hxplay/*
%{_libdir}/%{name}-%{version}/lib/*
%{_bindir}/hxplay

#menu stuff
%{_menudir}/%{name}
%{_miconsdir}/%{name}.png
%{_iconsdir}/%{name}.png
%{_liconsdir}/%{name}.png

# Mozilla plugin
%files mozilla-plugin
%defattr(-,root,root)
%{_libdir}/mozilla/plugins/*

# Codecs
%files helix-codecs
%defattr(-,root,root)
%{_libdir}/%{name}-%{version}/common/*
%{_libdir}/%{name}-%{version}/plugins/*
%{_libdir}/%{name}-%{version}/codecs/*


%changelog
* Mon Jul 04 2005 Couriousous <couriousous@mandriva.org> 1.0.5-1mdk
- 1.0.5 ( security bugfix )
- Disable asm, as gcc4 won't build it

* Wed Apr 20 2005 Couriousous <couriousous@mandriva.org> 1.0.4.752-1mdk
- 1.0.4

* Thu Mar 03 2005 Couriousous <couriousous@mandrake.org> 1.0.3.749-1mdk
- 1.0.3

* Fri Dec 17 2004 Couriousous <couriousous@mandrake.org> 1.0.2.610-1mdk
- 1.0.2 Final
- Drop patch0, bug corrected upstream

* Tue Sep 30 2004 Couriousous <couriousous@zarb.org> 1.0.1.436-1mdk
- Set HELIX_LIBS in hxplay script
- 1.0.1 Final
- Drop mmx-patch, merged upstream
- Patch to fix locale ( thanks gc for the tip )
- Fix require and provide

* Fri Sep 17 2004 Couriousous <couriousous@zarb.org> 1.0.1.407-0.20040916.1mdk
- Sync with CVS
- Split codecs and player in two packages

* Mon Aug 16 2004 Couriousous <couriousous@zarb.org> 1.0.0.298-2mdk
- Create the symlink in the %%install section ( I sux )
- Fix Buildrequires

* Sat Aug 07 2004 Couriousous <couriousous@zarb.org> 1.0.0.298-1mdk
- First Mandrakelinux release