RPM .spec file I build with on Fedora 10
#1
Posting this in case anybody else is interested.

I can't really take much credit for the .spec file. I'd found somebody else that had one for Fedora 8/10 (pretty sure it's Scott Havarnek, they're still in changelog iirc), so I took it and added some stuff to help force xbmc to find MySQL, NVidia, etc. libs and headers where they will be on a Fedora/RPMFusion system. I didn't like the idea of having to manually copy files around or create symlinks on my build system just so xbmc's build Makefiles could find things where it wanted to look for them, when it isn't really necessary.

So perhaps we could call this a contribution to the community. Feel free to tear it to shreds. Smile

It works for me when the rev I'm building from is good.

As far as how i get the sources, I keep a local svn checkout around and when I want to build a particular svn revision, I 'cp -av XBMC-svn XBMC-svn23582' (for example) to copy the source tree from the XBMC svn dir to a tree named after the svn revision.

Then I tar it up:

tar cjvf XBMC-svn23582.tar.bz2 XBMC-svn23582/*

and drop the tarball, spec file, etc. into my RPM building area, and figure out what other libs, -devel packages, etc. need to be added as Requires: or BuildRequires:.

The one thing I wish the developers could do is add configurable paths for the NVidia and MySQL include and lib directories to the autoconf/configure setup, and make the rest of the Makefile system obey them. So instead of having to add a bunch of -L/usr/lib/nvidia -I/usr/include/nvidia etc. stuff to compiler flags, LDFLAGS etc we could just throw "--with-nvidia-headers=/usr/include/nvidia --with-nvidia-libdir=/usr/lib/nvidia", for example.

Anyway, here's the spec file. I apologize for all the compiler flags hacking and such. It's what I had to do to get good builds. Sad

Cheers,
PharaohsPaw
Reply
#2
Oops, well, so much for that.

I can't add attachments.

I'll try spamming it as a reply.

PharaohsPaw
Reply
#3
Code:
%define debug_package %{nil}

# set wantvdpau to 1 if you want to build packages with NVidia VDPAU
# hardware video rendering offload support
# (and pay attention to the dependencies)
%define wantvdpau 1

Name: XBMC
Version: svn23582
Release: 1.vw%{dist}
URL: http://xbmc.org
Source: %{name}-%{version}.tar.bz2
Summary: Xbox Media Center Linux port
License: GPL
Group: Applications/Multimedia

BuildRequires: SDL-devel
BuildRequires: SDL_image-devel
BuildRequires: SDL_mixer-devel
BuildRequires: fontconfig-devel
BuildRequires: fribidi-devel
BuildRequires: glibc-devel
BuildRequires: hal-devel
BuildRequires: glew-devel
BuildRequires: libstdc++-devel
BuildRequires: glib2-devel
BuildRequires: libjasper-devel
BuildRequires: libjpeg-devel
BuildRequires: libogg-devel
BuildRequires: libpng-devel
BuildRequires: libstdc++-devel
BuildRequires: e2fsprogs-devel
BuildRequires: libvorbis-devel
BuildRequires: lzo-devel
BuildRequires: pcre-devel
BuildRequires: zlib-devel
BuildRequires: tre-devel
BuildRequires: boost-devel
BuildRequires: bzip2-devel
BuildRequires: freetype-devel
BuildRequires: libXinerama-devel
BuildRequires: fontconfig-devel
BuildRequires: mysql-libs
BuildRequires: mysql-devel
BuildRequires: jasper-devel
BuildRequires: faac-devel
BuildRequires: enca-devel
BuildRequires: cmake
BuildRequires: gperf
BuildRequires: nasm
BuildRequires: libXmu-devel
BuildRequires: pcre-devel
BuildRequires: gcc-c++
BuildRequires: sqlite-devel
BuildRequires: curl-devel
BuildRequires: libmad-devel
BuildRequires: libcdio-devel

# new with svn 23241
BuildRequires: libsamplerate-devel
BuildRequires: libmms-devel
BuildRequires: libXt-devel
BuildRequires: libXtst-devel

# new leading up to svn23581
BuildRequires: faad2-devel
BuildRequires: flac-devel
BuildRequires: libtiff-devel
BuildRequires: libcurl-devel
BuildRequires: libass-devel
BuildRequires: lame-devel
BuildRequires: libsmbclient-devel

# nvidia vdpau
%if %{wantvdpau}
BuildRequires: xorg-x11-drv-nvidia-devel
%endif

Requires: libvorbis >= 1.2
Requires: libmad >= 0.15
Requires: libogg >= 1.1
Requires: libcdio
# xorg-x11-utils is needed for xpdyinfo binary that xbmc will try to run on startup - thanks ctatman
Requires: xorg-x11-utils

# new with svn 23241
Requires: libsamplerate
Requires: libmms
Requires: libXt
Requires: libXtst
Requires: libsmbclient

# new leading up to svn23581
Requires: faac
Requires: faad2
Requires: faad2-libs
Requires: flac
Requires: lame
Requires: lame-libs
Requires: libtiff
Requires: libcurl
Requires: libass

#Patches
Patch1: xbmc-fribidi-lib810.patch
Patch2: xbmc-fribidi-lib1.patch
Patch3: xbmc-en_us-language.patch
#
#
Patch4: XBMC-svn18928-guilib-includes-find-vdpau-headers.patch
#
#
Patch5: XBMC-svn19150-tiff-Makefile-fix-cflags.patch



%description
XBMC media center is a free cross-platform media-player
jukebox and entertainment hub. XBMC is open source (GPL)
software available for Linux, Mac OS X, Microsoft Windows
operating-system, and the Xbox game-console. XBMC can
play a very complete spectrum of of multimedia formats,
and featuring playlist, audio visualizations, slideshow,
and weather forecast functions, together with a multitude
of third-party plugins. Originally developed as XBMP
(XBox Media Player) for the first-generation Xbox game
console in 2002, XBMC has eventually become a complete
graphical user interface replacement for the original Xbox
Dashboard, and it is currently also being ported to run
natively under Linux, Mac OS X, and Microsoft Window
operating-system. This, The XBMC Project is also known
as "XBMC Media Center" or simply "XBMC").


%prep

%setup -q -n %{name}-%{version}

# run the bootstrap script, needed to get a configure
./bootstrap

%ifarch x86_64
CFLAGS="-I/usr/lib64/dbus-1.0/include -I/usr/lib64/glib-2.0/include -I/usr/include/nvidia"
LDFLAGS="-L/usr/lib64/nvidia -L/usr/lib64/mysql"
INCLUDES="-I/usr/include/nvidia -I/usr/lib64/dbus-1.0/include \
-I%{_builddir}/%{name}-%{version}/xbmc/lib/cximage-6.0/jpeg"
%else
CFLAGS="-I/usr/include/nvidia -I%{_builddir}/%{name}-%{version}/xbmc/lib/cximage-6.0/jpeg"
LDFLAGS="-L/usr/lib/nvidia -L/usr/lib/mysql"
INCLUDES="-I/usr/include/nvidia -I/usr/lib/dbus-1.0/include \
-I%{_builddir}/%{name}-%{version}/xbmc/lib/cximage-6.0/jpeg"
%endif
export CFLAGS
export LDFLAGS
export INCLUDES
mv "language/English (US)" language/English

#patch1
#patch2
#patch3

# may not need this anymore at svn23241, looks fixed now
#%patch5 -p1

# Pulse Audio doesn't support pass-through AC3/DTS
# Just disable pulseaudio in the build
#

%configure \
%if %{wantvdpau}
  --enable-vdpau \
%else
  --disable-vdpau \
%endif
  --enable-goom \
  --disable-pulse


%build

%ifarch x86_64
CFLAGS="-I/usr/lib64/dbus-1.0/include -I/usr/lib64/glib-2.0/include -I/usr/include/nvidia -I%{_builddir}/%{name}-%{version}/xbmc/lib/cximage-6.0/jpeg" \
  LDFLAGS="-L/usr/lib64/nvidia -L/usr/lib64/mysql" \
  make %{?_smp_mflags}
%else
CFLAGS="-I/usr/include/nvidia -I%{_builddir}/%{name}-%{version}/xbmc/lib/cximage-6.0/jpeg" \
  LDFLAGS="-L/usr/lib/nvidia -L/usr/lib/mysql" \
  make %{?_smp_mflags}
%endif

%install
rm -rf $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT/usr install

rm -rf $RPM_BUILD_ROOT/usr/share/xbmc/system/players/dvdplayer/*osx*

%clean

%files
%defattr(-,root,root)
/usr/bin/xbmc
/usr/bin/xbmc-standalone
%dir /usr/share/xbmc
/usr/share/xbmc/*
/usr/share/xsessions/XBMC.desktop

%changelog
* Thu Sep 24 2009 PharaohsPaw svn.19575-2
- Add Requires dependency xorg-x11-utils - thanks ctatman - xbmc will attempt to
  to execute xpdyinfo on startup so this package needs to be installed so it is there.
- Put --disable-pulse back in.  Why build with pulseaudio support if we don't want
  XBMC to use pulseaudio?

* Wed Mar 25 2009 PharaohsPaw svn.18928-1
- Build for F10 from SVN hopefully to get VDPAU support

* Tue Jan 27 2009 Scott Harvanek <[email protected]> 8.10-3
- Added requires for
- alsa-plugins-pulseaudio, libogg, libmad, libvorbis

* Thu Jan 1 2009 Scott Harvanek <[email protected]> 8.10-2
- Patch for English language strings.xml

* Wed Nov 26 2008 Scott Harvanek <[email protected]> 8.10-1
- v8.10
- Fedora 10 RPM

* Sun Nov 2 2008 Scott Harvanek <[email protected]>
- SVN r16092

* Sun Oct 19 2008 Scott Harvanek <[email protected]>
- SVN r15937

* Sun Oct 12 2008 Scott Harvanek <[email protected]>
- SVN r15873

* Mon Oct 6 2008 Scott Harvanek <[email protected]>
- Push to Beta 2 SVN r15817

* Sun Oct 5 2008 Scott Harvanek <[email protected]>
- Update to SVN r15804
- Various spec file cleanup

* Thu Oct 2 2008 Scott Harvanek <[email protected]>
- Update to SVN r15744

* Wed Oct 1 2008 Scott Harvanek <[email protected]>
- Update to SVN r15737

* Sat Sep 20 2008 Scott Harvanek <[email protected]>
- Initial Build
- SVN r15642
Reply
#4
BTW this .spec file makes good builds for F11 as well.
Reply

Logout Mark Read Team Forum Stats Members Help
RPM .spec file I build with on Fedora 100