archrelease: copy trunk to community-any
[ArchLinux/community.git] / ruby-multipart-parser / repos / community-any / PKGBUILD
blob06efb4268e6c5286c38433b03cea7386d6176c00
1 # Maintainer: Tim Meusel <tim@bastelfreak.de>
3 _gemname='multipart-parser'
4 pkgname="ruby-${_gemname}"
5 pkgver=0.1.1
6 pkgrel=2
7 pkgdesc='A simple parser for multipart MIME messages, written in Ruby'
8 arch=('any')
9 url='https://github.com/danabr/multipart-parser'
10 license=('MIT')
11 depends=('ruby')
12 makedepends=('ruby-rdoc' 'git')
13 checkdepends=('ruby-test-unit' 'ruby-bundler' 'ruby-rake')
14 options=('!emptydirs')
15 source=("git+${url}#commit=9b9c4acb7c441d20a2c5a596ec4aecdecf6ebfe9" 'fix-broken-tests.patch')
16 sha512sums=('SKIP'
17             'b955ab17fa167411a18ca950ee29a0db37e00ebd70e492a149a44f1937cc3eefcaf22201fa7d8c4464fcffc96b65829ef3741501bb32022ccbb770eb057a428d')
19 prepare() {
20   cd "${srcdir}/${_gemname}"
21   # cherry-picked the bugfix from https://github.com/danabr/multipart-parser/pull/5/files
22   patch -p1 -N -i "${srcdir}/fix-broken-tests.patch"
25 build() {
26   cd "${srcdir}/${_gemname}"
27   gem build "${_gemname}.gemspec"
30 check() {
31   cd "${srcdir}/${_gemname}"
32   rake test
35 package() {
36 cd "${srcdir}/${_gemname}"
37   local _gemdir="$(gem env gemdir)"
38   gem install --verbose --ignore-dependencies --no-user-install --install-dir "${pkgdir}/${_gemdir}" --bindir "${pkgdir}/usr/bin" "${_gemname}-${pkgver}.gem"
40   install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"
42   install -Dm 644 README -t "${pkgdir}/usr/share/doc/${pkgname}"
44   rm -rf "${pkgdir}/${_gemdir}/cache"