[arch-commits] Commit in ruby-hashdiff/repos (community-any community-any/PKGBUILD)
Tim Meusel
bastelfreak at archlinux.org
Sun May 16 19:55:12 UTC 2021
Date: Sunday, May 16, 2021 @ 19:55:11
Author: bastelfreak
Revision: 935949
archrelease: copy trunk to community-any
Added:
ruby-hashdiff/repos/community-any/
ruby-hashdiff/repos/community-any/PKGBUILD
(from rev 935948, ruby-hashdiff/trunk/PKGBUILD)
----------+
PKGBUILD | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
Copied: ruby-hashdiff/repos/community-any/PKGBUILD (from rev 935948, ruby-hashdiff/trunk/PKGBUILD)
===================================================================
--- community-any/PKGBUILD (rev 0)
+++ community-any/PKGBUILD 2021-05-16 19:55:11 UTC (rev 935949)
@@ -0,0 +1,61 @@
+# Maintainer: Tim Meusel <tim at bastelfreak.de>
+# Contributor: Christian Rebischke <chris.rebischke at archlinux.org>
+
+_gemname='hashdiff'
+pkgname="ruby-${_gemname}"
+pkgver=1.0.1
+pkgrel=1
+pkgdesc='Library to compute the smallest difference between two hashes'
+arch=('any')
+url="https://github.com/liufengyun/${_gemname}"
+license=('MIT')
+makedepends=('ruby-rdoc' 'ruby-bundler')
+checkdepends=('ruby-rake' 'ruby-rspec')
+depends=('ruby')
+options=(!emptydirs)
+source=("${url}/archive/v${pkgver}/${pkgname}-v${pkgver}.tar.gz")
+sha512sums=('014e4eb6b84dd0266c7db4dd570be96df1c557ab16ccd060adbe2f464647032e58fd75d97ea05b452b773e4969665d59f08779e9d44562ea73ede8738f1e6219')
+
+prepare() {
+ cd "${srcdir}/${_gemname}-${pkgver}"
+
+ # use `find` instead of `git`, since we have a tar ball and not a VCS repository
+ sed --in-place 's/git ls-files.*`/find`/g' "${_gemname}.gemspec"
+ sed --in-place '/test_files/d' "${_gemname}.gemspec"
+
+ # rubocop would test if the code works on a legay ruby platform
+ sed --in-place '/rubocop/d' Rakefile
+ sed --in-place '/RuboCop/d' Rakefile
+
+ # loading bundler isn't required and often triggers side effects
+ # because it wants *all* gems from gemspec + Gemfile
+ sed --in-place '/Bundler/d' Rakefile
+ sed --in-place '/Bundler/d' Rakefile
+
+ # the project has a few dependencies for releasing
+ sed --in-place '/bluecloth/d' "${_gemname}.gemspec"
+ sed --in-place '/rubocop/d' "${_gemname}.gemspec"
+ sed --in-place '/yard/d' "${_gemname}.gemspec"
+}
+
+build() {
+ cd "${srcdir}/${_gemname}-${pkgver}"
+ gem build "${_gemname}.gemspec"
+}
+
+check() {
+ cd "${srcdir}/${_gemname}-${pkgver}"
+ rake spec
+}
+
+package() {
+ cd "${srcdir}/${_gemname}-${pkgver}"
+ local _gemdir="$(gem env gemdir)"
+ gem install --verbose --ignore-dependencies --no-user-install --install-dir "${pkgdir}/${_gemdir}" --bindir "${pkgdir}/usr/bin" "${_gemname}-${pkgver}.gem"
+
+ install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"
+
+ rm -rf "${pkgdir}/${_gemdir}/cache"
+}
+
+# vim: ts=2 sw=2 et:
More information about the arch-commits
mailing list