From 072a58bf5ab02cddf7afa833b851185039c2863b Mon Sep 17 00:00:00 2001 From: Steve Wills Date: Fri, 13 Sep 2019 18:38:11 +0000 Subject: [PATCH] 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 --- textproc/Makefile | 1 + textproc/docbookrx/Makefile | 75 ++++++++++++++++++++++++++++++++++++ textproc/docbookrx/distinfo | 3 ++ textproc/docbookrx/pkg-descr | 9 +++++ 4 files changed, 88 insertions(+) create mode 100644 textproc/docbookrx/Makefile create mode 100644 textproc/docbookrx/distinfo create mode 100644 textproc/docbookrx/pkg-descr diff --git a/textproc/Makefile b/textproc/Makefile index 62365e3a6d50..593c8d2dee33 100644 --- a/textproc/Makefile +++ b/textproc/Makefile @@ -143,6 +143,7 @@ SUBDIR += docbook2X SUBDIR += docbook2mdoc SUBDIR += docbook2odf + SUBDIR += docbookrx SUBDIR += doclifter SUBDIR += docproj SUBDIR += dom4j diff --git a/textproc/docbookrx/Makefile b/textproc/docbookrx/Makefile new file mode 100644 index 000000000000..39733803fa9b --- /dev/null +++ b/textproc/docbookrx/Makefile @@ -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 + +.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 diff --git a/textproc/docbookrx/distinfo b/textproc/docbookrx/distinfo new file mode 100644 index 000000000000..d98eb74dd5f4 --- /dev/null +++ b/textproc/docbookrx/distinfo @@ -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 diff --git a/textproc/docbookrx/pkg-descr b/textproc/docbookrx/pkg-descr new file mode 100644 index 000000000000..92a9f666e7a3 --- /dev/null +++ b/textproc/docbookrx/pkg-descr @@ -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