termux-packages/packages/asciidoctor/build.sh

37 lines
1.2 KiB
Bash
Raw Normal View History

2020-01-01 16:37:38 +01:00
TERMUX_PKG_HOMEPAGE=https://asciidoctor.org/
TERMUX_PKG_DESCRIPTION="An implementation of AsciiDoc in Ruby"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
2022-03-10 20:48:11 +01:00
TERMUX_PKG_VERSION=2.0.17
2020-01-01 16:37:38 +01:00
TERMUX_PKG_DEPENDS="ruby"
TERMUX_PKG_SKIP_SRC_EXTRACT=true
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_PLATFORM_INDEPENDENT=true
2020-01-01 16:37:38 +01:00
2022-03-10 20:48:11 +01:00
termux_step_pre_configure() {
ruby_version=$(. $TERMUX_SCRIPTDIR/packages/ruby/build.sh; echo $TERMUX_PKG_VERSION)
}
2020-01-01 16:37:38 +01:00
termux_step_make_install() {
2022-03-10 20:48:11 +01:00
local gemdir="$TERMUX_PREFIX/lib/ruby/gems/${ruby_version:0:3}.0"
2020-01-01 16:37:38 +01:00
rm -rf "$gemdir/asciidoctor-$TERMUX_PKG_VERSION"
rm -rf "$gemdir/doc/asciidoctor-$TERMUX_PKG_VERSION"
gem install --ignore-dependencies --no-user-install --verbose \
-i "$gemdir" -n "$TERMUX_PREFIX/bin" asciidoctor -v "$TERMUX_PKG_VERSION"
sed -i -E "1 s@^(#\!)(.*)@\1${TERMUX_PREFIX}/bin/ruby@" \
"$TERMUX_PREFIX/bin/asciidoctor"
install -Dm600 "$gemdir/gems/asciidoctor-${TERMUX_PKG_VERSION}/man/asciidoctor.1" \
"$TERMUX_PREFIX/share/man/main1/asciidoctor.1"
}
2020-11-08 21:56:36 +01:00
termux_step_install_license() {
2022-03-10 20:48:11 +01:00
local gemdir="$TERMUX_PREFIX/lib/ruby/gems/${ruby_version:0:3}.0"
2020-11-08 21:56:36 +01:00
mkdir -p $TERMUX_PREFIX/share/doc/asciidoctor
2022-03-10 20:48:11 +01:00
cp $gemdir/gems/asciidoctor-${TERMUX_PKG_VERSION}/LICENSE \
$TERMUX_PREFIX/share/doc/asciidoctor/
2020-11-08 21:56:36 +01:00
}