##
## mono.spec -- OpenPKG RPM Package Specification
## Copyright (c) 2000-2007 OpenPKG Foundation e.V.
## Copyright (c) 2000-2007 Ralf S. Engelschall
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package version
%define V_major 1.2
%define V_minor 5.1
# package information
Name: mono
Summary: Unix .NET Development Framework
URL: http://go-mono.com/
Vendor: The Mono Project
Packager: OpenPKG Foundation e.V.
Distribution: OpenPKG Community
Class: EVAL
Group: Language
License: GPL
Version: %{V_major}.%{V_minor}
Release: 20070920
# list of sources
Source0: http://go-mono.com/sources/mono/mono-%{version}.tar.bz2
Patch0: mono.patch
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20040130, pkgconfig, perl, bison, make, gcc
PreReq: OpenPKG, openpkg >= 20040130
BuildPreReq: glib2, glib2::with_threads = yes
PreReq: glib2, glib2::with_threads = yes
AutoReq: no
AutoReqProv: no
Conflicts: pnet
%description
The Mono project is an open source effort to create a free Unix
implementation of the .NET Development Framework. This is the base
package providing a Common Language Runtime (CLR) for the Common
Language Infrastructure (CLI), a C# Compiler and a set of class
libraries. The runtime can be embedded into your application. It
implements both ADO.NET and ASP.NET.
%track
prog mono = {
version = %{version}
url = http://go-mono.com/sources-stable/
regex = mono-(\d+\.\d+(\.\d+)*)\.tar\.bz2
}
%prep
%setup -q
%patch -p0
%build
# trick configure to not use truncl(3)
# because this is not available everywhere,
# although sometimes defined in
( echo "ac_cv_header_aio_h=no"
echo "ac_cv_func_trunc=no"
echo "ac_cv_trunc=no"
echo "ac_cv_lib_sunmath_aintl=no"
) >config.cache
%{l_shtool} subst \
-e 's/trunc;/notexisting;/' \
configure
# workaround Linux-specifics
%{l_shtool} subst \
-e 's;#!/bin/bash;#!%{l_bash};g' \
mono/arch/arm/dpiops.sh \
mono/arch/arm/fpaops.sh \
mono/arch/arm/vfpops.sh \
scripts/mono-find-provides \
scripts/mono-find-requires \
web/mono-build-w32.sh \
mcs/class/Managed.Windows.Forms/build-csproj \
mcs/class/Managed.Windows.Forms/build-csproj2k5 \
mcs/class/Mono.Cairo/Samples/gtk/compile.sh \
mcs/class/Mono.Cairo/Samples/png/compile.sh \
mcs/class/Mono.Cairo/Samples/win32/compile.sh \
mcs/class/Mono.Cairo/Samples/x11/compile.sh \
mcs/tools/tinderbox/tinderbox.sh
# configure program
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
CPPFLAGS="%{l_cppflags}" \
LDFLAGS="%{l_ldflags}" \
./configure \
--cache-file=./config.cache \
--prefix=%{l_prefix} \
--mandir=%{l_prefix}/man \
--bindir=%{l_prefix}/libexec/mono \
--with-gc=included \
--with-jit=yes \
--disable-shared
# build program
%{l_make} %{l_mflags}
%install
# use a working install to create subdirs
%{l_shtool} subst \
-e 's;\$(mkdir_p);%{l_shtool} mkdir -p;' \
Makefile */Makefile */*/Makefile
# install program
rm -rf $RPM_BUILD_ROOT
%{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
# activate executables
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/bin
for bin in `cd $RPM_BUILD_ROOT%{l_prefix}/libexec/mono && echo *`; do
case $bin in
*.exe ) continue ;;
esac
ln $RPM_BUILD_ROOT%{l_prefix}/libexec/mono/$bin \
$RPM_BUILD_ROOT%{l_prefix}/bin/$bin
done
# strip down installation
rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/libgc-mono
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
%{l_files_std} \
'%config %{l_prefix}/etc/mono/*' \
'%config %{l_prefix}/etc/mono/*/*'
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT