Defined Type: eclipse

Defined in:
manifests/init.pp

Overview

Sample Usage:

# Get php eclipse package:
::eclipse{"eclipsephp":
		downloadurl=>'http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/helios/SR2/eclipse-php-helios-SR2-linux-gtk-x86_64.tar.gz&url=http://ftp.osuosl.org/pub/eclipse/technology/epp/downloads/release/helios/SR2/eclipse-php-helios-SR2-linux-gtk-x86_64.tar.gz&mirror_id=272',

downloadfile=>‘eclipse-php-helios-SR2-linux-gtk-x86_64.tar.gz’

}

Parameters:

  • method (Any) (defaults to: 'wget')
  • downloadurl (Any) (defaults to: 'http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/R-4.2-201206081400/eclipse-SDK-4.2-linux-gtk-x86_64.tar.gz&url=http://eclipse.mirrorcatalogs.com/eclipse/downloads/drops4/R-4.2-201206081400/eclipse-SDK-4.2-linux-gtk-x86_64.tar.gz&mirror_id=1119')
  • downloadfile (Any) (defaults to: 'eclipse-SDK-4.2-linux-gtk-x86_64.tar.gz')
  • pluginrepositories (Any) (defaults to: ['http://download.eclipse.org/releases/juno/'])
  • pluginius (Any) (defaults to: [])


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'manifests/init.pp', line 19

define eclipse(
	$method='wget',
	$downloadurl='http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/R-4.2-201206081400/eclipse-SDK-4.2-linux-gtk-x86_64.tar.gz&url=http://eclipse.mirrorcatalogs.com/eclipse/downloads/drops4/R-4.2-201206081400/eclipse-SDK-4.2-linux-gtk-x86_64.tar.gz&mirror_id=1119',
	$downloadfile='eclipse-SDK-4.2-linux-gtk-x86_64.tar.gz',
	$pluginrepositories = ['http://download.eclipse.org/releases/juno/'],
	$pluginius = []
) {
	include eclipse::params
	if $method == 'wget' {
		
		#creates tests for commandline execution
		$wgetcreates = "${eclipse::params::downloadpath}${downloadfile}"
		$finalcreates = "${eclipse::params::installpath}eclipse"
		$simlinkcreates = "${eclipse::params::simlinkto}/eclipse"
		$applicationpath = "${eclipse::params::installpath}/eclipse/eclipse"
	
		# commands to be run by exec
		$wgetcommand ="wget -O '${wgetcreates}' '${downloadurl}'"
		$unpackcommand = "tar -C '${eclipse::params::installpath}' -zxvf '${wgetcreates}'"
		$modeclipse = "chmod -R 775 '${finalcreates}'"
		$simlinktobin = "ln -s '${applicationpath}' '${simlinkcreates}'"
	
		# Downloads eclipse package
		exec {"geteclipse":
			command=>$wgetcommand,
			cwd=> $eclipse::params::executefrom,
			path=> $eclipse::params::execlaunchpaths,
			creates=>$wgetcreates,
			logoutput=> on_failure,
			#require=>file["installersdirectory"]
		}
	
		# Decompresses eclipse
		exec {"upackeclipse":
			command=>$unpackcommand,
			cwd=> $eclipse::params::executefrom,
			path=> $eclipse::params::execlaunchpaths,
			creates=>$finalcreates,
			logoutput=> on_failure,
			require=>exec["geteclipse"]
		}
		
		# Mod eclipse
		exec {"modeclipse":
			command=>$modeclipse,
			cwd=> $eclipse::params::executefrom,
			path=> $eclipse::params::execlaunchpaths,
			logoutput=> on_failure,
			require=>exec["upackeclipse"]
		}
		
		# Make a simlink in bin
		exec {"simlinkeclipse":
			command=>$simlinktobin,
			cwd=> $eclipse::params::executefrom,
			path=> $eclipse::params::execlaunchpaths,
			creates=>$simlinkcreates,
			logoutput=> on_failure,
			require=>exec["modeclipse"]
		}
		
		# Put the eclipse icon on the desktop
		file{"eclipse.desktop":
			path=>"${eclipse::params::desktopfilepath}/eclipse.desktop",
			ensure=>"present",
			content=>template("eclipse/eclipse.desktop.erb")
		}
		
	} else {
		package {"eclipse":
			name=>"eclipse",
			ensure=>$method
		}
	}
	
	if pluginius != undef {
		::eclipse::plugin{"eclipseinstallplugins":
			pluginrepositories=>$pluginrepositories,
			pluginius=>$pluginius
		}
	}
}