-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[ruby-iostruct] | ||
source = "git" | ||
git = "https://github.com/zed-0xff/iostruct.git" | ||
use_max_tag = true | ||
prefix = "v" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Maintainer: Xeonacid <[email protected]> | ||
|
||
_name=iostruct | ||
pkgname=ruby-${_name} | ||
pkgver=0.4.0 | ||
pkgrel=1 | ||
pkgdesc="A Struct that can read/write itself from/to IO-like objects" | ||
arch=(any) | ||
url="https://github.com/zed-0xff/${_name}" | ||
license=(MIT) | ||
depends=(ruby) | ||
makedepends=(git) | ||
source=("git+$url.git#tag=v$pkgver") | ||
sha256sums=('53ad352d8994c0cc805140d11d04626af5f29a21b50f2a3e83f158cc555ea8e0') | ||
|
||
prepare() { | ||
cd "${_name}" | ||
|
||
# update gemspec/Gemfile to allow newer version of the dependencies | ||
sed --in-place --regexp-extended 's|~>|>=|g' "${_name}.gemspec" | ||
} | ||
|
||
build() { | ||
cd "${_name}" | ||
|
||
local _gemdir="$(gem env gemdir)" | ||
|
||
gem build "${_name}.gemspec" | ||
|
||
gem install \ | ||
--local \ | ||
--verbose \ | ||
--ignore-dependencies \ | ||
--build-root "tmp_install" \ | ||
"${_name}-${pkgver}.gem" | ||
|
||
# remove unrepreducible files | ||
rm --force --recursive --verbose \ | ||
"tmp_install/${_gemdir}/cache/" \ | ||
"tmp_install/${_gemdir}/gems/${_name}-${pkgver}/vendor/" \ | ||
"tmp_install/${_gemdir}/doc/${_name}-${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 "${_name}" | ||
|
||
cp --archive --verbose tmp_install/* "${pkgdir}" | ||
|
||
install --verbose -D --mode=0644 LICENSE.txt --target-directory "${pkgdir}/usr/share/licenses/${pkgname}" | ||
install --verbose -D --mode=0644 README.md --target-directory "${pkgdir}/usr/share/doc/${pkgname}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
maintainers: | ||
- github: Xeonacid | ||
email: [email protected] | ||
|
||
pre_build_script: update_pkgver_and_pkgrel(_G.newver) | ||
|
||
post_build_script: | | ||
git_pkgbuild_commit() | ||
update_on: | ||
- source: github | ||
github: zed-0xff/iostruct | ||
use_max_tag: true | ||
prefix: v | ||
- alias: ruby |