diff --git a/arduino/Makefile b/arduino/Makefile new file mode 100644 index 0000000..73885e8 --- /dev/null +++ b/arduino/Makefile @@ -0,0 +1,16 @@ + +VERSION = 0022 +BASEURL = http://arduino.googlecode.com/files/ +OUT = /srv/puppet/files/common/packages + +all: $(OUT)/arduino32.tgz $(OUT)/arduino64.tgz + +$(OUT)/arduino32.tgz: + @umask 022 + cd $(OUT) && wget -nv -N $(BASEURL)/arduino-$(VERSION).tgz && \ + ln -sf arduino-$(VERSION).tgz arduino32.tgz + +$(OUT)/arduino64.tgz: + @umask 022 + cd $(OUT) && wget -nv -N $(BASEURL)/arduino-$(VERSION)-64-2.tgz && \ + ln -sf arduino-$(VERSION)-64-2.tgz arduino64.tgz diff --git a/arduino/manifests/init.pp b/arduino/manifests/init.pp new file mode 100644 index 0000000..d3cd969 --- /dev/null +++ b/arduino/manifests/init.pp @@ -0,0 +1,41 @@ + +# Install Arduino development tools +# +class arduino { + + package { [ "uisp", + "avr-libc", + "avr-gcc-c++", + "rxtx", + "avrdude", ]: + ensure => installed, + } + + case $architecture { + "x86_64": { $bits = "64" } + default: { $bits = "32" } + } + + file { "/usr/local/src/arduino.tgz": + ensure => present, + source => "puppet:///files/packages/arduino${bits}.tgz", + links => follow, + mode => 0644, + owner => "root", + group => "root", + } + util::extract::tar { "/usr/local/lib/arduino": + strip => 1, + source => "/usr/local/src/arduino.tgz", + require => File["/usr/local/src/arduino.tgz"], + } + + file { "/usr/bin/arduino": + ensure => link, + target => "/usr/local/lib/arduino/arduino", + owner => "root", + group => "root", + require => Util::Extract::Tar["/usr/local/lib/arduino"], + } + +}