File vlc-open.spec of Package vlc-open

%define pulseplugin 0%{suse_version} > 1030
%define libvlc 2
%define libvlccore 0

Summary: VLC - Video Lan Client
Name: 	vlc-open
Version: 	0.9.8a
Release:        2.2
Source: 	 http://download.videolan.org/pub/videolan/vlc/%{version}/vlc-%{version}.tar.bz2
NoSource:	 0
Patch1:         fix_font_path.patch
Patch2:         cc0a53be923789e7cd1fe9c37855f9cbbd1c4a94.diff
Patch3:         0001-x264-removed-i_direct_8x8_inference-from-the-structu.patch
Patch4:         41659252.diff
Patch5:         91ed4f7f.diff
Patch6:         input_manager.diff
Patch7:         live555.diff
Patch8:         qt4.diff
Patch9:         menus.diff
Patch10:        taglib.diff
Patch11:	dont_compile_patented.patch
Patch12:	access_filter_drm.diff

Packager: 	Dominique Leuenberger <dominique-vlc.suse@leuenberger.net>, ChunHui Suen <chunhui.suen@tum.de>
License: 	GPL
Group: Productivity/Multimedia/Video/Players	
BuildRoot:  %{_tmppath}/vlc-%{version}-build
BuildRequires: gettext-devel libvorbis-devel libogg-devel libtheora-devel libmatroska
BuildRequires: cvs gnome-vfs2-devel libcdio-devel libcddb-devel gnutls-devel alsa-devel
BuildRequires: xosd-devel aalib-devel gcc-c++ freetype2-devel slang-devel
BuildRequires: libqt4-devel wxGTK-devel fribidi-devel
#BuildRequires: libdvbpsi-devel
BuildRequires: libnotify-devel libdc1394-devel
BuildRequires: lua-devel libsmbclient-devel
BuildRequires: pulseaudio-devel taglib-devel
#BuildRequires: libkate-devel
%if %suse_version >= 1030
BuildRequires: libdc1394_control12-devel
%endif

#chunhui: for building
BuildRequires: gcc-c++ glibc-locale libtool
 #necessary for bootstrapping
BuildRequires: automake perl

#Esound
%if %suse_version <= 1030
BuildRequires: esound-devel
%else
BuildRequires: libesd-devel
%endif

#OpenTC: Additional dependancies
BuildRequires: libcurl-devel libopenssl-devel
BuildRequires: libxmlrpc-c-devel
#= 1.06.31
#libgssapi

#OpenTC: Disabled libs, to comply with licensing issues
# vcdimager-devel libxvidcore-devel libx264-devel libmad-devel libffmpeg-devel libmpeg2-devel faad2-devel libfaac-devel liba52-devel  live555 libdvdnav-devel
# libasa-devel csri-devel libass-devel libproxy-devel libdca-devel 
# libdvdread-devel 

# disable avahi for the moment, in order to be able to create noX packages
### BuildRequires: avahi-devel

# BuildRequires that are not actively used for VLC, but for the build itself to work smoothly
BuildRequires: findutils 
BuildRequires: update-desktop-files

BuildRequires: Mesa-devel
%if 0%{suse_version} < 1020
#%if 0%{suse_version} < 1120
BuildRequires: gecko-sdk
%else
%if 0%{suse_version} <= 1100
BuildRequires: mozilla-xulrunner181-devel
%else
BuildRequires: mozilla-xulrunner190-devel
%endif
%endif

Obsoletes: vlc-beta <= 0.9.2
Requires: vlc-open-noX = %{version}-%{release}
Requires: vlc-open-qt = %{version}-%{release}

%description
VLC media player is a highly portable multimedia player for various 
audio and video formats (MPEG-1, MPEG-2, MPEG-4, DivX, mp3, ogg, ...) 
as well as DVDs, VCDs, and various streaming protocols. 
It can also be used as a server to stream in unicast or multicast 
in IPv4 or IPv6 on a high-bandwidth network.

%package devel
Summary: VLC Development system
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}

%description devel
Those development headers are required if you plan on coding against VLC

%package -n libvlc%{libvlc}
Summary: Shared library libvlc
Group: System/Libraries

%description -n libvlc%{libvlc}
Shared library libvlc. To be installed by system dependencies

%package -n libvlccore%{libvlccore}
Summary: Shared library libvlc
Group: System/Libraries

%description -n libvlccore%{libvlccore}
Shared library libvlc. To be installed by system dependencies

%package noX
Summary: VLC: VideoLAN Client - without X dependencies
Group: Productivity/Multimedia/Video/Players
Obsoletes: vlc-beta-noX <= 0.9.2
Requires: libvlc%{libvlc} = %{version}-%{release}
Requires: libvlccore%{libvlccore} = %{version}-/%{release}

%description noX
This Package of VLC contains the bare requirements you need to install.
Here is no graphical User Interface included, thus it's also perfectly
suitable for server installations (Streaming Server for example)

Should you decide to install the GUI modules, %{name}-noX will stay
installed as a dependency.

%package qt
Summary: VLC: VideoLAN Client - Qt interface
Group: Productivity/Multimedia/Video/Players
Supplements: packageand(%{name}-noX:libqt4)
Obsoletes: vlc-beta-qt <= 0.9.2
Requires: vlc-open-noX = %{version}-%{release}

%description qt
The all new Qt interface for the VLC VideoLAN Client.

%package gnome
Summary: VLC: VideoLAN Client - Gnome Access Modules
Group: Productivity/Multimedia/Video/Players
Supplements: packageand(%{name}-noX:gnome-vfs2)
Obsoletes: vlc-beta-gnome <= 0.9.2
Requires: vlc-open-noX = %{version}-%{release}

%description gnome
In order to integrate flawless into GNOME, there are some access modules
for gnome-vfs2.

%package mozillaplugin
Summary: The mozilaplugin enables VLC inside Mozilla Browser
Group: Productivity/Multimedia/Video/Players
Obsoletes: vlc-beta-mozillaplugin <= 0.9.2
Requires: vlc-open-noX = %{version}-%{release}

%description mozillaplugin
With this plugin, you enable video content withing the Mozilla Browser Suites

%if 0%{pulseplugin}
%package aout-pulse
Summary: VLC Audio Out for Pulse Audio
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
Supplements: packageand(%{name}-noX:pulseaudio)
Obsoletes: vlc-beta-aout-pulse <= 0.9.2
Requires: vlc-open-noX = %{version}-%{release}

%description aout-pulse
Extends VLC with Pulse Audio Support for Audio Out
%endif

%debug_package
%prep
#%setup -q

#manually prepare the directory
rm -rf vlc-%{version}
rm -rf vlc-open-%{version}
tar xvfj ../SOURCES/vlc-%{version}.tar.bz2
mv vlc-%{version} vlc-open-%{version}
cd vlc-open-%{version}

%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p0

%build 
cd vlc-open-%{version}
export XPIDL=%{_libdir}/xulrunner-$(xulrunner-config --version)/xpidl
export XPIDL_INCL=$(xulrunner-config --idlflags)

#bootstrap needed for access-filter-drm
./bootstrap
%configure \
   --disable-dependency-tracking         \
   --enable-gnomevfs    --enable-ncurses \
   --enable-wxwidgets   --disable-pda \
   --disable-macosx     --disable-qnx \
   --enable-xosd        --enable-gnutls \
   --enable-visual      --disable-goom \
   --enable-slp         --enable-lirc \
   --disable-joystick   --disable-corba \
   --disable-live555     --disable-dvdread \
   --enable-v4l         --enable-v4l2 \
   --enable-pvr         --disable-vcd \
   --enable-satellite   --enable-ogg \
   --enable-mkv         --disable-mod \
   --enable-libcdio     --disable-vcdx \
   --enable-cddax       --enable-libcddb \
   --enable-x11         --enable-xvideo \
   --enable-glx         --enable-fb \
   --enable-mga         --enable-freetype \
   --enable-fribidi     --disable-svg \
   --disable-hd1000v    --disable-directx \
   --disable-wingdi     --disable-glide \
   --enable-aa          --enable-caca \
   --enable-oss         --enable-esd \
   --enable-arts        --enable-waveout \
   --disable-coreaudio  --disable-hd1000a \
   --disable-hd1000v    --disable-mad \
   --disable-ffmpeg     --disable-faad \
   --disable-a52         --disable-dca \
   --disable-flac       --disable-libmpeg2 \
   --enable-vorbis      --enable-tremor \
   --enable-speex       --disable-tarkin \
   --enable-theora      --enable-cmml \
   --enable-utf8        --enable-pth \
   --disable-st         --disable-gprof \
   --disable-cprof      --disable-testsuite \
   --enable-optimizations   --disable-altivec \
   --disable-debug      --enable-release \
   --disable-galaktos   --enable-httpd \
   --disable-jack       --enable-mozilla \
   --enable-alsa        --disable-real \
   --disable-realrtsp    --disable-live555 \
   --enable-fast-install  --disable-dvbpsi \
   --disable-dvb         --enable-lua \
   --enable-pulse        --disable-dvdnav \
   --enable-asademux    --disable-libproxy \
   --disable-libass     --disable-kate   \
   --enable-smb         --enable-taglib	\
   --disable-postproc	  --disable-id3tag \
   --disable-avcodec 	  --disable-x264 \
   --disable-avformat 

make


%install
cd vlc-open-%{version}
make DESTDIR=%{buildroot} install

#chunhui: hack to remove the really hard to remove plugins
#rm %{buildroot}%{_libdir}/vlc/demux/libmp4_plugin.so
rm %{buildroot}%{_libdir}/vlc/demux/libreal_plugin.so
rm %{buildroot}%{_libdir}/vlc/demux/libvc1_plugin.so
rm %{buildroot}%{_libdir}/vlc/demux/libdtssys_plugin.so
rm %{buildroot}%{_libdir}/vlc/packetizer/libpacketizer_mpeg4audio_plugin.so
rm %{buildroot}%{_libdir}/vlc/packetizer/libpacketizer_mpeg4video_plugin.so
rm %{buildroot}%{_libdir}/vlc/packetizer/libpacketizer_mpegvideo_plugin.so
rm %{buildroot}%{_libdir}/vlc/packetizer/libpacketizer_h264_plugin.so
rm %{buildroot}%{_libdir}/vlc/packetizer/libpacketizer_vc1_plugin.so

mkdir -p %{buildroot}/%{_datadir}/pixmaps
ln -s %{_datadir}/vlc/vlc48x48.png %{buildroot}/%{_datadir}/pixmaps/vlc.png
mkdir -p %{buildroot}/%{_libdir}/browser-plugins
mv %{buildroot}%{_libdir}/mozilla/plugins/libvlc* %{buildroot}/%{_libdir}/browser-plugins
find %{buildroot} -name *.la -exec rm {} \;
%suse_update_desktop_file vlc AudioPlayer VideoPlayer Player

%clean
rm -rf "$RPM_BUILD_ROOT"

%files 
%defattr(-,root,root)
%{_bindir}/svlc
%{_datadir}/applications/vlc.desktop
%{_datadir}/pixmaps/vlc.png
%{_libdir}/vlc/access/libscreen_plugin.so
# %{_libdir}/vlc/codec/liblibass_plugin.so
%{_libdir}/vlc/gui/libskins2_plugin.so
%{_libdir}/vlc/misc/libnotify_plugin.so
%{_libdir}/vlc/misc/libxosd_plugin.so
%{_libdir}/vlc/misc/libfreetype_plugin.so
%{_libdir}/vlc/video_filter/libpanoramix_plugin.so
%{_libdir}/vlc/video_output/libaa_plugin.so
%{_libdir}/vlc/video_output/libglx_plugin.so
%{_libdir}/vlc/video_output/libopengl_plugin.so
%{_libdir}/vlc/video_output/libx11_plugin.so
%{_libdir}/vlc/video_output/libxvideo_plugin.so

%files noX
%defattr(-,root,root)
%doc %{_datadir}/doc/vlc/
%doc %{name}-%{version}/NEWS %{name}-%{version}/AUTHORS %{name}-%{version}/COPYING %{name}-%{version}/HACKING %{name}-%{version}/THANKS %{name}-%{version}/MAINTAINERS %{name}-%{version}/README 
%{_bindir}/cvlc
%{_bindir}/nvlc
%{_bindir}/rvlc
%{_bindir}/vlc
%{_bindir}/vlc-wrapper
%{_datadir}/vlc/
%{_datadir}/locale/*/*/vlc*
%dir %{_datadir}/locale/co
%dir %{_datadir}/locale/co/LC_MESSAGES
%dir %{_datadir}/locale/tet
%dir %{_datadir}/locale/tet/LC_MESSAGES
%{_libdir}/vlc
# exclude the pulse audio output module from here. Seperate package
%if 0%{pulseplugin}
%exclude %{_libdir}/vlc/audio_output/libpulse_plugin.so
%endif
#exclude the Qt modules from here. Seperate package
%exclude %{_libdir}/vlc/gui/libqt4_plugin.so
# Exclude the shared libraries
%exclude %{_libdir}/libvlc.so.*
%exclude %{_libdir}/libvlccore.so.*
# Exclude all Files that should go to the X-Dependent package
%exclude %{_libdir}/vlc/access/libscreen_plugin.so
#%exclude %{_libdir}/vlc/codec/liblibass_plugin.so
%exclude %{_libdir}/vlc/gui/libskins2_plugin.so
%exclude %{_libdir}/vlc/misc/libnotify_plugin.so
%exclude %{_libdir}/vlc/misc/libxosd_plugin.so
%exclude %{_libdir}/vlc/misc/libfreetype_plugin.so
%exclude %{_libdir}/vlc/video_filter/libpanoramix_plugin.so
%exclude %{_libdir}/vlc/video_output/libaa_plugin.so
%exclude %{_libdir}/vlc/video_output/libglx_plugin.so
%exclude %{_libdir}/vlc/video_output/libopengl_plugin.so
%exclude %{_libdir}/vlc/video_output/libx11_plugin.so
%exclude %{_libdir}/vlc/video_output/libxvideo_plugin.so
%exclude %{_libdir}/vlc/access/libaccess_gnomevfs_plugin.so

%files -n libvlc%{libvlc}
%defattr(-,root,root)
%{_libdir}/libvlc.so.%{libvlc}*

%files -n libvlccore%{libvlccore}
%defattr(-,root,root)
%{_libdir}/libvlccore.so.%{libvlccore}*

%files qt
%defattr(-,root,root)
%{_bindir}/qvlc
%{_libdir}/vlc/gui/libqt4_plugin.so

%files gnome
%defattr(-,root,root)
%{_libdir}/vlc/access/libaccess_gnomevfs_plugin.so

%files devel
%defattr(-,root,root)
%{_includedir}/vlc/
%{_libdir}/libvlccore.so
%{_libdir}/libvlc.so
%{_libdir}/pkgconfig/libvlc.pc
%{_libdir}/pkgconfig/vlc-plugin.pc
#%{_bindir}/vlc-config

%if 0%{pulseplugin}
%files aout-pulse
%defattr(-,root,root)
%{_libdir}/vlc/audio_output/libpulse_plugin.so
%endif

%post -n %{name}-noX -p /sbin/ldconfig
%postun -n %{name}-noX -p /sbin/ldconfig

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

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

%files mozillaplugin
%defattr(-,root,root)
%{_libdir}/browser-plugins/libvlcplugin.so

%changelog
* Thu Jan 22 2009 dominique-suse.vlc@leuenberger.net
- Added patch to support compilation against x264 > 65
* Fri Jan 16 2009 dominique-suse.vlc@leuenberger.net
- some spec clean up in order to consolidate vlc and vlc-beta packages
openSUSE Build Service is sponsored by