Files
chromebrew/packages/openhab.rb
Maximilian Downey Twiss f6dc1d8d4e Derive binary_url in package.rb (#7082)
* Add binary_compression value to each package

* Remove binary_url values and arrays

* Handle packages with empty binary_sha256 arrays (either missing binaries or not compiled by us)
2024-01-25 11:03:31 -05:00

36 lines
1.0 KiB
Ruby

require 'package'
class Openhab < Package
description 'A vendor and technology agnostic open source automation software for your home'
homepage 'https://www.openhab.org/'
version '3.2.0'
license 'Eclipse Public License 2.0'
compatibility 'x86_64'
source_url 'https://openhab.jfrog.io/artifactory/libs-release-local/org/openhab/distro/openhab/3.2.0/openhab-3.2.0.tar.gz'
source_sha256 'e8185adcaabdec4b860c22ec854f37db0aa490d47e3f8654cef0f1dd7346d476'
no_compile_needed
depends_on 'jdk11'
def self.build
openhab = <<~EOF
#!/bin/bash
cd #{CREW_PREFIX}/share/openhab
./start.sh
EOF
File.write('openhab.sh', openhab)
end
def self.install
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/bin"
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/share/openhab"
FileUtils.install 'openhab.sh', "#{CREW_DEST_PREFIX}/bin/openhab", mode: 0o755
FileUtils.mv Dir['*'], "#{CREW_DEST_PREFIX}/share/openhab"
end
def self.postinstall
puts "\nTo get started, execute 'openhab'.\n".lightblue
end
end