pkgname=ruby-ronn-ng pkgver=0.10.1 pkgrel=1 pkgdesc="Manual page formatter that generates man pages from markdown" arch=('x86_64') url="https://github.com/apjanke/ronn-ng" license=('MIT') depends=('ruby') options=('!emptydirs') source=(https://github.com/apjanke/ronn-ng/archive/${pkgver}/${pkgname#*-}-${pkgver}.tar.gz) sha256sums=(180f18015ce01be1d10c24e13414134363d56f9efb741fda460358bb67d96684 e3b2b33d0b13c5e87e376314bd9a0fe0799fa910cc4fbd2dcf57384d523283ca) prepare() { cd ${pkgname#*-}-${pkgver} sed --in-place --regexp-extended 's|~>|>=|g' "${pkgname#*-}.gemspec" } build() { cd ${pkgname#*-}-${pkgver} local _gemdir="$(gem env gemdir)" gem build --verbose "${pkgname#*-}.gemspec" gem install \ --local \ --verbose \ --ignore-dependencies \ --no-user-install \ --install-dir "tmp_install${_gemdir}" \ --bindir "tmp_install/usr/bin" \ "${pkgname#*-}-${pkgver}.gem" # remove unrepreducible files rm --force --recursive --verbose \ "tmp_install${_gemdir}/cache/" \ "tmp_install${_gemdir}/gems/${pkgname#*-}-${pkgver}/vendor/" \ "tmp_install${_gemdir}/doc/${pkgname#*-}-${pkgver}/ri/ext/" find "tmp_install${_gemdir}/gems/" -type f \ \( -iname "*.o" -o \ -iname "*.c" -o \ -iname "*.so" -o \ -iname "*.time" -o \ -iname "gem.build_complete" -o \ -iname "Makefile" \ \) -delete find "tmp_install${_gemdir}/extensions/" -type f \ \( -iname "mkmf.log" -o \ -iname "gem_make.out" \ \) -delete } package() { cd ${pkgname#*-}-${pkgver} cp --archive --verbose tmp_install/* ${pkgdir} install --verbose -D --mode=0644 *.md --target-directory ${pkgdir}/usr/share/doc/${pkgname}-${pkgver} install --verbose -D --mode=0644 man/ronn.1 --target-directory ${pkgdir}/usr/share/man/man1 install --verbose -D --mode=0644 man/ronn-format.7 --target-directory ${pkgdir}/usr/share/man/man7 install --verbose -D --mode=0644 completion/bash/ronn --target-directory ${pkgdir}/usr/share/bash-completion/completions install --verbose -D --mode=0644 completion/zsh/_ronn --target-directory ${pkgdir}/usr/share/zsh/site-functions }