diff --git a/Rakefile b/Rakefile index ed5a9f3..39e2a8a 100644 --- a/Rakefile +++ b/Rakefile @@ -85,37 +85,23 @@ task :composer, [:version] do |_, arguments| commit 'development/composer', arguments[:version] end -task 'universal-ctags' do - ENV['COMMIT'] = `git ls-remote https://github.com/universal-ctags/ctags.git master` - .split - .first - version = ENV['COMMIT'][0...7] - - sh 'git', 'clone', '--recurse-submodules', 'https://github.com/universal-ctags/ctags.git', "ctags-#{ENV['COMMIT']}" - rm_rf ["ctags-#{ENV['COMMIT']}/.git", "ctags-#{ENV['COMMIT']}/.gitignore"], secure: true - tarball = "slackbuilds/development/universal-ctags/ctags-#{ENV['COMMIT']}.tar.xz" - sh 'tar', 'Jcvf', tarball, "ctags-#{ENV['COMMIT']}" - - rm_rf "ctags-#{ENV['COMMIT']}", secure: true - - checksum = Digest::MD5.file tarball - - sh 'scp', tarball, "#{CONFIG[:remote_path]}/universal-ctags" - +task 'universal-ctags', [:version] do |_, arguments| package = Package.new 'development/universal-ctags', - version: version, - homepage: 'https://ctags.io/' - download = "https://download.dlackware.com/hosted-sources/universal-ctags/ctags-#{ENV['COMMIT']}.tar.xz" + version: arguments[:version], + homepage: 'https://ctags.io/', + requires: ['%README%'] + + uri = "https://github.com/universal-ctags/ctags/archive/#{arguments[:version]}/ctags-#{arguments[:version]}.tar.gz" + tarball = "slackbuilds/development/universal-ctags/ctags-#{arguments[:version]}.tar.gz" + checksum = download URI(uri), tarball + download = "https://download.dlackware.com/hosted-sources/universal-ctags/ctags-#{arguments[:version]}.tar.gz" write_info package, downloads: [Download.new(download, checksum.hexdigest)] - update_slackbuild_version 'development/universal-ctags', version - sh 'sed', - '-i', - "s#^GITVERSION=${GITVERSION:-.\\+#GITVERSION=${GITVERSION:-#{ENV['COMMIT']}}#", - 'slackbuilds/development/universal-ctags/universal-ctags.SlackBuild' + update_slackbuild_version 'development/universal-ctags', arguments[:version] + sh 'scp', tarball, "#{CONFIG[:remote_path]}/universal-ctags" - commit 'development/universal-ctags', version + commit 'development/universal-ctags', arguments[:version] end task :hhvm do