Changed arduino to use new Makefile system.
This commit is contained in:
parent
9d069e29fa
commit
62d1e908c6
2 changed files with 40 additions and 17 deletions
|
@ -1,16 +1,26 @@
|
||||||
|
|
||||||
VERSION = 0022
|
include $(CURDIR)/../Makefile.inc
|
||||||
BASEURL = http://arduino.googlecode.com/files/
|
|
||||||
OUT = /srv/puppet/files/common/packages
|
|
||||||
|
|
||||||
all: $(OUT)/arduino32.tgz $(OUT)/arduino64.tgz
|
VERSION = 1.0
|
||||||
|
|
||||||
$(OUT)/arduino32.tgz:
|
TARGET32 = arduino32-$(VERSION).tgz
|
||||||
@umask 022
|
SOURCE32 = http://arduino.googlecode.com/files/arduino-$(VERSION)-linux.tgz
|
||||||
cd $(OUT) && wget -nv -N $(BASEURL)/arduino-$(VERSION).tgz && \
|
TARGET64 = arduino64-$(VERSION).tgz
|
||||||
ln -sf arduino-$(VERSION).tgz arduino32.tgz
|
SOURCE64 = http://arduino.googlecode.com/files/arduino-$(VERSION)-linux64.tgz
|
||||||
|
|
||||||
$(OUT)/arduino64.tgz:
|
all: download manifest
|
||||||
@umask 022
|
download: $(PACKAGES)/$(TARGET32) $(PACKAGES)/$(TARGET64)
|
||||||
cd $(OUT) && wget -nv -N $(BASEURL)/arduino-$(VERSION)-64-2.tgz && \
|
manifest: $(MANIFESTS)/arduino.pp
|
||||||
ln -sf arduino-$(VERSION)-64-2.tgz arduino64.tgz
|
|
||||||
|
$(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)"' >> $@
|
||||||
|
|
|
@ -12,15 +12,28 @@ class arduino {
|
||||||
before => File["/usr/local/bin/arduino"],
|
before => File["/usr/local/bin/arduino"],
|
||||||
}
|
}
|
||||||
|
|
||||||
case $architecture {
|
if !$arduino_package {
|
||||||
"x86_64": { $bits = "64" }
|
case $architecture {
|
||||||
default: { $bits = "32" }
|
"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":
|
file { "/usr/local/src/arduino.tgz":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
source => "puppet:///files/packages/arduino${bits}.tgz",
|
source => "puppet:///files/packages/${arduino_package}",
|
||||||
links => follow,
|
|
||||||
mode => 0644,
|
mode => 0644,
|
||||||
owner => "root",
|
owner => "root",
|
||||||
group => "root",
|
group => "root",
|
||||||
|
|
Loading…
Add table
Reference in a new issue