Date: Friday, January 21, 2022 @ 22:53:35 Author: segaja Revision: 1112877
archrelease: copy trunk to community-any Added: ruby-rails-html-sanitizer/repos/community-any/ ruby-rails-html-sanitizer/repos/community-any/PKGBUILD (from rev 1112876, ruby-rails-html-sanitizer/trunk/PKGBUILD) ----------+ PKGBUILD | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) Copied: ruby-rails-html-sanitizer/repos/community-any/PKGBUILD (from rev 1112876, ruby-rails-html-sanitizer/trunk/PKGBUILD) =================================================================== --- community-any/PKGBUILD (rev 0) +++ community-any/PKGBUILD 2022-01-21 22:53:35 UTC (rev 1112877) @@ -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" +}