8.123. Asciidoc-10.2.1

8.123.1. Introduction to Asciidoc

The Asciidoc package is a text document format for writing notes, documentation, articles, books, ebooks, slideshows, web pages, man pages and blogs. AsciiDoc files can be translated to many formats including HTML, PDF, EPUB, and man page.

Approximate build time: less than 0.1 SBU
Required disk space: 2.6 MB

8.123.2. Installation of Asciidoc

Create the PKGBUILD for the Asciidoc package with the following commands:

mkdir /sources/asciidoc
cd /sources/asciidoc
cat > PKGBUILD << "REALEOF"
# Maintainer: Linux From Scratch <lfs-dev@lists.linuxfromscratch.org>

pkgname="asciidoc"
pkgver="10.2.1"
pkgrel="1"
pkgdesc="Text document format for short documents, articles, books and UNIX man pages"
arch=('any')
url="https://github.com/asciidoc/"
license=('GPL3')
groups=('core')
depends=('docbook-xsl-nons'
         'libxslt'
         'python')
makedepends=('bash'
             'binutils'
             'coreutils'
             'gcc'
             'make')
optdepends=('fop'
            'libxslt'
            'lynx')
source=('https://files.pythonhosted.org/packages/source/a/asciidoc/asciidoc-10.2.1.tar.gz')
md5sums=('460824075b51381a4b5f478c60a18165')

build(){
  cd "${pkgname}-${pkgver}"
  pip3 wheel -w dist --no-build-isolation --no-deps --no-cache-dir $PWD
}

package(){
  cd "${pkgname}-${pkgver}"
  pip3 install --root "${pkgdir} --no-index --find-links dist --no-user asciidoc
}
REALEOF

Prepare the build directory for the pacman user and build the package:

chown -R root:pacman .
chmod 2775 .
chmod 664 PKGBUILD
su pacman -c 'makepkg -L --nodeps'

Add the newly created package to the central package repository:

cp asciidoc-10.2.1-1-$(uname -m).pkg.tar.xz \
   /srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
         /srv/pacman/repos/LFS/asciidoc-10.2.1-1-$(uname -m).pkg.tar.xz

Update the local cache and install the Asciidoc package:

pacman -Syu
pacman -S asciidoc --overwrite \* -dd --noconfirm

Finally, copy the source files into the source repository and clean up the build directory:

mkdir /srv/pacman/source/LFS/asciidoc
cp PKGBUILD /srv/pacman/source/LFS/asciidoc
cd /sources
rm -rf asciidoc

8.123.3. Contents

Installed Programs: a2x (symlink to a2x.py), a2x.py, asciidoc (symlink to asciidoc.py), and asciidoc.py
Installed Libraries: None
Installed Directories: /etc/asciidoc and /usr/share/doc/asciidoc-10.2.1

Short Descriptions

a2x

is a toolchain manager for AsciiDoc (converts Asciidoc text files to other file formats).

asciidoc

converts an AsciiDoc text file to HTML or DocBook