diff options
author | B. Watson <yalhcru@gmail.com> | 2020-11-20 14:36:33 +0000 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2020-11-22 01:14:19 +0700 |
commit | d54c49f734260c37136169b42076c0cb8055af56 (patch) | |
tree | 01a5662c276afa817ef0f83779445c3353241381 /system/xidel | |
parent | ea7b65a8fa9cb6a731f214bd328d43fd1f15b4dd (diff) |
system/xidel: Added (extract data from HTML/XML/JSON files or pages)
Signed-off-by: Dave Woodfall <dave@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/xidel')
-rw-r--r-- | system/xidel/README | 28 | ||||
-rw-r--r-- | system/xidel/slack-desc | 19 | ||||
-rw-r--r-- | system/xidel/xidel.SlackBuild | 62 | ||||
-rw-r--r-- | system/xidel/xidel.info | 10 |
4 files changed, 119 insertions, 0 deletions
diff --git a/system/xidel/README b/system/xidel/README new file mode 100644 index 0000000000000..34602c26d493f --- /dev/null +++ b/system/xidel/README @@ -0,0 +1,28 @@ +xidel (tool to extract data from HTML/XML/JSON files or pages) + +Xidel is a command line tool to query data from HTML/XML web pages, +JSON-APIs and local files. It implements interpreters for XPath 2, +XPath 3, XQuery 1, XQuery 3, JSONiq, CSS selectors and custom pattern +matching. + +XPath and CSS selectors are the most efficient way to select certain +elements from XML/HTML documents. JSONiq (with custom extensions) +is an easy way to select data from JSON. XQuery is a Turing-complete +superset of XPath and allows arbitrary data transformations and the +creation of new documents. + +Pattern matching is for XML/HTML documents what regular expressions +are for plaintext, i.e. pattern matching behaves like a regular +expression over the space of tags, instead over the space of +characters. + +Xidel implements a kind of internal pipes to pipe HTTP requests from +one query to the next, so there is no need to distinguish selecting +links and downloading the data referenced by them. Therefore arbitrary +complex queries going over arbitrary many pages can be executed with a +single call of Xidel. + +Xidel is a powerful and complex tool, with a steep learning +curve. For examples, see the man page xidel(1), and also +/usr/doc/xidel-$VERSION/examples/. The full documentation is available +via "xidel --usage | less". diff --git a/system/xidel/slack-desc b/system/xidel/slack-desc new file mode 100644 index 0000000000000..0b969a8317664 --- /dev/null +++ b/system/xidel/slack-desc @@ -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------------------------------------------------------| +xidel: xidel (tool to extract data from HTML/XML/JSON files or pages) +xidel: +xidel: Xidel is a command line tool to query data from HTML/XML web pages, +xidel: JSON-APIs and local files. It implements interpreters for XPath 2, +xidel: XPath 3, XQuery 1, XQuery 3, JSONiq, CSS selectors and custom pattern +xidel: matching. +xidel: +xidel: +xidel: +xidel: +xidel: diff --git a/system/xidel/xidel.SlackBuild b/system/xidel/xidel.SlackBuild new file mode 100644 index 0000000000000..a13c4c6979ffa --- /dev/null +++ b/system/xidel/xidel.SlackBuild @@ -0,0 +1,62 @@ +#!/bin/sh + +# Slackware build script for xidel + +# Written by B. Watson (yalhcru@gmail.com) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +PRGNAM=xidel +VERSION=${VERSION:-0.9.8} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +# No CFLAGS (Pascal, not C), no need for LIBDIRSUFFIX. Upstream +# uses fpc's -O3 option, for whatever that's worth. + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION-src +tar xvf $CWD/$PRGNAM-$VERSION.src.tar.gz +cd $PRGNAM-$VERSION-src +chown -R root:root . +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ + +# Fairly weird build process, but simple enough. -s means strip. Tests +# require internet access, so disabled by default. +[ "${TESTS:-no}" = "yes" ] && T="-t" + +cd programs/internet/$PRGNAM +./build.sh -s $T +mkdir -p $PKG/usr/bin +cp -a $PRGNAM $PKG/usr/bin + +mkdir -p $PKG/usr/man/man1 +gzip -9c < meta/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a README* COPYING changelog examples $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/system/xidel/xidel.info b/system/xidel/xidel.info new file mode 100644 index 0000000000000..b07650eb41200 --- /dev/null +++ b/system/xidel/xidel.info @@ -0,0 +1,10 @@ +PRGNAM="xidel" +VERSION="0.9.8" +HOMEPAGE="http://videlibri.sourceforge.net/xidel.html" +DOWNLOAD="https://github.com/benibela/xidel/releases/download/Xidel_0.9.8/xidel-0.9.8.src.tar.gz" +MD5SUM="bd82db9878784d2621b37baca914b777" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="fpc" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" |