textproc/docbookrx: create port

DocBookRx is the prescription you need to get rid of your DocBook pain. This
tool converts DocBook XML to AsciiDoc.

DocBookRx is the start of a DocBook to AsciiDoc converter written in Ruby. This
converter is far from perfect at the moment and some of the conversion is done
hastily. The plan is to evolve it into a robust library for performing this
conversion in a reliable way.

WWW: https://github.com/asciidoctor/docbookrx
This commit is contained in:
Steve Wills 2019-09-13 18:38:11 +00:00
parent 423a94dc13
commit 072a58bf5a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=511980
4 changed files with 88 additions and 0 deletions

View file

@ -143,6 +143,7 @@
SUBDIR += docbook2X
SUBDIR += docbook2mdoc
SUBDIR += docbook2odf
SUBDIR += docbookrx
SUBDIR += doclifter
SUBDIR += docproj
SUBDIR += dom4j

View file

@ -0,0 +1,75 @@
# $FreeBSD$
PORTNAME= docbookrx
DISTVERSION= 1.0.0.dev
CATEGORIES= textproc
MAINTAINER= swills@FreeBSD.org
COMMENT= DocBook to AsciiDoc converter
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= ${LOCALBASE}/bin/rake:devel/rubygem-rake \
gem:devel/ruby-gems \
rubygem-bundler>=1.16:sysutils/rubygem-bundler \
rubygem-rspec>=1.2.2:devel/rubygem-rspec
RUN_DEPENDS= rubygem-nokogiri>=1.8:textproc/rubygem-nokogiri
USE_RUBY= yes
USE_GITHUB= yes
OPTIONS_DEFINE= DOCS
GH_ACCOUNT= allanjude
GH_PROJECT= docbookrx
GH_TAGNAME= 06cae39
GEM_ENV+= RB_USER_INSTALL=yes
USE_LOCALE?= en_US.UTF-8
GEM_ENV+= LANG=${USE_LOCALE} LC_ALL=${USE_LOCALE}
RUBYGEM_ARGS= -l --no-update-sources --ignore-dependencies \
--install-dir ${STAGEDIR}${PREFIX}/lib/ruby/gems/${RUBY_VER} \
--bindir=${STAGEDIR}${PREFIX}/bin
RUBYGEMBIN= ${LOCALBASE}/bin/gem${RUBY_VER:S/.//}
GEMS_BASE_DIR= lib/ruby/gems/${RUBY_VER}
GEMS_DIR= ${GEMS_BASE_DIR}/gems
DOC_DIR= ${GEMS_BASE_DIR}/doc
CACHE_DIR= ${GEMS_BASE_DIR}/cache
EXT_DIR= ${GEMS_BASE_DIR}/extensions
GEM_LIB_DIR?= ${GEMS_DIR}/${PORTNAME}-${DISTVERSION}
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MDOCS}
RUBYGEM_ARGS+= --document rdoc,ri
.else
RUBYGEM_ARGS+= --no-document
.endif
do-build:
cd ${BUILD_WRKSRC} && ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} build --force ${PORTNAME}.gemspec
do-install:
cd ${INSTALL_WRKSRC} && ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} install ${RUBYGEM_ARGS} ${PORTNAME}-${DISTVERSION}.gem -- ${CONFIGURE_ARGS}
${RM} -r ${STAGEDIR}${PREFIX}/${GEMS_BASE_DIR}/build_info
${FIND} ${STAGEDIR}${PREFIX}/${GEMS_BASE_DIR} -type f -name '*.so' -exec ${STRIP_CMD} {} +
${FIND} ${STAGEDIR}${PREFIX}/${GEMS_BASE_DIR} -type f \( -name mkmf.log -or -name gem_make.out \) -delete
${RM} -r ${STAGEDIR}${PREFIX}/${GEM_LIB_DIR}/extensions \
${STAGEDIR}${PREFIX}/${CACHE_DIR} 2> /dev/null || ${TRUE}
${RMDIR} ${STAGEDIR}${PREFIX}/${EXT_DIR} 2> /dev/null || ${TRUE}
${ECHO} bin/docbookrx >> ${TMPPLIST}
${ECHO} ${GEMS_BASE_DIR}/specifications/${PORTNAME}-${DISTVERSION}.gemspec >> ${TMPPLIST}
.if ${PORT_OPTIONS:MDOCS}
${FIND} -ds ${STAGEDIR}${PREFIX}/${DOC_DIR} -type f -print | ${SED} -E -e \
's,^${STAGEDIR}${PREFIX}/?,,' >> ${TMPPLIST}
.endif
${FIND} -ds ${STAGEDIR}${PREFIX}/${GEM_LIB_DIR} -type f -print | ${SED} -E -e \
's,^${STAGEDIR}${PREFIX}/?,,' >> ${TMPPLIST}
@if [ -d ${STAGEDIR}${PREFIX}/${EXT_DIR} ]; then \
${FIND} -ds ${STAGEDIR}${PREFIX}/${EXT_DIR} -type f -print | ${SED} -E -e \
's,^${STAGEDIR}${PREFIX}/?,,' >> ${TMPPLIST} ; \
fi
.include <bsd.port.mk>

View file

@ -0,0 +1,3 @@
TIMESTAMP = 1568045667
SHA256 (allanjude-docbookrx-1.0.0.dev-06cae39_GH0.tar.gz) = 8222a6c8c1f0fa4ee2081b625b97dc8574fb158d173271efb5c6d3875fa5d407
SIZE (allanjude-docbookrx-1.0.0.dev-06cae39_GH0.tar.gz) = 151430

View file

@ -0,0 +1,9 @@
DocBookRx is the prescription you need to get rid of your DocBook pain. This
tool converts DocBook XML to AsciiDoc.
DocBookRx is the start of a DocBook to AsciiDoc converter written in Ruby. This
converter is far from perfect at the moment and some of the conversion is done
hastily. The plan is to evolve it into a robust library for performing this
conversion in a reliable way.
WWW: https://github.com/asciidoctor/docbookrx