Skip to content

Commit

Permalink
Merge branch 'release/5.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Tek committed Jul 13, 2022
2 parents 20d21f5 + e00f413 commit 6375fd4
Show file tree
Hide file tree
Showing 6 changed files with 225 additions and 0 deletions.
Binary file added SlackBuild/docbook.tar.gz
Binary file not shown.
3 changes: 3 additions & 0 deletions SlackBuild/docbook/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docbook-5.0.0 is a group of shell scripts and
required files used for creating a removable
SlackBuild package for DocBook5 XML dtd and schemas
187 changes: 187 additions & 0 deletions SlackBuild/docbook/docbook.SlackBuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
#!/bin/bash

# docbook.SlackBuild - SlackBuild script for creating a pkg. of DocBook5 DTD and Schemas
# Copyright © 2022 Necib ÇAPAR <necipcapar@gmail.com>

# This file is part of docbook-5.0.0

# docbook is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# docbook is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=docbook # replace with name of program
VERSION=${VERSION:-5.0.0} # replace with version of program
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}

if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi

# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi

TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION

## If required download source files for docbook-5.0.0
if [ ! -f $CWD/$PRGNAM-$VERSION.tar.gz ]; then
source_website=${source_website:-'https://docbook.org/xml/5.0/docbook-5.0.zip'}
mkdir $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
LANG=us wget --execute robots=off --no-parent --no-host-directories --no-verbose \
--cut-dirs=2 --no-check-certificate $source_website

unzip "docbook-5.0.zip"
rm --verbose "$TMP/$PRGNAM-$VERSION/docbook-5.0.zip"
cd ..
else
tar --extract --verbose --file="$CWD/$PRGNAM-$VERSION.tar.gz"
fi

## If required create catalog file for xml
if [ ! -f $TMP/$PRGNAM-$VERSION/docbook-5.0/catalog_docbook-5.0.0.xml ]; then
echo '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD XML Catalogs V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
<group id="docbook-5.0" xml:base="file:///usr/share/xml/docbook/5.0/" prefer="public">
<!-- non-normative - DTD -->
<public publicId="-//OASIS//DTD DocBook XML 5//EN" uri="dtd/docbook.dtd"/>
<public publicId="-//OASIS//DTD DocBook XML 5.0//EN" uri="dtd/docbook.dtd"/>
<system systemId="http://www.oasis-open.org/docbook/xml/5.0/dtd/docbook.dtd" uri="dtd/docbook.dtd"/>
<system systemId="http://docbook.org/xml/5.0/dtd/docbook.dtd" uri="dtd/docbook.dtd"/>
<!-- normative - RELAX NG schema & non-normative - RELAX NG schema in compact syntax -->
<public publicId="-//OASIS//DTD DocBook v5.0//EN//XML" uri="rng/docbook.rng"/>
<rewriteURI uriStartString="http://www.oasis-open.org/docbook/xml/5.0/rng/" rewritePrefix="rng/" />
<rewriteURI uriStartString="http://docbook.org/xml/5.0/rng/" rewritePrefix="rng/" />
<rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/5.0/rng/" rewritePrefix="rng/" />
<rewriteSystem systemIdStartString="http://docbook.org/xml/5.0/rng/" rewritePrefix="rng/" />
<!-- non-normative - W3C XML Schema -->
<rewriteURI uriStartString="http://www.oasis-open.org/docbook/xml/5.0/xsd/" rewritePrefix="xsd/" />
<rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/5.0/xsd/" rewritePrefix="xsd/" />
<rewriteURI uriStartString="http://docbook.org/xml/5.0/xsd/" rewritePrefix="xsd/" />
<rewriteSystem systemIdStartString="http://docbook.org/xml/5.0/xsd/" rewritePrefix="xsd/" />
<!-- non-normative - Schematron schema with additional checks -->
<rewriteURI uriStartString="http://www.oasis-open.org/docbook/xml/5.0/sch/" rewritePrefix="sch/" />
<rewriteURI uriStartString="http://docbook.org/xml/5.0/sch/" rewritePrefix="sch/" />
<rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/5.0/sch/" rewritePrefix="sch/" />
<rewriteSystem systemIdStartString="http://docbook.org/xml/5.0/sch/" rewritePrefix="sch/" />
<!-- An XSLT (1.0) stylesheet for upgrading DocBook V4.x documents to DocBook V5.x -->
<rewriteURI uriStartString="http://docbook.org/xml/5.0/tools/db4-upgrade.xsl"
rewritePrefix="tools/db4-upgrade.xsl"/>
<rewriteSystem systemIdStartString="http://docbook.org/xml/5.0/tools/db4-upgrade.xsl"
rewritePrefix="tools/db4-upgrade.xsl"/>
<!-- NVDL - Namespace-based Validation Dispatch Language, used for validation of XML documents using multiple namespaces -->
<uri name="http://www.oasis-open.org/docbook/xml/5.0/docbook.nvdl" uri="docbook.nvdl"/>
<uri name="http://docbook.org/xml/5.0/docbook.nvdl" uri="docbook.nvdl"/>
</group>
</catalog>' > $TMP/$PRGNAM-$VERSION/docbook-5.0/catalog_docbook-5.0.0.xml
fi

cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

# create installation directory tree for the original files
mkdir --parents $PKG/usr/share/xml/docbook/5.0
cp --archive --recursive $TMP/$PRGNAM-$VERSION/docbook-5.0/* $PKG/usr/share/xml/docbook/5.0/

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
mv $PKG/usr/share/xml/docbook/5.0/{ChangeLog,README,VERSION,docs} $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
if [ -f $CWD/slack-desc ]; then
cat $CWD/slack-desc > $PKG/install/slack-desc
else
echo "# HOW TO EDIT THIS FILE:
# The \"handy ruler\" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
docbook: docbook-5.0.0 (DocBook XML V5.0)
docbook:
docbook: DocBook XML v5.0 dtd and schemas
docbook:
docbook:
docbook:
docbook:
docbook:
docbook:
docbook:
docbook: http://docbook.org/xml/5.0/docbook-5.0.zip" > $PKG/install/slack-desc
fi

if [ -f $CWD/doinst.sh ]; then
cat $CWD/doinst.sh > $PKG/install/doinst.sh
else
echo "cd /etc/xml/
cp --archive docbook docbook.docbook5.0.0_orig
sed_appended_text='\\
<!-- Added when \"docbook\" package is installed --> \\
<nextCatalog catalog=\"file:///usr/share/xml/docbook/5.0/catalog_docbook-5.0.0.xml\" />'
sed -i \"\\\$i \ \$sed_appended_text\" docbook" > $PKG/install/doinst.sh
chmod 0644 $PKG/install/doinst.sh
fi

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
10 changes: 10 additions & 0 deletions SlackBuild/docbook/docbook.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PRGNAM="docbook"
VERSION="5.0.0"
HOMEPAGE="https://github.com/N-Tek/docbook-5.0.0"
DOWNLOAD="http://docbook.org/xml/5.0/docbook-5.0.zip"
MD5SUM="2411c19ed4fb141f3fa3d389fae40736"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Necib ÇAPAR"
EMAIL="necipcapar@gmail.com"
6 changes: 6 additions & 0 deletions SlackBuild/docbook/doinst.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cd etc/xml/
cp --archive docbook docbook.docbook5.0.0_orig
sed_appended_text='\
<!-- Added when "docbook-5.0.0" package is installed --> \
<nextCatalog catalog="file:///usr/share/xml/docbook/5.0/catalog_docbook-5.0.0.xml" />'
sed -i "\$i \ $sed_appended_text" docbook
19 changes: 19 additions & 0 deletions SlackBuild/docbook/slack-desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.

|-----handy-ruler------------------------------------------------------|
docbook: docbook (DocBook XML V5.0)
docbook:
docbook: DocBook XML v5.0 dtd and schemas
docbook:
docbook:
docbook:
docbook:
docbook:
docbook:
docbook:
docbook: http://docbook.org/xml/5.0/docbook-5.0.zip

0 comments on commit 6375fd4

Please sign in to comment.