Changed arduino to use new Makefile system.

This commit is contained in:
Timo Mkinen 2012-01-12 12:43:54 +02:00
parent 9d069e29fa
commit 62d1e908c6
2 changed files with 40 additions and 17 deletions

View file

@ -1,16 +1,26 @@
VERSION = 0022
BASEURL = http://arduino.googlecode.com/files/
OUT = /srv/puppet/files/common/packages
include $(CURDIR)/../Makefile.inc
all: $(OUT)/arduino32.tgz $(OUT)/arduino64.tgz
VERSION = 1.0
$(OUT)/arduino32.tgz:
@umask 022
cd $(OUT) && wget -nv -N $(BASEURL)/arduino-$(VERSION).tgz && \
ln -sf arduino-$(VERSION).tgz arduino32.tgz
TARGET32 = arduino32-$(VERSION).tgz
SOURCE32 = http://arduino.googlecode.com/files/arduino-$(VERSION)-linux.tgz
TARGET64 = arduino64-$(VERSION).tgz
SOURCE64 = http://arduino.googlecode.com/files/arduino-$(VERSION)-linux64.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
all: download manifest
download: $(PACKAGES)/$(TARGET32) $(PACKAGES)/$(TARGET64)
manifest: $(MANIFESTS)/arduino.pp
$(PACKAGES)/$(TARGET32):
@umask 022; echo $@; \
test -f $@ || curl -o $@ $(SOURCE32)
$(PACKAGES)/$(TARGET64):
@umask 022; echo $@; \
test -f $@ || curl -o $@ $(SOURCE64)
$(MANIFESTS)/arduino.pp: $(PACKAGES)/$(TARGET32) $(PACKAGES)/$(TARGET64)
@umask 022; echo $@; \
echo '$$arduino32_package_latest = "$(TARGET32)"' > $@ && \
echo '$$arduino64_package_latest = "$(TARGET64)"' >> $@

View file

@ -12,15 +12,28 @@ class arduino {
before => File["/usr/local/bin/arduino"],
}
case $architecture {
"x86_64": { $bits = "64" }
default: { $bits = "32" }
if !$arduino_package {
case $architecture {
"x86_64": {
if $arduino64_package_latest {
$arduino_package = $arduino64_package_latest
} else {
fail("Must define \$arduino_package or \$arduino64_package_latest")
}
}
default: {
if $arduino32_package_latest {
$arduino_package = $arduino32_package_latest
} else {
fail("Must define \$arduino_package or \$arduino32_package_latest")
}
}
}
}
file { "/usr/local/src/arduino.tgz":
ensure => present,
source => "puppet:///files/packages/arduino${bits}.tgz",
links => follow,
source => "puppet:///files/packages/${arduino_package}",
mode => 0644,
owner => "root",
group => "root",