Skip to content

Instantly share code, notes, and snippets.

@ajorg
Created February 1, 2011 17:35
Show Gist options
  • Save ajorg/806230 to your computer and use it in GitHub Desktop.
Save ajorg/806230 to your computer and use it in GitHub Desktop.
%build
# The plugin requires a complete build of it's own mono
pushd ../mono-%{included_mono}
# We have not determined which --enable-minimal options might be safe
# so please do not use any of them
./configure --prefix=%{_builddir}/install \
--with-mcs-docs=no \
--with-ikvm-native=no
%{__make} EXTERNAL_MCS=false EXTERNAL_RUNTIME=false #%{?jobs:-j%jobs} # mono is not strictly -j safe
# This gets installed in the build dir so that it gets wiped away
# and not installed on the system
%{__make} install
# libtool is evil, if the .la is present things get jacked up
find %{_builddir}/install -name \*.la -delete
popd
# Configure against the junk install of mono
export PATH=%{_builddir}/install/bin:${PATH}
export LD_LIBRARY_PATH=%{_builddir}/install/lib:${LD_LIBRARY_PATH}
export PKG_CONFIG_PATH=%{_builddir}/install/lib/pkgconfig:${PKG_CONFIG_PATH}
# And then we build moonlight
# Only needed when there are Makefile.am or configure.ac patches
autoreconf -f -i -Wnone
%configure --without-testing --without-performance --without-examples \
--disable-debug --disable-sanity \
%{desktop_support} \
--with-mcspath=%{_builddir}/mono-%{included_mono}/mcs \
--with-mono-basic-path=%{_builddir}/mono-basic-%{included_basic} \
--with-ffmpeg=%{with_ffmpeg} \
--with-cairo=%{with_cairo}
# We need the system gac for gtk-sharp
# Only if we're linking to the junk mono
export MONO_GAC_PREFIX=%{_builddir}/install:%{_prefix}
%{__make} %{?jobs:-j%jobs}
%install
export PATH=%{_builddir}/install/bin:${PATH}
export LD_LIBRARY_PATH=%{_builddir}/install/lib:${LD_LIBRARY_PATH}
export PKG_CONFIG_PATH=%{_builddir}/install/lib/pkgconfig:${PKG_CONFIG_PATH}
%{__make} install DESTDIR=%{buildroot}
# Copy the custom libmono.so.0 for the plugin to use
install -m 644 %{_builddir}/install/lib/libmono.so.0 %{buildroot}%{_libdir}/moonlight/
# Make the loader pull in the correct libmono
chrpath -r %{_libdir}/moonlight %{buildroot}%{_libdir}/moonlight/plugin/libmoonplugin.so
chrpath -r %{_libdir}/moonlight %{buildroot}%{_libdir}/moonlight/plugin/libmoonplugin.so
# Symlink the loader into browser-plugins for SUSE
# plugin package was nuked for now
%if 0%{?suse_version}
mkdir -p %{buildroot}%{_libdir}/browser-plugins
ln -s %{_libdir}/moonlight/plugin/libmoonloader.so %{buildroot}%{_libdir}/browser-plugins/libmoonloader.so
%endif
# We don't like nasty .la files
find %{buildroot} -name \*.la -delete
%if %{with_desktop} == no
rm -f %{buildroot}%{_bindir}/xamlg
rm -f %{buildroot}%{_bindir}/smcs
%endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment