SUMMARY="Tools and scripts too small to warrant their own packages"
DESCRIPTION="A collection of tools and scripts that have accumulated over the \
years, and each of which seems to be too small to warrants its own project.
- aumeta(1) — move seek index and adjust metadata of audio files
- bsvplay(1) — convert BASICA music files to PCM
- cctypeinfo(1) – show sizes of C types on the implementation it was compiled with
- checkbrack(1) — check parenthesis and bracket count
- cwdiff(1) — run wdiff with color
- declone(1) — break hardlinks
- diff2php(1) — transform patch to self-serving PHP file
- doxygen-kerneldoc-filter(1) — filter for Doxygen to support kerneldoc
- extract_d3pkg(1) — extract Descent3 PKG files
- extract_dxhog(1) — extract Descent HOG files
- extract_f3pod(1) — extract Fury3 POD files
- extract_qupak(1) — extract Quake2 PACK files
- fd0ssh(1) — pipe for password-over-stdin support to ssh
- fduphl(1) – find duplicate files and hardlink them
- filenameconv(1) — convert file name encoding
- flv2avi(1) — repackage Flash video into an AVI container with PCM audio
- fnt2bdf(1) — convert VGA raw fonts to X11 BDF
- fxterm(1) — start xterm with sane settings
- git-author-stat(1) — show commit author statistics of a git repository
- git-blame-stat(1) – show per-line author statistics of a git repository
- git-export-patch(1) — produce perfect patch from git commits for mail submission
- git-forest(1) — display the commit history forest
- git-lemon(1) — don't just pick cherries, but take it all (cherry-	pick a commit range)
- git-new-root(1) — start a new root in the git history
- git-revert-stats(1) — show reverting statistics of a git repository
- git-track(1) — set up branch for tracking a remote
- gpsh(1) — grep in tracklists and play audio files
- graph-fanout(1) – fan a tree (for graphviz)
- graph-lchain(1) – remove circles in graphs using longest-chaining method
- gxxdm — explains libstdc++v3 mangled names in detail. (Not feature-complete.)
- logontime(8) — show cumulative logon time from wtmp
- mailsplit(1) — split an mbox into single files
- man2html(1) — convert nroff manpages to HTML
- mod2ogg(1) — wrapper for module to OggVorbis transcoding
- mpg2ogg(1) — wrapper for mass mp3 to OggVorbis transcoding
- netload(8) — show utilization of network interface
- newns(8) — clone current filesystem namespace and start a process
- ofl(1) — open file lister (replaces fuser and lsof -m)
- mkvappend — concatenate multiple files into one Matroska container file
- paddrspacesize(1) – print size of processes' address spaces
- pesubst(1) — perl-regexp stream substitution (replaces sed for sub‐	stitutions)
- pegrep(1) — multi-line perl-regexp grep
- pmap_dirty(1) — display amount of RAM a process uses hard
- png2wx.pl(1) — transform arbitrary files into C++ files for wxWidgets
- printcaps(1) — print currently active process capabilities
- proc_iomem_count(1) – show MMIO region sizes
- proc_stat_signal(1) – decode /proc/self/stat for signal status
- pshtreads(1) – alternative experiment to ps(1) involving thread display
- qpdecode — quoted-printable filter
- qplay(1) — convert QBASIC play strings to PCM
- qtar(1) – faster interface to tar with file ordering
- raregetty(8) — local login program for remote hosts
- recursive_lower(1) — recursively lowercase all filenames
- rpmdep.pl(1) – read RPM dependencies and output a graph
- sourcefuncsize(1) — statistical analysis of code
- spec-beautifier(1) — program to clean up RPM .spec files
- stxdb(1) — A/V file database
- su1(8) – what sudo should have done
- sysinfo(1) — print IRC-style system information banner
- tailhex(1) — hex dumper with tail-following support
- utmp_register(1) — make entries in the utmp/wtmp database
- vcsaview(8) — display a screen dump in VCSA format
- vfontas(1) — VGA font file assembler
- wavdiff(1) — proof-of-concept raw PCM deltifier
- wktimer(1) — work timer
"
HOMEPAGE="https://inai.de/projects/hxtools/"
COPYRIGHT="2018 Developer Name"
LICENSE="
	GNU GPL v2
	GNU GPL v3
	WTFPL v2.0
"
REVISION="1"
SOURCE_URI="http://jftp.inai.de/hxtools/hxtools-$portVersion.tar.xz"
CHECKSUM_SHA256="92cf002d1375acc3e995206a5096391d2ee2a714a9e59f01aab19c3cdcfa428a"
PATCHES="hxtools-$portVersion.patchset"

ARCHITECTURES="?all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
	commandSuffix=
	commandBinDir=$prefix/bin
fi

GLOBAL_WRITABLE_FILES="
	settings/hxloginpref.conf keep-old
"

PROVIDES="
	hxtools$secondaryArchSuffix = $portVersion
	cmd:aumeta$commandSuffix
	cmd:bin2c$commandSuffix
	cmd:checkbrack$commandSuffix
	cmd:clock_info$commandSuffix
	cmd:clt2bdf$commandSuffix
	cmd:cwdiff$commandSuffix
	cmd:declone$commandSuffix
	cmd:fxterm$commandSuffix
	cmd:git_author_stat$commandSuffix
	cmd:git_export_patch$commandSuffix
	cmd:git_forest$commandSuffix
	cmd:git_track$commandSuffix
	cmd:googtts$commandSuffix
	cmd:gpsh$commandSuffix
	cmd:gxxdm$commandSuffix
	cmd:man2html$commandSuffix
	cmd:mkvappend$commandSuffix
	cmd:move_moov$commandSuffix
	cmd:ofl$commandSuffix
	cmd:pesubst$commandSuffix
	cmd:pegrep$commandSuffix
	cmd:pmap_dirty$commandSuffix
	cmd:qpdecode$commandSuffix
	cmd:qtar$commandSuffix
	cmd:rot13$commandSuffix
	cmd:spec_beautifier$commandSuffix
	cmd:ssa2srt$commandSuffix
	cmd:su1$commandSuffix
	cmd:sysinfo$commandSuffix
	cmd:tailhex$commandSuffix
	cmd:wktimer$commandSuffix
"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libHX$secondaryArchSuffix
	lib:libpci$secondaryArchSuffix
	lib:libXcb$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libHX$secondaryArchSuffix
	devel:libpci$secondaryArchSuffix
	devel:libXcb$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:gcc$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	sh autogen.sh
	runConfigure --omit-dirs binDir ./configure --bindir="$commandBinDir"
	make $jobArgs
}

INSTALL()
{
	make install
}
