Replace hhvm updater
This commit is contained in:
parent
f0975ea4a1
commit
6e15f2340d
46
Rakefile
46
Rakefile
@ -27,8 +27,7 @@ task :dmd do
|
|||||||
homepage: 'https://dlang.org'
|
homepage: 'https://dlang.org'
|
||||||
|
|
||||||
write_info package,
|
write_info package,
|
||||||
download: [uri.to_s],
|
downloads: [Download.new(uri.to_s, checksum[:dmd])]
|
||||||
md5sum: [checksum[:dmd]]
|
|
||||||
|
|
||||||
update_slackbuild_version 'development/dmd', version
|
update_slackbuild_version 'development/dmd', version
|
||||||
commit 'development/dmd', version
|
commit 'development/dmd', version
|
||||||
@ -52,17 +51,11 @@ task :dmd do
|
|||||||
requires: ['dmd']
|
requires: ['dmd']
|
||||||
|
|
||||||
write_info package,
|
write_info package,
|
||||||
download: [
|
downloads: [
|
||||||
hosted_sources("/d-tools/dub-#{dub_version}.tar.gz"),
|
Download.new(hosted_sources("/d-tools/dub-#{dub_version}.tar.gz"), checksum[:dub]),
|
||||||
hosted_sources("/d-tools/tools-#{version}.tar.gz"),
|
Download.new(hosted_sources("/d-tools/tools-#{version}.tar.gz"), checksum[:tools]),
|
||||||
hosted_sources("/d-tools/D-Scanner-#{dscanner_version}.tar.xz"),
|
Download.new(hosted_sources("/d-tools/D-Scanner-#{dscanner_version}.tar.xz"), checksum[:dscanner]),
|
||||||
hosted_sources("/d-tools/DCD-#{dcd_version}.tar.xz")
|
Download.new(hosted_sources("/d-tools/DCD-#{dcd_version}.tar.xz"), checksum[:dcd])
|
||||||
],
|
|
||||||
md5sum: [
|
|
||||||
checksum[:dub],
|
|
||||||
checksum[:tools],
|
|
||||||
checksum[:dscanner],
|
|
||||||
checksum[:dcd]
|
|
||||||
]
|
]
|
||||||
|
|
||||||
slackbuild_filename = 'slackbuilds/development/d-tools/d-tools.SlackBuild'
|
slackbuild_filename = 'slackbuilds/development/d-tools/d-tools.SlackBuild'
|
||||||
@ -89,8 +82,7 @@ task :composer do
|
|||||||
uri = URI "https://getcomposer.org/download/#{version}/composer.phar"
|
uri = URI "https://getcomposer.org/download/#{version}/composer.phar"
|
||||||
checksum = download uri, 'slackbuilds/development/composer/composer.phar'
|
checksum = download uri, 'slackbuilds/development/composer/composer.phar'
|
||||||
write_info package,
|
write_info package,
|
||||||
download: ["https://getcomposer.org/download/#{version}/composer.phar"],
|
downloads: [Download.new("https://getcomposer.org/download/#{version}/composer.phar", checksum.hexdigest)]
|
||||||
md5sum: [checksum.hexdigest]
|
|
||||||
update_slackbuild_version 'development/composer', version
|
update_slackbuild_version 'development/composer', version
|
||||||
|
|
||||||
commit 'development/composer', version
|
commit 'development/composer', version
|
||||||
@ -116,10 +108,10 @@ task 'universal-ctags' do
|
|||||||
package = Package.new 'development/universal-ctags',
|
package = Package.new 'development/universal-ctags',
|
||||||
version: version,
|
version: version,
|
||||||
homepage: 'https://ctags.io/'
|
homepage: 'https://ctags.io/'
|
||||||
|
download = "https://download.dlackware.com/hosted-sources/universal-ctags/ctags-#{ENV['COMMIT']}.tar.xz"
|
||||||
|
|
||||||
write_info package,
|
write_info package,
|
||||||
download: ["https://download.dlackware.com/hosted-sources/universal-ctags/ctags-#{ENV['COMMIT']}.tar.xz"],
|
downloads: [Download.new(download, checksum.hexdigest)]
|
||||||
md5sum: [checksum.hexdigest]
|
|
||||||
update_slackbuild_version 'development/universal-ctags', version
|
update_slackbuild_version 'development/universal-ctags', version
|
||||||
sh 'sed',
|
sh 'sed',
|
||||||
'-i',
|
'-i',
|
||||||
@ -128,3 +120,23 @@ task 'universal-ctags' do
|
|||||||
|
|
||||||
commit 'development/universal-ctags', version
|
commit 'development/universal-ctags', version
|
||||||
end
|
end
|
||||||
|
|
||||||
|
task :hhvm do
|
||||||
|
version = '4.104.1'
|
||||||
|
checksum = {}
|
||||||
|
|
||||||
|
checksum[:hhvm] = clone 'https://github.com/facebook/hhvm.git',
|
||||||
|
"development/hhvm/hhvm-#{version}.tar.xz", 'HHVM-'
|
||||||
|
|
||||||
|
package = Package.new 'development/hhvm',
|
||||||
|
version: version,
|
||||||
|
homepage: 'https://hhvm.com/',
|
||||||
|
requires: %w[tbb glog libdwarf libmemcached dobule-conversion]
|
||||||
|
|
||||||
|
write_info package,
|
||||||
|
downloads: [
|
||||||
|
Download.new(hosted_sources("/hhvm/hhvm-#{version}.tar.xz"), checksum[:hhvm], is64: true)
|
||||||
|
]
|
||||||
|
|
||||||
|
update_slackbuild_version 'development/hhvm', version
|
||||||
|
end
|
||||||
|
@ -4,4 +4,4 @@ CONFIG = {
|
|||||||
remote_path: 'example.com:/srv/httpd/some/path',
|
remote_path: 'example.com:/srv/httpd/some/path',
|
||||||
download_url: 'https://example.com/some/path',
|
download_url: 'https://example.com/some/path',
|
||||||
branch: 'user/nick/updates'
|
branch: 'user/nick/updates'
|
||||||
}
|
}.freeze
|
||||||
|
@ -72,20 +72,20 @@ def upload_command(local_path, remote_path)
|
|||||||
['scp', "slackbuilds/#{local_path}", CONFIG[:remote_path] + remote_path]
|
['scp', "slackbuilds/#{local_path}", CONFIG[:remote_path] + remote_path]
|
||||||
end
|
end
|
||||||
|
|
||||||
def clone_and_archive(repo, name_version, tarball)
|
def clone_and_archive(repo, name_version, tarball, tag_prefix = 'v')
|
||||||
_, _, version = name_version.rpartition '-'
|
_, _, version = name_version.rpartition '-'
|
||||||
|
|
||||||
rm_rf name_version
|
rm_rf name_version
|
||||||
|
|
||||||
sh "git clone #{repo} #{name_version}"
|
sh 'git', 'clone', repo, name_version
|
||||||
sh "git -C #{name_version} checkout v#{version}"
|
sh 'git', '-C', name_version, 'checkout', "#{tag_prefix}#{version}"
|
||||||
sh "git -C #{name_version} submodule update --init --recursive"
|
sh 'git', '-C', name_version, 'submodule', 'update', '--init', '--recursive'
|
||||||
|
|
||||||
sh "tar Jcvf slackbuilds/#{tarball} #{name_version}"
|
sh 'tar', 'Jcvf', "slackbuilds/#{tarball}", name_version
|
||||||
rm_rf name_version
|
rm_rf name_version
|
||||||
end
|
end
|
||||||
|
|
||||||
def clone(repo, tarball)
|
def clone(repo, tarball, tag_prefix = 'v')
|
||||||
name_version = File.basename tarball, '.tar.xz'
|
name_version = File.basename tarball, '.tar.xz'
|
||||||
remote_path = tarball[tarball.index('/')..]
|
remote_path = tarball[tarball.index('/')..]
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ def clone(repo, tarball)
|
|||||||
return download(uri, "slackbuilds/#{tarball}").hexdigest
|
return download(uri, "slackbuilds/#{tarball}").hexdigest
|
||||||
end
|
end
|
||||||
|
|
||||||
clone_and_archive repo, name_version, tarball
|
clone_and_archive repo, name_version, tarball, tag_prefix
|
||||||
|
|
||||||
sh(*upload_command(tarball, remote_path))
|
sh(*upload_command(tarball, remote_path))
|
||||||
|
|
||||||
@ -115,9 +115,9 @@ def download_and_deploy(uri, tarball)
|
|||||||
checksum.hexdigest
|
checksum.hexdigest
|
||||||
end
|
end
|
||||||
|
|
||||||
def write_info(package, download:, md5sum:)
|
def write_info(package, downloads:)
|
||||||
File.open "slackbuilds/#{package.path}/#{package.name}.info", 'w' do |file|
|
File.open "slackbuilds/#{package.path}/#{package.name}.info", 'w' do |file|
|
||||||
file.write info_template(package, download, md5sum)
|
file.write info_template(package, downloads)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -19,17 +19,54 @@ class Package
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def info_template(package, download, md5sum)
|
class Download
|
||||||
|
attr_reader :download, :md5sum
|
||||||
|
|
||||||
|
def initialize(download, md5sum, is64: false)
|
||||||
|
@download = download
|
||||||
|
@md5sum = md5sum
|
||||||
|
@is64 = is64
|
||||||
|
end
|
||||||
|
|
||||||
|
def is64?
|
||||||
|
@is64
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def info_template(package, downloads)
|
||||||
|
downloads64, downloads32 = downloads.partition(&:is64?)
|
||||||
|
download32, md5sum32, download64, md5sum64 = download_entries downloads64, downloads32
|
||||||
|
|
||||||
<<~INFO_FILE
|
<<~INFO_FILE
|
||||||
PRGNAM="#{package.name}"
|
PRGNAM="#{package.name}"
|
||||||
VERSION="#{package.version}"
|
VERSION="#{package.version}"
|
||||||
HOMEPAGE="#{package.homepage}"
|
HOMEPAGE="#{package.homepage}"
|
||||||
DOWNLOAD="#{download * " \\\n "}"
|
DOWNLOAD="#{download32}"
|
||||||
MD5SUM="#{md5sum * " \\\n "}"
|
MD5SUM="#{md5sum32}"
|
||||||
DOWNLOAD_x86_64=""
|
DOWNLOAD_x86_64="#{download64}"
|
||||||
MD5SUM_x86_64=""
|
MD5SUM_x86_64="#{md5sum64}"
|
||||||
REQUIRES="#{package.requires.empty? ? '%README%' : package.requires * ' '}"
|
REQUIRES="#{requires_entry package.requires}"
|
||||||
MAINTAINER="Eugene Wissner"
|
MAINTAINER="Eugene Wissner"
|
||||||
EMAIL="belka@caraus.de"
|
EMAIL="belka@caraus.de"
|
||||||
INFO_FILE
|
INFO_FILE
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def requires_entry(requires)
|
||||||
|
requires.empty? ? '%README%' : requires * ' '
|
||||||
|
end
|
||||||
|
|
||||||
|
def download_entries(downloads64, downloads32)
|
||||||
|
download32 =
|
||||||
|
if downloads32.empty? && !downloads64.empty?
|
||||||
|
'UNSUPPORTED'
|
||||||
|
else
|
||||||
|
downloads32.map(&:download) * " \\\n "
|
||||||
|
end
|
||||||
|
md5sum32 = downloads32.map(&:md5sum) * " \\\n "
|
||||||
|
download64 = downloads64.map(&:download) * " \\\n "
|
||||||
|
md5sum64 = downloads64.map(&:md5sum) * " \\\n "
|
||||||
|
|
||||||
|
[download32, md5sum32, download64, md5sum64]
|
||||||
|
end
|
||||||
|
@ -1,60 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
||||||
|
|
||||||
VERSION=${VERSION:-4.32.0}
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
git clone https://github.com/facebook/hhvm.git
|
|
||||||
mv hhvm hhvm-$VERSION
|
|
||||||
|
|
||||||
cd hhvm-$VERSION
|
|
||||||
git checkout HHVM-$VERSION
|
|
||||||
git submodule update --init --recursive
|
|
||||||
|
|
||||||
cd third-party
|
|
||||||
rm -rf libsqlite3 \
|
|
||||||
lz4 \
|
|
||||||
pcre
|
|
||||||
# libzip
|
|
||||||
cd ..
|
|
||||||
find -name "\.git*" -print0 | xargs -0 rm -rf
|
|
||||||
|
|
||||||
cd ..
|
|
||||||
tar Jcvf hhvm-$VERSION.tar.xz hhvm-$VERSION
|
|
||||||
rm -rf hhvm-$VERSION
|
|
||||||
scp hhvm-$VERSION.tar.xz caraus.de:/srv/httpd/dlackware/download/hosted-sources/hhvm
|
|
||||||
CHECKSUM=`md5sum hhvm-$VERSION.tar.xz | cut -d ' ' -f 1`
|
|
||||||
|
|
||||||
cat <<EOF > hhvm.info
|
|
||||||
PRGNAM="hhvm"
|
|
||||||
VERSION="$VERSION"
|
|
||||||
HOMEPAGE="https://hhvm.com/"
|
|
||||||
DOWNLOAD="UNSUPPORTED"
|
|
||||||
MD5SUM=""
|
|
||||||
DOWNLOAD_x86_64="https://download.dlackware.com/hosted-sources/hhvm/hhvm-${VERSION}.tar.xz"
|
|
||||||
MD5SUM_x86_64="$CHECKSUM"
|
|
||||||
REQUIRES="tbb glog dwarf oniguruma libmemcached krb5 lz4 libsodium"
|
|
||||||
MAINTAINER="Eugene Wissner"
|
|
||||||
EMAIL="belka@caraus.de"
|
|
||||||
EOF
|
|
||||||
|
|
||||||
rm -f slackbuilds/development/hhvm/*.tar.xz
|
|
||||||
mv \
|
|
||||||
hhvm.info \
|
|
||||||
hhvm-$VERSION.tar.xz \
|
|
||||||
slackbuilds/development/hhvm/
|
|
||||||
cd slackbuilds/development/hhvm
|
|
||||||
|
|
||||||
# Update version in the SlackBuild.
|
|
||||||
sed -i "s#^\(VERSION=\)\${VERSION:-.\+#\1\${VERSION:-$VERSION}#" hhvm.SlackBuild
|
|
||||||
|
|
||||||
BRANCH="hhvm${VERSION//.}"
|
|
||||||
git checkout master
|
|
||||||
git checkout -b $BRANCH
|
|
||||||
git add .
|
|
||||||
git commit -m "development/hhvm: Updated for version $VERSION"
|
|
||||||
#git push origin $BRANCH
|
|
Loading…
Reference in New Issue
Block a user