class MonoPackage (Package):
	def __init__ (self):
		Package.__init__ (self, 'mono', '2.10',
			sources = [
				'http://ftp.novell.com/pub/%{name}/sources/%{name}/%{name}-%{version}.tar.bz2',
				'patches/mono-runtime-relocation.patch'
			],
			configure_flags = [
				'--with-jit=yes',
				'--with-ikvm=no',
				'--with-mcs-docs=no',
				'--with-moonlight=no',
				'--enable-quiet-build'
			]
		)

		# Mono (in libgc) likes to fail to build randomly
		self.make = 'for((i=0;i<20;i++)); do make && break; done'

#	def prep (self):
#		Package.prep (self)
#		self.sh ('patch -p1 < "%{sources[1]}"')

	def install (self):
		Package.install (self)
		if Package.profile.name == 'darwin':
			self.sh ('sed -ie "s/libcairo.so.2/libcairo.2.dylib/" "%{prefix}/etc/mono/config"')

MonoPackage ()

class MonoPackage (Package):
	def __init__ (self):
		Package.__init__ (self, 'mono', '2.10',
			sources = [
				'http://ftp.novell.com/pub/%{name}/sources/%{name}/%{name}-%{version}.tar.bz2',
				'patches/mono-runtime-relocation.patch'
			],
			configure_flags = [
				'--with-jit=yes',
				'--with-ikvm=no',
				'--with-mcs-docs=no',
				'--with-moonlight=no',
				'--enable-quiet-build'
			]
		)

		# Mono (in libgc) likes to fail to build randomly
		self.make = 'for i in 1 2 3 4 5 6 7 8 9 10; do make && break; done'

#	def prep (self):
#		Package.prep (self)
#		self.sh ('patch -p1 < "%{sources[1]}"')

	def install (self):
		Package.install (self)
		if Package.profile.name == 'darwin':
			self.sh ('sed -ie "s/libcairo.so.2/libcairo.2.dylib/" "%{prefix}/etc/mono/config"')

MonoPackage ()

Fix shell syntax for non bash shells
Fix shell syntax for non bash shells

The custom make command in mono.py is executed with the default shell,
which on some systems doesn't support the fancy for loop syntax, like
dash on Ubuntu.

  class MonoPackage (Package):
  	def __init__ (self):
  		Package.__init__ (self, 'mono', '2.10',
  			sources = [
  				'http://ftp.novell.com/pub/%{name}/sources/%{name}/%{name}-%{version}.tar.bz2',
  				'patches/mono-runtime-relocation.patch'
  			],
  			configure_flags = [
  				'--with-jit=yes',
  				'--with-ikvm=no',
  				'--with-mcs-docs=no',
  				'--with-moonlight=no',
  				'--enable-quiet-build'
  			]
  		)
  
  		# Mono (in libgc) likes to fail to build randomly
- 		self.make = 'for((i=0;i<20;i++)); do make && break; done'
+ 		self.make = 'for i in 1 2 3 4 5 6 7 8 9 10; do make && break; done'
  
  #	def prep (self):
  #		Package.prep (self)
  #		self.sh ('patch -p1 < "%{sources[1]}"')
  
  	def install (self):
  		Package.install (self)
  		if Package.profile.name == 'darwin':
  			self.sh ('sed -ie "s/libcairo.so.2/libcairo.2.dylib/" "%{prefix}/etc/mono/config"')
  
  MonoPackage ()
  
Fix shell syntax for non bash shells
## Code Before:
class MonoPackage (Package):
	def __init__ (self):
		Package.__init__ (self, 'mono', '2.10',
			sources = [
				'http://ftp.novell.com/pub/%{name}/sources/%{name}/%{name}-%{version}.tar.bz2',
				'patches/mono-runtime-relocation.patch'
			],
			configure_flags = [
				'--with-jit=yes',
				'--with-ikvm=no',
				'--with-mcs-docs=no',
				'--with-moonlight=no',
				'--enable-quiet-build'
			]
		)

		# Mono (in libgc) likes to fail to build randomly
		self.make = 'for((i=0;i<20;i++)); do make && break; done'

#	def prep (self):
#		Package.prep (self)
#		self.sh ('patch -p1 < "%{sources[1]}"')

	def install (self):
		Package.install (self)
		if Package.profile.name == 'darwin':
			self.sh ('sed -ie "s/libcairo.so.2/libcairo.2.dylib/" "%{prefix}/etc/mono/config"')

MonoPackage ()

## Instruction:
Fix shell syntax for non bash shells
## Code After:
class MonoPackage (Package):
	def __init__ (self):
		Package.__init__ (self, 'mono', '2.10',
			sources = [
				'http://ftp.novell.com/pub/%{name}/sources/%{name}/%{name}-%{version}.tar.bz2',
				'patches/mono-runtime-relocation.patch'
			],
			configure_flags = [
				'--with-jit=yes',
				'--with-ikvm=no',
				'--with-mcs-docs=no',
				'--with-moonlight=no',
				'--enable-quiet-build'
			]
		)

		# Mono (in libgc) likes to fail to build randomly
		self.make = 'for i in 1 2 3 4 5 6 7 8 9 10; do make && break; done'

#	def prep (self):
#		Package.prep (self)
#		self.sh ('patch -p1 < "%{sources[1]}"')

	def install (self):
		Package.install (self)
		if Package.profile.name == 'darwin':
			self.sh ('sed -ie "s/libcairo.so.2/libcairo.2.dylib/" "%{prefix}/etc/mono/config"')

MonoPackage ()
