Date: Friday, January 21, 2022 @ 22:53:20
  Author: segaja
Revision: 1112876

create package ruby-rails-html-sanitizer 1.4.2-1

Added:
  ruby-rails-html-sanitizer/
  ruby-rails-html-sanitizer/repos/
  ruby-rails-html-sanitizer/trunk/
  ruby-rails-html-sanitizer/trunk/PKGBUILD

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

Added: ruby-rails-html-sanitizer/trunk/PKGBUILD
===================================================================
--- ruby-rails-html-sanitizer/trunk/PKGBUILD                            (rev 0)
+++ ruby-rails-html-sanitizer/trunk/PKGBUILD    2022-01-21 22:53:20 UTC (rev 
1112876)
@@ -0,0 +1,48 @@
+# Maintainer: Andreas 'Segaja' Schleifer <segaja at archlinux dot org>
+
+_gemname='rails-html-sanitizer'
+pkgname="ruby-${_gemname}"
+pkgver=1.4.2
+pkgrel=1
+pkgdesc='HTML sanitization for Rails applications'
+arch=('any')
+url='https://github.com/rails/rails-html-sanitizer'
+license=('MIT')
+options=(!emptydirs)
+depends=('ruby' 'ruby-loofah')
+makedepends=('ruby-bundler' 'ruby-minitest' 'ruby-rake')
+#checkdepends=('ruby-rails-dom-testing')
+source=("${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
+sha512sums=('bbffcb04169ae8036126d1e14bff56f46741a9fd8d34b4dad106e43f82ba1c6b8a471bd515d0e62989fbecb021e25c227d4c3e91e6bddcb00349ce044ce483d2')
+
+prepare() {
+  cd "${_gemname}-${pkgver}"
+
+  # update gemspec/Gemfile to allow newer version of the dependencies
+  sed -r 's|~>|>=|g' -i "${_gemname}.gemspec" Gemfile
+}
+
+build() {
+  cd "${_gemname}-${pkgver}"
+
+  rake build
+}
+
+# errors in tests: https://github.com/rails/rails-html-sanitizer/issues/125
+#check() {
+#  cd "${_gemname}-${pkgver}"
+#
+#  rake test
+#}
+
+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 -D -m644 MIT-LICENSE 
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}

Reply via email to