[arch-commits] Commit in ruby-method_source/repos (2 files)

Andreas Schleifer segaja at gemini.archlinux.org
Sun Jan 23 20:25:12 UTC 2022


    Date: Sunday, January 23, 2022 @ 20:25:11
  Author: segaja
Revision: 1113854

archrelease: copy trunk to community-any

Added:
  ruby-method_source/repos/community-any/
  ruby-method_source/repos/community-any/PKGBUILD
    (from rev 1113853, ruby-method_source/trunk/PKGBUILD)

----------+
 PKGBUILD |   51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

Copied: ruby-method_source/repos/community-any/PKGBUILD (from rev 1113853, ruby-method_source/trunk/PKGBUILD)
===================================================================
--- community-any/PKGBUILD	                        (rev 0)
+++ community-any/PKGBUILD	2022-01-23 20:25:11 UTC (rev 1113854)
@@ -0,0 +1,51 @@
+# Maintainer: Andreas 'Segaja' Schleifer <segaja at archlinux dot org>
+
+_gemname='method_source'
+pkgname="ruby-${_gemname}"
+pkgver=1.0.0
+pkgrel=2
+pkgdesc='retrieve the sourcecode for a method'
+arch=('any')
+url='https://github.com/banister/method_source'
+license=('MIT')
+options=(!emptydirs)
+depends=('ruby')
+makedepends=('ruby-bundler' 'ruby-rake' 'ruby-rspec')
+source=("${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
+sha512sums=('1ec606c5de5cf37ca323d645f172eabf02d7adfb1b529e32b97e7c642422906b8501caed4aeb7d66534c3c496eea8918fd2b28d0064487c404658954e920b280')
+
+prepare() {
+  cd "${_gemname}-${pkgver}"
+
+  # we built based on a tar archive, not a git repo
+  sed --in-place --regexp-extended 's|git ls-files -- spec/*|find spec -type f|' Rakefile
+  sed --in-place --regexp-extended 's|git ls-files|find . -type f -not -path "*/.git*"|' Rakefile
+
+  # update gemspec/Gemfile to allow newer version of the dependencies
+  sed --in-place --regexp-extended 's|~>|>=|g' "${_gemname}.gemspec"
+}
+
+build() {
+  cd "${_gemname}-${pkgver}"
+
+  rake ruby:gem
+}
+
+check() {
+  cd "${_gemname}-${pkgver}"
+
+  rake spec
+}
+
+package() {
+  cd "${_gemname}-${pkgver}"
+
+  local _gemdir="$(gem env gemdir)"
+
+  gem install --ignore-dependencies --no-user-install -i "${pkgdir}/${_gemdir}" -n "${pkgdir}/usr/bin" "pkg/${_gemname}-${pkgver}.gem"
+
+  rm "${pkgdir}/${_gemdir}/cache/${_gemname}-${pkgver}.gem"
+
+  install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+  install -Dm 644 CHANGELOG.md README.markdown --target-directory "${pkgdir}/usr/share/doc/${pkgname}"
+}



More information about the arch-commits mailing list