code:
# Build recipe for programName.
#
# Copyright (c) Year(s) YourName, <email>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=
version=
release=1

# Define a category for the output of the package name
pkgcategory=

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=

description="
Brief description.

Long description (preferably in 75 or 80 columns).
"

homepage=
license=

# Source documentation
docs=""
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    rm -rf BUILD
    mkdir BUILD
    cd BUILD

    cmake -DCMAKE_BUILD_TYPE=Release \
     -DCMAKE_C_FLAGS="$QICFLAGS"                                           \
     -DCMAKE_CXX_FLAGS="$QICXXFLAGS"                                       \
     -DCMAKE_EXE_LINKER_FLAGS="$QILDFLAGS"                                 \
     -DCMAKE_SHARED_LINKER_FLAGS="$QILDFLAGS"                              \
     -DCMAKE_STATIC_LINKER_FLAGS="$QILDFLAGS"                              \
     -DCMAKE_INSTALL_PREFIX=/usr                                           \
     -DCMAKE_INSTALL_LIBDIR=lib${libSuffix}                                \
     -DCMAKE_INSTALL_INFODIR=$infodir                                      \
     -DCMAKE_INSTALL_MANDIR=$mandir                                        \
     -DCMAKE_INSTALL_DOCDIR=$docsdir                                       \
     -G Ninja ..

    ninja -j${jobs}
    DESTDIR="$destdir" ninja -j${jobs} install

    # Switch back to the main source directory
    cd ..

    # Compress info documents deleting index file for the package
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}


code:
# Build recipe for programName.
#
# Copyright (c) Year(s) YourName, <email>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=
version=
release=1

# Define a category for the output of the package name
pkgcategory=

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=

description="
Brief description.

Long description (preferably in 75 or 80 columns).
"

homepage=
license=

# Source documentation
docs=""
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    # Compress info documents deleting index file for the package
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

repo_name: dustdfg/dragora

license: mit


code:
# HOW TO READ THIS FILE:
#
# If 'a' depends on 'b' and 'c', and 'c' depends on 'b' as well,
# the file might look like:
#
#   a.recipe: c.recipe b.recipe
#   b.recipe:
#   c.recipe: b.recipe
#
# Each letter represents a recipe name, complete dependencies for
# the first recipe name are listed in descending order, which is
# printed from right to left, and removed from left to right:
#
#   b.recipe
#   c.recipe
#   a.recipe
#
# Commented lines starting with a '#' are allowed.  Blank lines,
# colons, parentheses, and end of line are removed.
#
# For more information, type: info qi 'order file'
#

# File system structure and system configuration files
data/hierarchyfs: data/etc

# Main C library
kernel/headers:
devel/fortify-headers:
libs/musl:

# Native Language Support (NLS)
libs/gettext:

# Libraries, linker and compiler related
devel/m4:
libs/mpc: libs/mpfr libs/gmp
libs/gmp:
libs/mpfr: libs/gmp
libs/isl: libs/gmp
devel/flex: devel/bison
libs/zlib:
devel/gc: libs/libatomic_ops
devel/gcc: devel/binutils
libs/musl-compat:
libs/libaio:
libs/libsigsegv:

# Extended attributes, access control lists support on filesystems
tools/acl: tools/attr

# Capabilities commands and library (1/2)
libs/libcap: tools/attr

tools/ed:
tools/sed:
devel/pkgconf:
libs/ncurses: tools/gpm
tools/shadow:
tools/util-linux-pass1:
tools/procps-ng:
tools/e2fsprogs:
tools/coreutils:
tools/diffutils: tools/ed
devel/check: tools/gawk
data/iana-etc: tools/gawk
tools/gawk: libs/readline
libs/readline: libs/ncurses
devel/libtool:
perl/perl5: compressors/bzip2 db/berkeley-db db/gdbm
devel/automake: devel/autoconf
devel/help2man:
gnupg/libgcrypt: gnupg/libgpg-error

# Compression commands and library (1/2)
compressors/bzip2:
compressors/gzip:
compressors/clzip:
compressors/plzip: libs/lzlib
compressors/xlunzip:
compressors/xz:
compressors/unzip:
compressors/zutils: compressors/bzip2 compressors/gzip compressors/clzip compressors/xz
tools/lziprecover:
libs/lzo:

# Cryptographic libraries
libs/nettle:
networking/libressl:
libs/libssh2: networking/libressl

libs/libarchive: libs/expat libs/nettle

devel/texinfo: perl/perl5
devel/gperf:
devel/bc:
tools/file:
tools/findutils: tools/mlocate
libs/pcre:
libs/pcre2:
tools/grep:
libs/popt:

# Some text editors
tools/moe:
tools/nano: dict/aspell
tools/vim-tiny:

# Manual page tool support
tools/man-db: libs/libpipeline db/gdbm tools/less tools/groff

# Extra command-line support for other programs
libs/libedit: libs/ncurses tools/groff

# Shells
shells/mksh:
shells/bash: libs/readline

tools/tar:
tools/tarlz: libs/lzlib
tools/patch: tools/ed

# Package manager(s)
tools/graft: perl/perl5
tools/qi: tools/tar tools/tarlz tools/graft perl/perl5

# FUSE support
libs/fuse2:

# More programming languages, libraries
devel/nasm:
devel/tcl: libs/zlib
lua/lua5: libs/readline
db/sqlite: devel/tcl libs/readline libs/zlib
python/python3: devel/valgrind libs/zlib libs/expat libs/libffi libs/readline networking/libressl
libs/libunistring:
libs/libidn:
libs/libidn2:
devel/guile: libs/libffi libs/libunistring
devel/gdb: libs/zlib libs/readline python/python3
devel/make: devel/guile
devel/clisp: libs/libffcall libs/libsigsegv

# Additional build systems (1/2)
devel/re2c:
devel/ninja:
devel/meson:

# Compression commands and library (2/2)
compressors/zstd: devel/meson

# Ruby programming language
ruby/ruby3: libs/libyaml

# Ruby gems
ruby/asciidoctor:
ruby/pygments:

# Language extras, modules
perl/xml-parser:
perl/uri:
perl/xml-sax: perl/xml-sax-base perl/xml-namespacesupport
perl/xml-sax-expat: perl/xml-sax
perl/xml-simple: perl/xml-sax-expat
perl/sgmlspm:
python/six: python/python3
python/mako: python/markupsafe
python/setuptools:
lua/luarocks: lua/lua5

# Build tools for internationalization (early)
tools/intltool: perl/xml-parser

# International Components for Unicode
libs/icu: python/python3

# XML, XSLT, DocBook, SGML support
libs/libxml2: compressors/xz python/python3 libs/readline libs/zlib gnupg/libgcrypt
libs/libxslt:
docbook/sgml-common:
docbook/docbook-xml: ruby/ruby3
docbook/docbook-xsl: docbook/docbook-xml
docbook/itstool:
docbook/xmlto:
docbook/opensp: docbook/xmlto docbook/sgml-common
docbook/openjade: docbook/opensp docbook/sgml-common

libs/libpsl: libs/libidn2 libs/icu libs/libxslt

# Capabilities commands and library (2/2)
libs/libcap-ng: python/python3

# Additional debuggers or related tools
devel/strace: perl/perl5

# Complete 'util-linux' since partial 'util-linux-pass1' ^
tools/util-linux: libs/readline python/python3

# Glib (1/2)
libs/glib2-pass1: python/python3

# Libevent (this may be used by some networking related tools)
libs/libevent: networking/libressl

# D-Bus support
libs/dbus-glib: daemons/dbus libs/expat
python/dbus-python:

# ELF/libelf support
devel/elfutils: libs/musl-fts libs/musl-obstack libs/libuargp

# Kernel-related
kernel/kmod: libs/zlib
kernel/generic: kernel/kmod kernel/headers
kernel/buildtree-generic:
kernel/firmware:
boot/eudev: kernel/kmod devel/gperf

# Time zone database
db/tzdb:

# Various ISO standards, database
data/iso-codes:

# PCI/USB user-space support
tools/pciutils: kernel/kmod libs/hwdata
tools/usbutils: libs/libusb libs/hwdata
libs/libusb-compat: libs/libusb

tools/psmisc: libs/ncurses
tools/dialog: tools/groff
tools/kbd:
tools/mc: libs/glib2-pass1
tools/which:
tools/lm-sensors:
tools/hdparm:
tools/isapnptools:
daemons/acpid:

# Extra filesystems and disk management
tools/lvm2: tools/mdadm

# Note: vim-tiny provides xxd(1), which is searched by dosfstools;
# finally, dosfstools is compiled as static to be able to remove
# vim (if someone does not need it).
tools/dosfstools: boot/eudev tools/vim-tiny

tools/xfsprogs: libs/liburcu libs/inih libs/icu libs/readline tools/util-linux
tools/reiser4progs: libs/libaal
tools/btrfs-progs: compressors/zstd libs/lzo
tools/squashfs-tools: tools/attr compressors/plzip

# Extra disk, partitioning-related utilities (1/2)
tools/gptfdisk: libs/icu tools/util-linux
tools/parted: tools/lvm2 tools/util-linux
tools/ddrescue:

# System initialization and related
boot/sysvinit: boot/bootscripts
boot/perp:
daemons/scron:
tools/logrotate: libs/popt
daemons/sysklogd:
boot/efivar:
boot/grub: compressors/xz compressors/zstd boot/os-prober tools/mdadm tools/lvm2 tools/dosfstools libs/fuse2

# RPC support
libs/libtirpc:
devel/rpcsvc-proto:
libs/libnsl:

# Networking support
networking/ethtool: networking/libmnl
networking/ca-certificates:
networking/libpcap: networking/libnl3
networking/iw: networking/libnl3
networking/iwd: libs/readline

# SSL implementations
networking/libressl:

# This will be meet with requirements for GNUTLS and other software
libs/libtasn1:
networking/p11-kit: libs/libffi libs/libtasn1
networking/gnutls: devel/guile libs/nettle libs/libunistring networking/p11-kit libs/libtasn1
networking/nspr: networking/p11-kit db/sqlite
networking/nss: networking/nspr

# GnuPG support
gnupg/libgpg-error:
gnupg/libgcrypt:
gnupg/libassuan:
gnupg/libksba:

libs/npth:
gnupg/pinentry: gnupg/libgpg-error gnupg/libassuan
gnupg/gnupg2:
gnupg/gpgme:

# Cryptography related
tools/cryptsetup: libs/libssh2 libs/json-c tools/lvm2 libs/popt

# Networking utilities, libraries and daemons
networking/curl: libs/libssh2
networking/tcpdump:

networking/tcp_wrappers: libs/libnsl
networking/inetutils: networking/tcp_wrappers libs/ncurses
networking/ncftp:
networking/net-tools:

networking/openssh:

networking/libnftnl: networking/libmnl
networking/iptables: networking/libnftnl networking/libmnl
networking/nftables: networking/libnftnl networking/libmnl
networking/iproute2:

networking/dhcpcd:

networking/irssi: libs/glib2-pass1
libs/libmetalink: libs/expat
networking/wget: libs/libpsl libs/libmetalink
networking/wget2: libs/libpsl libs/libidn2 networking/nghttp2 compressors/xz compressors/bzip2 compressors/zstd libs/lzlib libs/zlib
networking/rsync: compressors/zstd libs/zlib

networking/wireless_tools:
networking/wpa_supplicant: daemons/dbus
networking/connman: daemons/dbus libs/glib2-pass1
networking/alpine: dict/aspell networking/ca-certificates
networking/lynx:

# Disk quota support
tools/quota: networking/libnl3

# Additional build systems (2/2)
devel/cmake: libs/libuv

# Libraries or programs that depends on cmake
libs/json-c: devel/cmake

# Glib (2/2).
#
# Replace 'glib2-pass1' in order to get the dbus, cmake support
libs/glib2:

# PPP support
networking/lpppd: networking/libpcap devel/cmake
networking/rp-pppoe: networking/lpppd

networking/hldig:
networking/weechat:

# Extra disk, partitioning-related utilities (2/2)
tools/ntfs-3g: networking/gnutls libs/fuse2 tools/util-linux

# Sudo implementation
tools/sudo:

# CD/DVD writing utilities, libraries
libs/libburn:
libs/libisofs:
libs/libisoburn: libs/libisofs libs/libburn

# Extra software
tools/htop: tools/lm-sensors networking/libnl3 python/python3
tools/tree:
tools/tmux: libs/libevent

tools/pmount:
tools/udevil: libs/glib2 boot/eudev tools/intltool
tools/pm-utils:

tools/dragora-installer:


code:
# HOW TO READ THIS FILE:
#
# If 'a' depends on 'b' and 'c', and 'c' depends on 'b' as well,
# the file might look like:
#
#   a.recipe: c.recipe b.recipe
#   b.recipe:
#   c.recipe: b.recipe
#
# Each letter represents a recipe name, complete dependencies for
# the first recipe name are listed in descending order, which is
# printed from right to left, and removed from left to right:
#
#   b.recipe
#   c.recipe
#   a.recipe
#
# Commented lines starting with a '#' are allowed.  Blank lines,
# colons, parentheses, and end of line are removed.
#
# For more information, type: info qi 'order file'
#

# Sound infrastructure including JACK support

libs/fftw:
data/alsa-topology-conf:
data/alsa-ucm-conf:
libs/alsa-lib:
tools/alsa-utils:
tools/jack1: libs/portaudio
libs/alsa-plugins:
libs/libao:

# Ogg bitstream and FLAC support
libs/libogg:
libs/libvorbis: libs/libogg
tools/vorbis-tools: tools/flac libs/libao

# Extra support
libs/audiofile: tools/flac
libs/libmad:

# Accessibility

tools/espeakup: tools/espeak libs/portaudio
tools/espeak: libs/portaudio


code:
# HOW TO READ THIS FILE:
#
# If 'a' depends on 'b' and 'c', and 'c' depends on 'b' as well,
# the file might look like:
#
#   a.recipe: c.recipe b.recipe
#   b.recipe:
#   c.recipe: b.recipe
#
# Each letter represents a recipe name, complete dependencies for
# the first recipe name are listed in descending order, which is
# printed from right to left, and removed from left to right:
#
#   b.recipe
#   c.recipe
#   a.recipe
#
# Commented lines starting with a '#' are allowed.  Blank lines,
# colons, parentheses, and end of line are removed.
#
# For more information, type: info qi 'order file'
#

# Spell checker and requirements

dict/aspell: libs/ncurses
tools/which:

# Dictionaries

dict/aspell6-en:


code:
# HOW TO READ THIS FILE:
#
# If 'a' depends on 'b' and 'c', and 'c' depends on 'b' as well,
# the file might look like:
#
#   a.recipe: c.recipe b.recipe
#   b.recipe:
#   c.recipe: b.recipe
#
# Each letter represents a recipe name, complete dependencies for
# the first recipe name are listed in descending order, which is
# printed from right to left, and removed from left to right:
#
#   b.recipe
#   c.recipe
#   a.recipe
#
# Commented lines starting with a '#' are allowed.  Blank lines,
# colons, parentheses, and end of line are removed.
#
# For more information, type: info qi 'order file'
#

# DESCRIPTION OF CATEGORIES:
#
# "xorg/app"      Applications module, with standard X apps
# "xorg/lib"      Libraries required to write X apps
# "xorg/proto"    Protocol headers required to build the system
# "xorg/xserver"  Core of the X window System
# "xorg/driver"   Input / Output drivers written to work with X
# "xorg/font"     Fonts for the X window system, non free fonts were removed
# "xorg/doc"      Documentation
# "xorg/util"     Build tools and configuration files for legacy
# "xorg/extra"    External xorg dependencies that need to be fullfilled

libs/libpng:
x-libs/freetype-pass1:
libs/expat:
x-libs/fontconfig-pass1:
libs/tslib:

xorg/util/macros:
xorg/font/font-util:
xorg/doc/xorg-sgml-doctools:
xorg/doc/xorg-docs:
xorg/proto/xorgproto:
xorg/util/gccmakedep:
xorg/util/lndir: tools/intltool
xorg/util/imake:
xorg/util/xorg-cf-files: xorg/util/imake
xorg/util/makedepend:
xorg/xcb/xcb-proto:
xorg/lib/xtrans:
xorg/lib/libXau:
xorg/lib/libXdmcp:
xorg/xcb/libpthread-stubs:
xorg/xcb/libxcb:
xorg/xcb/xcb-util:
xorg/xcb/xcb-util-image:
xorg/xcb/xcb-util-keysyms:
xorg/xcb/xcb-util-renderutil:
xorg/xcb/xcb-util-wm:
xorg/lib/libX11:
xorg/lib/libXext:
xorg/lib/libdmx:
xorg/lib/libfontenc:
xorg/lib/libFS:
xorg/lib/libICE:
xorg/lib/libSM:
xorg/lib/libXt:
xorg/lib/libXmu:
xorg/lib/libXpm:
xorg/lib/libXaw:
xorg/lib/libXaw3d:
xorg/lib/libXfixes:
xorg/lib/libXcomposite:
xorg/lib/libXrender:
xorg/lib/libXdamage:
xorg/lib/libXcursor:
xorg/lib/libXfont:
xorg/lib/libXfont2:
xorg/lib/libXft:
xorg/lib/libXi:
xorg/lib/libXinerama:
xorg/lib/libxkbfile:
xorg/lib/libXrandr:
xorg/lib/libXres:
xorg/lib/libXScrnSaver:
xorg/lib/libxshmfence:
xorg/lib/libXtst:
xorg/lib/libXv:
xorg/lib/libXvMC:
xorg/lib/libXxf86dga:
xorg/lib/libXxf86vm:
xorg/lib/libpciaccess:
xorg/lib/pixman:
xorg/extra/libdrm:
xorg/extra/libva-pass1:
xorg/extra/libvdpau:
xorg/mesa: devel/llvm tools/lm-sensors
xorg/mesa-gallium-xa:
xorg/extra/libva:
xorg/extra/intel-vaapi-driver:
xorg/extra/glu: xorg/mesa
xorg/extra/freeglut: xorg/mesa xorg/extra/glu
xorg/data/xbitmaps:
xorg/app/appres:
xorg/app/bdftopcf:
xorg/app/bitmap:
xorg/app/editres:
xorg/app/fslsfonts:
xorg/app/fstobdf:
xorg/app/iceauth:
xorg/app/listres:
xorg/app/luit:
xorg/app/mkcomposecache:
xorg/app/mkfontdir:
xorg/app/mkfontscale:
xorg/app/oclock:
xorg/app/rgb:
xorg/app/rendercheck:
xorg/app/sessreg:
xorg/app/setxkbmap:
xorg/app/showfont:
xorg/app/smproxy:
xorg/app/twm:
xorg/app/viewres:
xorg/app/x11perf:
xorg/app/xauth:
xorg/app/xbacklight:
xorg/app/xbiff:
xorg/app/xcalc:
xorg/app/xclipboard:
xorg/app/xclock:
xorg/app/xcmsdb:
xorg/app/xconsole:
xorg/app/xcursorgen:
xorg/app/xdbedizzy:
xorg/app/xditview:
xorg/app/xdm:
xorg/app/xdpyinfo:
xorg/app/xdriinfo:
xorg/app/xedit:
xorg/app/xev:
xorg/app/xeyes:
xorg/app/xfd:
xorg/app/xfontsel:
xorg/app/xfs:
xorg/app/xfsinfo:
xorg/app/xgamma:
xorg/app/xhost:
xorg/app/xinit:
xorg/app/xinput:
xorg/app/xkbcomp:
xorg/app/xkbprint:
xorg/app/xkill:
xorg/app/xload:
xorg/app/xlsatoms:
xorg/app/xlsclients:
xorg/app/xlsfonts:
xorg/app/xmag:
xorg/app/xman:
xorg/app/xmessage:
xorg/app/xmodmap:
xorg/app/xmore:
xorg/app/xpr:
xorg/app/xprop:
xorg/app/xrandr:
xorg/app/xrdb:
xorg/app/xrefresh:
xorg/app/xscope:
xorg/app/xset:
xorg/app/xsetmode:
xorg/app/xsetroot:
xorg/app/xsm:
xorg/app/xstdcmap:
xorg/app/xvidtune:
xorg/app/xvinfo:
xorg/app/xwd:
xorg/app/xwininfo:
xorg/app/xwud:
xorg/xserver: libs/tslib libs/libepoxy xorg/lib/libxcvt
xorg/extra/libevdev:
libs/mtdev:
xorg/driver/xf86-input-evdev:
xorg/driver/xf86-input-joystick:
xorg/driver/xf86-input-vmmouse:
xorg/driver/xf86-input-keyboard:
xorg/driver/xf86-input-mouse:
xorg/driver/xf86-input-synaptics:
xorg/driver/xf86-input-void:
xorg/driver/xf86-input-elographics:
xorg/driver/xf86-video-amdgpu:
xorg/driver/xf86-video-sisusb:
xorg/driver/xf86-video-v4l:
xorg/driver/xf86-video-vboxvideo:
#xorg/driver/xf86-video-geode:
xorg/driver/xf86-video-i740:
xorg/driver/xf86-video-intel:
xorg/driver/xf86-video-apm:
xorg/driver/xf86-video-ark:
xorg/driver/xf86-video-ast:
xorg/driver/xf86-video-ati:
xorg/driver/xf86-video-chips:
xorg/driver/xf86-video-cirrus:
xorg/driver/xf86-video-dummy:
xorg/driver/xf86-video-fbdev:
xorg/driver/xf86-video-glint:
xorg/driver/xf86-video-i128:
xorg/driver/xf86-video-mach64:
xorg/driver/xf86-video-mga:
xorg/driver/xf86-video-neomagic:
xorg/driver/xf86-video-nouveau:
xorg/driver/xf86-video-nv:
xorg/driver/xf86-video-rendition:
xorg/driver/xf86-video-r128:
xorg/driver/xf86-video-s3:
xorg/driver/xf86-video-s3virge:
xorg/driver/xf86-video-savage:
xorg/driver/xf86-video-siliconmotion:
xorg/driver/xf86-video-sis:
xorg/driver/xf86-video-tdfx:
xorg/driver/xf86-video-tga:
xorg/driver/xf86-video-trident:
xorg/driver/xf86-video-tseng:
xorg/driver/xf86-video-vesa:
xorg/driver/xf86-video-vmware:
xorg/driver/xf86-video-voodoo:
xorg/extra/intel-vaapi-driver: xorg/extra/libva
xorg/data/xcursor-themes:
xorg/font/encodings:
xorg/font/font-adobe-100dpi:
xorg/font/font-adobe-75dpi:
xorg/font/font-adobe-utopia-100dpi:
xorg/font/font-adobe-utopia-75dpi:
xorg/font/font-adobe-utopia-type1:
xorg/font/font-arabic-misc:
xorg/font/font-bh-100dpi:
xorg/font/font-bh-75dpi:
xorg/font/font-bh-ttf:
xorg/font/font-bh-type1:
xorg/font/font-bitstream-100dpi:
xorg/font/font-bitstream-75dpi:
xorg/font/font-bitstream-type1:
xorg/font/font-cronyx-cyrillic:
xorg/font/font-cursor-misc:
xorg/font/font-daewoo-misc:
xorg/font/font-dec-misc:
xorg/font/font-ibm-type1:
xorg/font/font-isas-misc:
xorg/font/font-jis-misc:
xorg/font/font-micro-misc:
xorg/font/font-misc-cyrillic:
xorg/font/font-misc-ethiopic:
xorg/font/font-misc-meltho:
xorg/font/font-misc-misc:
xorg/font/font-mutt-misc:
xorg/font/font-schumacher-misc:
xorg/font/font-screen-cyrillic:
xorg/font/font-sony-misc:
xorg/font/font-sun-misc:
xorg/font/font-winitzki-cyrillic:
xorg/font/font-xfree86-type1:
xorg/font/font-alias:
xorg/data/xkeyboard-config:
xorg/extra/libxkbcommon:
xorg/extra/xdg-user-dirs:
xorg/extra/xdg-utils:
daemons/dbus-x11:


code:
# HOW TO READ THIS FILE:
#
# If 'a' depends on 'b' and 'c', and 'c' depends on 'b' as well,
# the file might look like:
#
#   a.recipe: c.recipe b.recipe
#   b.recipe:
#   c.recipe: b.recipe
#
# Each letter represents a recipe name, complete dependencies for
# the first recipe name are listed in descending order, which is
# printed from right to left, and removed from left to right:
#
#   b.recipe
#   c.recipe
#   a.recipe
#
# Commented lines starting with a '#' are allowed.  Blank lines,
# colons, parentheses, and end of line are removed.
#
# For more information, type: info qi 'order file'
#

# Thai language support
libs/libthai: libs/libdatrie

# Prerequisites (for GTK+ and friends)
x-libs/icon-naming-utils: perl/xml-simple
x-libs/hicolor-icon-theme:
x-libs/gobject-introspection:
x-libs/libgudev:
x-libs/harfbuzz:
x-libs/freetype:
x-libs/fontconfig:

# The TCL ToolKit (for other software)
devel/tk:

# ATK support (it requires dbus)
x-libs/atk:
x-libs/at-spi2-core:
x-libs/at-spi2-atk:

# Cairo support (1/2)
x-libs/cairo-pass1:
x-libs/pango: x-libs/fribidi

# MIME user-space support
x-libs/shared-mime-info: libs/libxml2

# Notification libraries
x-libs/startup-notification: xorg/xcb/xcb-util

# Vala language
devel/vala:

# ICalendar protocols and data units
x-libs/libical: x-libs/gobject-introspection db/berkeley-db devel/vala libs/icu

# Image handling libraries
libs/libjpeg-turbo: devel/nasm
x-libs/jasper: libs/libjpeg-turbo
libs/tiff: compressors/xz compressors/zstd libs/libjpeg-turbo
x-libs/lcms2: libs/tiff
x-libs/libmng: x-libs/lcms2 libs/libjpeg-turbo

# GDK Pixbuf support
x-libs/gdk-pixbuf: libs/libpng libs/tiff x-libs/jasper libs/libjpeg-turbo x-libs/shared-mime-info libs/libxml2 x-libs/gobject-introspection

# CSS2 support
x-libs/libcroco: libs/libxml2

# SVG support
libs/librsvg: x-libs/libcroco

# Poppler support
x-libs/poppler: x-libs/openjpeg
x-libs/poppler-data: x-libs/poppler

# Cairo support (2/2)
x-libs/cairo:

# GTK+ support
x-libs/desktop-file-utils:
x-libs/gtk2:
x-libs/gtk3:
x-libs/libglade:
x-libs/gnome-icon-theme:
x-libs/gnome-icon-theme-symbolic:
x-libs/gnome-themes-extra:

# LibInput support
xorg/extra/libwacom:
xorg/driver/xf86-input-wacom:
xorg/extra/libinput:
xorg/driver/xf86-input-libinput:

# Other libraries
x-libs/giflib:
x-libs/imlib2: libs/libid3tag x-libs/giflib
x-libs/libxklavier: data/iso-codes

# OpenEXR support
x-libs/openexr: x-libs/imath


code:
# HOW TO READ THIS FILE:
#
# If 'a' depends on 'b' and 'c', and 'c' depends on 'b' as well,
# the file might look like:
#
#   a.recipe: c.recipe b.recipe
#   b.recipe:
#   c.recipe: b.recipe
#
# Each letter represents a recipe name, complete dependencies for
# the first recipe name are listed in descending order, which is
# printed from right to left, and removed from left to right:
#
#   b.recipe
#   c.recipe
#   a.recipe
#
# Commented lines starting with a '#' are allowed.  Blank lines,
# colons, parentheses, and end of line are removed.
#
# For more information, type: info qi 'order file'
#

x-apps/xterm: libs/pcre x-libs/freetype libs/libpng xorg/app/luit
x-apps/dwm: x-apps/dmenu
x-apps/st:
x-apps/vim-huge:
x-apps/scrot:
x-apps/feh: x-libs/imlib2
x-apps/claws-mail: gnupg/gpgme libs/libetpan
x-apps/connman-gtk: networking/connman
x-apps/spacefm:
x-apps/emacs:


code:
# HOW TO READ THIS FILE:
#
# If 'a' depends on 'b' and 'c', and 'c' depends on 'b' as well,
# the file might look like:
#
#   a.recipe: c.recipe b.recipe
#   b.recipe:
#   c.recipe: b.recipe
#
# Each letter represents a recipe name, complete dependencies for
# the first recipe name are listed in descending order, which is
# printed from right to left, and removed from left to right:
#
#   b.recipe
#   c.recipe
#   a.recipe
#
# Commented lines starting with a '#' are allowed.  Blank lines,
# colons, parentheses, and end of line are removed.
#
# For more information, type: info qi 'order file'
#

# Software Configuration Management (SCMs)

devel/git: networking/curl libs/libssh2 devel/tk


code:
# HOW TO READ THIS FILE:
#
# If 'a' depends on 'b' and 'c', and 'c' depends on 'b' as well,
# the file might look like:
#
#   a.recipe: c.recipe b.recipe
#   b.recipe:
#   c.recipe: b.recipe
#
# Each letter represents a recipe name, complete dependencies for
# the first recipe name are listed in descending order, which is
# printed from right to left, and removed from left to right:
#
#   b.recipe
#   c.recipe
#   a.recipe
#
# Commented lines starting with a '#' are allowed.  Blank lines,
# colons, parentheses, and end of line are removed.
#
# For more information, type: info qi 'order file'
#

# Trinity Desktop Environment

tde/cmake-trinity:
tde/tqt3:
tde/tqtinterface:
tde/dbus-tqt:
tde/dbus-1-tqt:
tde/tqca:
tde/libart-lgpl:
#tde/avahi-tqt:
tde/libr:
tde/tdelibs:
tde/tdebase:
tde/tde-i18n:
tde/tdeaccessibility:
tde/tdeutils:
tde/kgtk-qt3:


code:
# HOW TO READ THIS FILE:
#
# If 'a' depends on 'b' and 'c', and 'c' depends on 'b' as well,
# the file might look like:
#
#   a.recipe: c.recipe b.recipe
#   b.recipe:
#   c.recipe: b.recipe
#
# Each letter represents a recipe name, complete dependencies for
# the first recipe name are listed in descending order, which is
# printed from right to left, and removed from left to right:
#
#   b.recipe
#   c.recipe
#   a.recipe
#
# Commented lines starting with a '#' are allowed.  Blank lines,
# colons, parentheses, and end of line are removed.
#
# For more information, type: info qi 'order file'
#

# The rest of the parts to compose the complete system,
# but no less important, so this at the end.  ;-)

# Essential shared libraries from different packages

libs/barelibs:

# The manual pages

manuals/man-pages:
manuals/man-pages-posix:


code: ln -sf rc.shutdown etc/rc.d/rc.reboot

path: recipes/boot/bootscripts/post-install


code:
# Build recipe for bootscripts.
#
# Copyright (c) 2017-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=bootscripts
version=dragora
pkgversion=20220606
arch=noarch
release=1

# Define a category for the output of the package name
pkgcategory=boot

description="
Essential sccripts to start or to stop the system.

It contains the needed scripts for the boot process.
"

homepage=https://www.dragora.org
license="Apache License version 2"

build()
{
    mkdir -p "${destdir}/etc/rc.d" "${destdir}/usr/bin"

    cp -p "${worktree}/archive/etc/inittab" "${destdir}/etc/"
    cp -p "${worktree}/archive/etc/rc.conf" "${destdir}/etc/"
    cp -p "${worktree}/archive/etc/rc.d"/*  "${destdir}/etc/rc.d/"

    touch "${destdir}/etc/.graft-config" \
          "${destdir}/etc/rc.d/.graft-config"

    chmod 644 "${destdir}/etc/inittab" "${destdir}/etc/rc.conf"
    chmod 754 "${destdir}"/etc/rc.d/*
}

path: recipes/boot/bootscripts/recipe


code:
# Recipe file for efivar.
#
# Copyright (c) 2022 DustDFG, <dfgdust@gmail.com>.
# Copyright (c) 2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=efivar
version=20220418_6be2cb1
release=4

# Define a category for the output of the package name
pkgcategory=boot

description="
Tools and libraries to work with EFI variables.

The efivar package provides a simple command-line interface to
the UEFI variable facility.
"

homepage=https://github.com/rhboot/efivar/
license=LGPLv2.1+

tarname=${program}-${version}.tar.lz

# Remote source(s)
#fetch=https://github.com/rhboot/efivar/releases/download/${version}/$tarname
fetch="
 https://dragora.mirror.garr.it/current/sources/$tarname
 rsync://rsync.dragora.org/current/sources/$tarname
"

# Source documentation
docs="COPYING TODO README.md"
docsdir="${docdir}/${program}-${version}"

build() {
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    # Apply patches

#    patch -Np1 -i "${worktree}/patches/efivar/efivar-efisecdb-atexit.patch"
    patch -Np1 -i "${worktree}/patches/efivar/efivar-mandoc-groff.patch"

    make -j${jobs} V=1 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" LIBDIR="/usr/lib${libSuffix}" MANDIR="$mandir"
    make -j${jobs} DESTDIR="$destdir" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" LIBDIR="/usr/lib${libSuffix}" MANDIR="$mandir" install

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/boot/efivar/recipe


code:
# Generate or update the hardware database
chroot "$rootdir" /bin/udevadm hwdb --update 2> /dev/null

path: recipes/boot/eudev/post-install


code:
# Build recipe for eudev.
#
# Copyright (c) 2016-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=eudev
version=3.2.11
release=3

# Define a category for the output of the package name
pkgcategory=boot

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch="
  https://github.com/eudev-project/eudev/releases/download/v${version}/$tarname
  https://dev.gentoo.org/~blueness/eudev/$tarname
"

description="
Dynamic device management.

Udev is the device manager for the Linux 2.6 kernel series.
Its primary function is managing device nodes in /dev.

It is the successor of devfs and hotplug, which means that
it handles the /dev directory and all user space actions
when adding/removing devices, including firmware load.

This is a fork of Udev from Gentoo.
"

homepage=https://wiki.gentoo.org/wiki/Eudev
license=GPLv2+

# Source documentation
docs=COPYING
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" \
    CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --with-rootlibexecdir=/lib/udev \
     --mandir=$mandir \
     --docdir=$docsdir \
     --enable-static=no \
     --enable-shared=yes \
     --enable-hwdb \
     --enable-manpages \
     --enable-rule-generator \
     --disable-selinux \
     --build="$(gcc -dumpmachine)"

    # http://github.com/gentoo/eudev/pull/127
    make -j${jobs} V=1 udevhwdbdir=/usr/lib${libSuffix}/udev/hwdb.d
    make -j${jobs} udevhwdbdir=/usr/lib${libSuffix}/udev/hwdb.d \
                   DESTDIR="$destdir" install-strip

    # Insert custom rules

    mkdir -p "${destdir}/etc/udev/rules.d"
    for file in "${worktree}"/archive/eudev/etc/udev/rules.d/*
    do
        install -p -m 644 -o root -g root "$file" "${destdir}/etc/udev/rules.d"
    done

    for file in "${worktree}"/archive/eudev/lib/udev/*
    do
        install -p -m 755 -o root -g root "$file" "${destdir}/usr/lib${libSuffix}/udev"
    done
    unset -v file

    # Install UDEVD perp service

    mkdir -p "${destdir}/etc/perp/udevd"

    cp -p "${worktree}/archive/eudev/etc/perp/rc.log" \
          "${worktree}/archive/eudev/etc/perp/rc.main" \
          "${destdir}/etc/perp/udevd/"

    chmod 755 "${destdir}"/etc/perp/udevd/rc.*

    # Be an active service by default
    chmod +t "${destdir}/etc/perp/udevd"

    # To handle config file(s)
    touch "${destdir}/etc/udev/.graft-config" \
          "${destdir}/etc/perp/udevd/.graft-config"

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/boot/eudev/recipe


code:
# Build recipe for grub.
#
# Copyright (c) 2017-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=grub
version=2.06
release=4

# Define a category for the output of the package name
pkgcategory=boot

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=https://ftp.gnu.org/gnu/grub/$tarname

description="
A multiboot boot loader.

GNU GRUB is a Multiboot boot loader.  It was derived from GRUB,
the GRand Unified Bootloader, which was originally designed and
implemented by Erich Stefan Boleyn.
"

homepage=https://www.gnu.org/software/grub
license=GPLv3+

# Source documentation
docs="AUTHORS BUGS COPYING NEWS README THANKS TODO"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Add support to detect "/boot/initrd.gz" or "/boot/initrd.lz" images
    patch -Np1 -i "${worktree}/patches/grub/initrd_naming.diff"

    # Force enabling os-prober to detect other operating systems
    patch -Np1 -i "${worktree}/patches/grub/grub-mkconfig-enable-os-prober.diff"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --infodir=$infodir \
     --mandir=$mandir \
     --docdir=$docsdir \
     --enable-device-mapper \
     --enable-grub-mount \
     --enable-liblzma \
     --disable-grub-mkfont \
     --disable-werror \
     --disable-efiemu \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" \
     bashcompletiondir=/usr/share/bash-completion/completions \
     install-strip

    # Remove generated charset.alias
    rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"

    # Make required directories
    mkdir -p "${destdir}/boot/grub/" "${destdir}/etc/default"

    # Insert file for default settings
    cp -p "${worktree}/archive/grub/etc/default/grub" "${destdir}/etc/default/"
    chmod 644 "${destdir}/etc/default/grub"

    # Manage config (.new) file(s)
    touch "${destdir}/etc/default/.graft-config" \
          "${destdir}/etc/grub.d/.graft-config" \
          "${destdir}/usr/share/bash-completion/completions/.graft-config"

    # Compress info documents deleting index file for the package
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/boot/grub/recipe


code:
# Build recipe for os-prober.
#
# Copyright (c) 2019, 2021 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=os-prober
version=1.79
release=1

# Define a category for the output of the package name
pkgcategory=boot

tarname=${program}_${version}.tar.xz

# Remote source(s)
fetch=https://deb.debian.org/debian/pool/main/o/os-prober/$tarname

description="
Utility to detect other OSes on a set of drives.

This package detects other OSes available on a system and outputs
the results in a generic machine-readable format.
"

homepage=https://joeyh.name/code/os-prober/
license=GPLv2+

# Source documentation
docs="README TODO debian/changelog debian/copyright"
docsdir="${docdir}/${program}-${version}"

# The source directory has a custom name
srcdir=${program}

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Import patches from Fedora to make os-prober more reliable
    patch -Np1 -i "${worktree}/patches/os-prober/os-prober-no-dummy-mach-kernel.patch"
    # Sent upstream
    patch -Np1 -i "${worktree}/patches/os-prober/os-prober-mdraidfix.patch"
    patch -Np1 -i "${worktree}/patches/os-prober/os-prober-btrfsfix.patch"
    patch -Np1 -i "${worktree}/patches/os-prober/os-prober-bootpart-name-fix.patch"
    patch -Np1 -i "${worktree}/patches/os-prober/os-prober-mounted-partitions-fix.patch"
    patch -Np1 -i "${worktree}/patches/os-prober/os-prober-factor-out-logger.patch"
    # To be sent upstream
    patch -Np1 -i "${worktree}/patches/os-prober/os-prober-factored-logger-efi-fix.patch"
    patch -Np1 -i "${worktree}/patches/os-prober/os-prober-umount-fix.patch"
    patch -Np1 -i "${worktree}/patches/os-prober/os-prober-grub2-parsefix.patch"
    patch -Np1 -i "${worktree}/patches/os-prober/os-prober-grepfix.patch"
    patch -Np1 -i "${worktree}/patches/os-prober/os-prober-gentoo-fix.patch"

    # Use 'libsuffix' if defined
    if test -n "$libSuffix"
    then
        find . -type f -exec sed -i -e "s|usr/lib|usr/lib${libSuffix}|g" {} \;
    fi

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    make -j${jobs} V=1 CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static"

    mkdir -p "${destdir}/usr/bin"
    cp -p linux-boot-prober "${destdir}/usr/bin"
    cp -p os-prober "${destdir}/usr/bin"
    chmod 755 "${destdir}/usr/bin"/*

    mkdir -p "${destdir}/usr/lib${libSuffix}/os-prober"
    cp -p newns "${destdir}/usr/lib${libSuffix}/os-prober"
    chmod 755 "${destdir}/usr/lib${libSuffix}/os-prober/newns"

    # linux-boot-probes

    mkdir -p "${destdir}/usr/lib${libSuffix}/linux-boot-probes/mounted"

    cd linux-boot-probes
    for file in mounted/common/* mounted/x86/*
    do
        test -f "$file" || continue

        echo "Copying linux-boot-probes/${file} ..."

        cp -p $file \
         "${destdir}/usr/lib${libSuffix}/linux-boot-probes/mounted/"

        chmod 755 \
         "${destdir}/usr/lib${libSuffix}/linux-boot-probes/mounted/${file##*/}"
    done
    unset -v file

    cp -p common/50mounted-tests \
     "${destdir}/usr/lib${libSuffix}/linux-boot-probes"
    chmod 755 \
     "${destdir}/usr/lib${libSuffix}/linux-boot-probes/50mounted-tests"

    cd ..
    # End of linux-boot-probes

    # os-probes

    mkdir -p "${destdir}/usr/lib${libSuffix}/os-probes/mounted/efi"
    cd os-probes
    for file in mounted/common/* mounted/x86/*
    do
        test -f "$file" || continue

        echo "Copying os-probes/${file} ..."

        cp -p $file \
         "${destdir}/usr/lib${libSuffix}/os-probes/mounted/"

        chmod 755 \
         "${destdir}/usr/lib${libSuffix}/os-probes/mounted/${file##*/}"
    done
    unset -v file

    cp -p mounted/x86/efi/* \
     "${destdir}/usr/lib${libSuffix}/os-probes/mounted/efi"

    mkdir -p "${destdir}/usr/lib${libSuffix}/os-probes/init"
    cp -p init/common/* "${destdir}/usr/lib${libSuffix}/os-probes/init"

    cp -p common/50mounted-tests \
      "${destdir}/usr/lib${libSuffix}/os-probes"
    chmod 755 \
     "${destdir}/usr/lib${libSuffix}/os-probes/50mounted-tests"

    cp -p mounted/powerpc/20macosx \
     "${destdir}/usr/lib${libSuffix}/os-probes/mounted"
    chmod 755 "${destdir}/usr/lib${libSuffix}/os-probes/mounted/20macosx"

    cd ..
    # End of os-probes

    mkdir -p "${destdir}/usr/share/os-prober"
    cp -p common.sh "${destdir}/usr/share/os-prober"
    chmod 755 "${destdir}/usr/share/os-prober/common.sh"

    # Create local state directory
    mkdir -p "${destdir}/var/lib/os-prober"

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/boot/os-prober/recipe


code:
# Re-create .control symlink
cd etc/perp && {
    rm -f .control
    ln -sf /var/run/perp .control
}

path: recipes/boot/perp/post-install


code:
# Build recipe for perp.
#
# Copyright (c) 2016-2019, 2021 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=perp
version=2.07
release=8

# Define a category for the output of the package name
pkgcategory=boot

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch="
 https://dragora.mirror.garr.it/current/sources/$tarname
 https://b0llix.net/perp/distfiles/$tarname
"

description="
A persistent process supervisor and service managment framework.

The perp package provides a set of daemons and utilities to reliably
start, monitor, log, and control a collection of persistent processes.

A \"persistent process\" is any program intended to be long-running,
highly available, and purpose critical.  Also known and often described
as a service, a persistent process normally provides some essential,
on-demand system service.  Programs that serve email, domain name
queries, and http requests are all examples of services that are
normally run as persistent processes.

These are the programs that you want to start at system boot, and to
continue running for as long as the system itself.  These are the
programs you need running in uninterrupted service, day and night,
forever and ever.

perp helps make sure that they do.
"

homepage=https://b0llix.net/perp
license=Custom

# Source documentation
docs="CHANGES LICENSE README THANKS"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    # Apply patches in order to refresh perp-2.07
    # See: https://github.com/michaelforney/perp/commits/master
    patch -Np1 -i "${worktree}/patches/perp/perp-patches"

    # Apply patches from Dragora
    patch -Np1 -i "${worktree}/patches/perp/runchoom-use-oom_score_adj"
    patch -Np0 -i "${worktree}/patches/perp/flags-conf.mk.diff"

    make -j${jobs} CC="cc -static" \
     CPPFLAGS="$QICPPFLAGS" QICFLAGS="$QICFLAGS"
    make -j${jobs} V=1 strip
    make -j${jobs} DESTDIR="$destdir" install

    # Automatic installation setup
    DESTDIR="$destdir" ./perp/perp-setup /etc/perp

    # Create "the blessed" /var/run/perp directory
    mkdir -p "${destdir}/var/run/perp"
    chmod 700 "${destdir}/var/run/perp"

    # Include our config file for tinylog(8)
    cp -p "${worktree}/archive/perp/etc/tinylog.conf" \
          "${destdir}/etc/"
    chmod 644 "${destdir}/etc/tinylog.conf"

    # Include our custom essential perp init scripts
    cp -p "${worktree}/archive/perp/etc/rc.log-boot" \
          "${destdir}/etc/perp/.boot/rc.log"

    cp -p "${worktree}/archive/perp/etc/rc.perp-boot" \
          "${destdir}/etc/perp/.boot/rc.perp"

    chmod 755 "${destdir}/etc/perp/.boot/rc.log" \
              "${destdir}/etc/perp/.boot/rc.perp"

    # Include profile file
    mkdir -p "${destdir}/etc/profile.d"
    cp -p "${worktree}/archive/perp/etc/profile.d/perp.sh" \
           "${destdir}/etc/profile.d/"
    chmod 644 "${destdir}/etc/profile.d/perp.sh"

    # To handle config file(s)
    touch "${destdir}/etc/.graft-config" \
          "${destdir}/etc/perp/.boot/.graft-config" \
          "${destdir}/etc/profile.d/.graft-config"

    # We don't include perp-setup*
    rm -f "${destdir}/usr/sbin/perp-setup" \
          "${destdir}/${mandir}/man8/perp-setup.8"

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/boot/perp/recipe


code:
echo "Creating ${rootdir}/run/initctl interface, if needed ..."
if test ! -e "${rootdir}/run/initctl" || \
   test ! -p "${rootdir}/run/initctl"
then
    mkdir -p -- "${rootdir}/run"
    rm -f -- "${rootdir}/run/initctl"
    mknod -m 600 -- "${rootdir}/run/initctl" p
fi

# Reload init(8)

# Only reload the init if 'rootdir' was not given
if test -z "$rootdir"
then
    echo "Reloading PID 1 ..."
    init U || kill -s HUP 1
fi

path: recipes/boot/sysvinit/post-install


code:
# Build recipe for sysvinit.
#
# Copyright (c) 2018-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=sysvinit
version=3.01
release=1

# Define a category for the output of the package name
pkgcategory=boot

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch=https://download.savannah.nongnu.org/releases/sysvinit/$tarname

description="
The System V init (version $version).

The sysvinit package contains programs for controlling the startup,
running, and shutdown of the system.

System V init was originally written by Miquel van Smoorenburg.
"

homepage=https://savannah.nongnu.org/projects/sysvinit
license=GPLv2+

# Source documentation
docs="COPYING COPYRIGHT README doc/Changelog doc/Propaganda"
docsdir="${docdir}/${program}"

# Limit package name to the program name
full_pkgname="${program}@${pkgcategory}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    # Adjust some (rc) script paths for Dragora 3+
    patch -p0 < "${worktree}/patches/sysvinit/sysvinit-adjust_paths.h.diff"

    # Remove several programs installed by other packages
    patch -p1 < "${worktree}/patches/sysvinit/sysvinit-2.98-dragora_consolidated-1.patch"

    make -j${jobs} CPPFLAGS="$QICPPFLAGS -D_FORTIFY_SOURCE=1" CFLAGS="$QICFLAGS" STATIC="-static"
    make -j${jobs} ROOT="$destdir" install

    strip --strip-unneeded "${destdir}/sbin"/* 2> /dev/null || true

    # Remove empty directories
    rmdir "${destdir}/bin" "${destdir}/usr/bin" || true

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/boot/sysvinit/recipe


code:
# Build recipe for bzip2.
#
# Copyright (c) 2016-2018 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=bzip2
version=1.0.6
release=2

# Define a category for the output of the package name
pkgcategory=compressors

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch="
https://mirror.fsf.org/dragora/v3/sources/$tarname
https://www.bzip.org/${version}/$tarname
"

description="
A high-quality data compressor program.

Bzip2 is a high quality compressor that uses the best compression
techniques (from the PPM family of statistical compressors).
In general, the compression is considerabily better than other
compressors, based on LZ77/LZ78 algorithm.

The author of bzip2 is Julian Seward.
"

homepage=https://www.bzip.org
license=Custom

# Source documentation
docs="CHANGES LICENSE README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    # Apply a patch to install the documentation (thanks to LFS)
    patch -Np1 -i "${worktree}/patches/bzip2/bzip2-1.0.6-install_docs-1.patch"

    # Ensure installation of relative symbolic links (thanks to LFS)
    sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile

    # Ensure the man pages are installed into the correct location
    sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile

    # Ensure location for libraries
    sed -i "s@(PREFIX)/lib@(PREFIX)/lib${libSuffix}@g" Makefile

    # Build bzip2.
    #
    # Provide shared libraries for third party programs
    make -f Makefile-libbz2_so
    make clean

    # Recompile program for static linking
    make LDFLAGS="$QILDFLAGS -static"
    make PREFIX="${destdir}/usr" install

    # Copy shared libraries into package destination
    cp -f -p libbz2.so* "${destdir}/usr/lib${libSuffix}"

    # Library measurement
    strip -s "${destdir}/usr/lib${libSuffix}/libbz2.so.1.0.6"

    # Make soft links providing compatibility
    (
        cd "${destdir}/usr/lib${libSuffix}" || exit 1
        ln -sf libbz2.so.1.0.6 libbz2.so.1.0
        ln -sf libbz2.so.1.0.6 libbz2.so
    )

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy the rest of the documentation
    mkdir -p "${destdir}/$docsdir"

    for file in $docs
    do
        cp -p $file "${destdir}/$docsdir"
    done
}


code:
# Build recipe for clzip.
#
# Copyright (c) 2016-2019, 2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=clzip
version=1.13
release=2

# Define a category for the output of the package name
pkgcategory=compressors

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=https://download.savannah.gnu.org/releases/lzip/clzip/$tarname

description="
C version of the high-quality data compressor Lzip.

Clzip is a lossless data compressor with a user interface similar to
the one of gzip or bzip2.  Clzip is about as fast as gzip, compresses
most files more than bzip2, and is better than both from a data
recovery perspective.

Clzip uses the lzip file format; the files produced by clzip are fully
compatible with lzip-1.4 or newer, and can be rescued with lziprecover.

Clzip is in fact a C language version of lzip, intended for embedded
devices or systems lacking a C++ compiler.
"

homepage=https://lzip.nongnu.org/clzip.html
license=GPLv2+

# Source documentation
docs="AUTHORS COPYING ChangeLog NEWS README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" \
    CFLAGS+="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
     $configure_args \
     --infodir=$infodir \
     --mandir=$mandir \
     --build="$(gcc -dumpmachine)"

    make -j${jobs}
    make -j${jobs} DESTDIR="$destdir" install

    # Compress info documents and manual page

    rm -f "${destdir}/${infodir}/dir";	# Redundancy
    lzip -9 \
     "${destdir}/${infodir}/clzip.info" \
     "${destdir}/${mandir}/man1/clzip.1"

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/compressors/clzip/recipe


code:
# Build recipe for gzip.
#
# Copyright (c) 2016-2018, 2020 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=gzip
version=1.10
release=3

# Define a category for the output of the package name
pkgcategory=compressors

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=https://ftp.gnu.org/gnu/gzip/$tarname

description="
Compression utility.

Gzip (GNU zip) is a compression utility designed to be a replacement
for 'compress'.  Its main advantages over 'compress' are much better
compression and freedom from patented algorithms.  It has been adopted
by the GNU project and is now relatively popular on the Internet.

This package has been built to be used with the zutils package.
"

homepage=https://www.gnu.org/software/gzip
license=GPLv3+

# Source documentation
docs="AUTHORS COPYING ChangeLog NEWS README* THANKS TODO"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure DEFS="NO_ASM" CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --infodir=$infodir \
     --mandir=$mandir \
     --program-transform-name='s/^z/gz/' \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # No, no hard links for the package size
    ( cd "${destdir}/usr/bin" && ln -sf gunzip uncompress )

    (
        cd "${destdir}/${mandir}/man1" || exit 1
        ln -sf gzip.1    gunzip.1
        ln -sf gzip.1    gzcat.1
        ln -sf gzdiff.1  gzcmp.1
    )

    # Compress info documents deleting index file for the package
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/compressors/gzip/recipe


code:
# Build recipe for plzip.
#
# Copyright (c) 2017-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=plzip
version=1.10
release=2

# Define a category for the output of the package name
pkgcategory=compressors

tarname=${program}-${version}.tar.lz

# Remote source(s)
fetch=https://download.savannah.gnu.org/releases/lzip/plzip/$tarname

homepage=https://lzip.nongnu.org/plzip.html
license=GPLv2+

description="
A massively parallel lossless data compressor (version $version).

Plzip is a massively parallel (multi-threaded) lossless data compressor
based on the lzlib compression library, with a user interface similar
to the one of lzip, bzip2 or gzip.

Plzip can compress/decompress large files on multiprocessor machines
much faster than lzip, at the cost of a slightly reduced compression
ratio (0.4 to 2 percent larger compressed files).  Note that the number
of usable threads is limited by file size; on files larger than a
few GB plzip can use hundreds of processors, but on files of only a
few MB plzip is no faster than lzip.

Plzip is the default version of Lzip used in Dragora as the main 'lzip'.
"

# Limit package name to the program name
full_pkgname="${program}@${pkgcategory}"

# Source documentation
docs="AUTHORS COPYING ChangeLog NEWS README"
docsdir="${docdir}/${program}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" \
    CXXFLAGS+="$QICXXFLAGS" LDFLAGS="$QILDFLAGS -static" \
     $configure_args \
     --infodir=$infodir \
     --mandir=$mandir \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install-as-lzip

    # Compress info documents and manual page

    rm -f "${destdir}/${infodir}/dir";	# Redundancy
    lzip -9 \
     "${destdir}/${infodir}/plzip.info" \
     "${destdir}/${mandir}/man1/plzip.1"

    # Make symlink for compatibility
    ln -s plzip.1.lz "${destdir}/${mandir}/man1/lzip.1.lz"

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/compressors/plzip/recipe


code:
# Build recipe for unzip.
#
# Copyright (c) 2017 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=unzip
version=60
pkgversion=6.0
release=1

# Define a category for the output of the package name
pkgcategory=compressors

tarname=${program}${version}.tar.gz

# Remote source(s)
fetch=https://downloads.sourceforge.net/infozip/$tarname

description="
A utility for extracting ZIP files.

UnZip is an extraction utility for archives compressed in .zip format
(also called \"zipfiles\").  Although highly compatible both with
PKWARE's PKZIP and PKUNZIP utilities for MS-DOS and with Info-ZIP's own
Zip program, our primary objectives have been portability and non-MSDOS
functionality.
"

homepage=https://www.info-zip.org/UnZip.html
license="Custom, Info-Zip"

# Source documentation
docs="BUGS LICENSE README ToDo WHERE"
docsdir="${docdir}/${program}-${pkgversion}"

# Source directory for this software
srcdir=${program}${version}

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    # Apply patches from the Fedora project, thanks!
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-bzip2-configure.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-exec-shield.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-close.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-attribs-overflow.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-configure.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-manpage-fix.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-fix-recmatch.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-symlink.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-caseinsensitive.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-format-secure.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-valgrind.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-x-option.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-overflow.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-cve-2014-8139.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-cve-2014-8140.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-cve-2014-8141.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-overflow-long-fsize.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-heap-overflow-infloop.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-alt-iconv-utf8.patch"
    patch -p1 < "${worktree}/patches/unzip/unzip-6.0-alt-iconv-utf8-print.patch"
    patch -p1 < "${worktree}/patches/unzip/0001-Fix-CVE-2016-9844-rhbz-1404283.patch"

    make -f unix/Makefile \
      CF_NOOPT="-I. -DUNIX -DNOMEMCPY -DIZ_HAVE_UXUIDGID -DNO_LCHMOD" \
      LFLAGS2="$QILDFLAGS -static" generic_gcc

    make -f unix/Makefile \
      prefix="${destdir}/usr" \
      MANDIR="${destdir}/${mandir}/man1" \
      INSTALL="cp -p" \
      install

    # Reinclude zipgrep fixing its ownerships
    rm -f "${destdir}/usr/bin/zipgrep"
    cat unix/zipgrep > "${destdir}/usr/bin/zipgrep"
    chmod 755 "${destdir}/usr/bin/zipgrep"

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"

    for file in $docs
    do
        cp -p $file "${destdir}/$docsdir"
    done
}

path: recipes/compressors/unzip/recipe


code:
# Build recipe for xlunzip.
#
# Copyright (c) 2018, 2020-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=xlunzip
version=0.7
release=2

# Define a category for the output of the package name
pkgcategory=compressors

tarname=${program}-${version}.tar.lz

# Remote source(s)
fetch=https://download-mirror.savannah.gnu.org/releases/lzip/xlunzip/$tarname

description="
A test tool for the lzip code in the Linux Kernel.

Xlunzip is a test tool for the lzip decompression code in the Linux
Kernel.  Xlunzip is similar to lunzip, but it uses the lzip_decompress
linux module as a backend.  Xlunzip tests the module for stream,
buffer-to-buffer and mixed decompression modes, including in-place
decompression (using the same buffer for input and output).
"

homepage=https://lzip.nongnu.org/xlunzip.html
license=GPLv2+

# Source documentation
docs="AUTHORS COPYING ChangeLog NEWS README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" \
    CFLAGS+="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
     $configure_args \
     --infodir=$infodir \
     --mandir=$mandir \
     --build="$(gcc -dumpmachine)"

    make -j${jobs}
    make -j${jobs} DESTDIR="$destdir" install

    # Compress info documents (if needed)
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/compressors/xlunzip/recipe


code:
# Build recipe for xz.
#
# Copyright (c) 2016-2019, 2021 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=xz
version=5.2.5
release=1

# Define a category for the output of the package name
pkgcategory=compressors

tarname=${program}-${version}.tar.bz2

# Remote source(s)
fetch=https://tukaani.org/xz/$tarname

description="
A (complex) compression utility based on the LZMA algorithm.

XZ Utils is free general-purpose data compression software with a high
compression ratio.  XZ Utils were written for POSIX-like systems, but
also work on some not-so-POSIX systems.

WARNING:
  The usage of this utility to distribute files or backup your data
IS TOTALLY DISCOURAGED.  Limit its usage to decompression only,
since some maintainers refuse to distribute in a better format.

For more information, see https://lzip.nongnu.org/xz_inadequate.html

It is highly recommended the use of lzip(1) instead of xz(1).
"

homepage=https://tukaani.org/xz
license=GPLv2+

# Source documentation
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --mandir=$mandir \
     --docdir=$docsdir \
     --enable-static=no \
     --enable-shared=yes \
     --disable-rpath \
     --disable-lzmadec \
     --disable-lzmainfo \
     --disable-lzma-links \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install-strip

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi
}

path: recipes/compressors/xz/recipe


code:
# Build recipe for zstd.
#
# Copyright (c) 2022 DustDFG, <dfgdust@gmail.com>.
# Copyright (c) 2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=zstd
version=1.5.2
release=3

# Define a category for the output of the package name
pkgcategory=compressors

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=https://github.com/facebook/zstd/releases/download/${version}/$tarname

description="
Zstandard (zstd) is a fast compression algorithm.

Zstandard, or zstd as short version, is a fast lossless compression algorithm,
targeting real-time compression scenarios at zlib-level and better compression
ratios.  It is backed by a very fast entropy stage, provided by Huff0 and FSE
library.
"

homepage=https://facebook.github.io/zstd/
license="GPLv2+ | BSD-3 clause"

# Source documentation
docs="CHANGELOG CODE_OF_CONDUCT.md CONTRIBUTING.md COPYING LICENSE README.md TESTING.md"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    cd build/meson
    mkdir -p BUILD

    CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" \
    LDFLAGS="$QILDFLAGS" \
    meson setup $configure_args \
     --libdir /usr/lib${libSuffix} \
     --mandir=$mandir \
     --buildtype=release \
     --strip \
     -Ddefault_library=both \
     -Dbin_programs=true \
     -Dbin_contrib=true \
     -Dmulti_thread=enabled \
     -Dzlib=disabled \
     -Dlzma=disabled \
     -Dlz4=disabled \
     BUILD

    cd BUILD
    ninja -j${jobs}
    DESTDIR="$destdir" ninja -j${jobs} install

    # Switch back to the main source directory
    cd ../../..

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/compressors/zstd/recipe


code:
# Build recipe for zutils.
#
# Copyright (c) 2017-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=zutils
version=1.11
release=2

# Define a category for the output of the package name
pkgcategory=compressors

tarname=${program}-${version}.tar.lz

# Remote source(s)
fetch=https://download.savannah.gnu.org/releases/zutils/$tarname

description="
Utilities dealing with compressed files.

Zutils is a collection of utilities able to process any combination of
compressed and uncompressed files transparently.  If any given file,
including standard input, is compressed, its decompressed content is
used.  Compressed files are decompressed on the fly; no temporary files
are created.

These utilities are not wrapper scripts but safer and more efficient
C++ programs.  In particular the "--recursive" option is very efficient
in those utilities supporting it.
"

homepage=https://zutils.nongnu.org/zutils.html
license=GPLv2+

# Source documentation
docs="AUTHORS COPYING ChangeLog NEWS README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" \
    CXXFLAGS+="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --infodir=$infodir \
     --mandir=$mandir \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # To handle config file
    touch "${destdir}/etc/.graft-config"

    # Compress info documents (if needed)
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/compressors/zutils/recipe


code:
# Build recipe for acpid.
#
# Copyright (c) 2018-2019, 2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=acpid
version=2.0.33
release=1

# Define a category for the output of the package name
pkgcategory=daemons

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch=https://downloads.sourceforge.net/project/acpid2/$tarname

description="
Advanced Configuration and Power Interface event daemon.

The acpid is a completely flexible, totally extensible daemon for
delivering ACPI events.  It listens on netlink interface and when
an event occurs, executes programs to handle the event.
"

homepage=https://sourceforge.net/projects/acpid2
license=GPLv2+

# Source documentation
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --mandir=$mandir \
     --docdir=$docsdir \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Add ACPI event files

    mkdir -p "${destdir}/etc/acpi/events" "${destdir}/usr/libexec/acpi"

    cp -p "${worktree}/archive/acpid/events"/* "${destdir}/etc/acpi/events/" || true;
    touch "${destdir}/etc/acpi/events/.graft-config"
    cp -p -r "${worktree}/archive/acpid/events/actions"/* \
             "${destdir}/usr/libexec/acpi"

    # Set up package permissions

    find "${destdir}/etc/acpi" -type f -exec chmod 644 '{}' +
    find "${destdir}/usr/libexec/acpi" -type f -exec chmod 755 '{}' +

    # Install ACPI perp service

    mkdir -p "${destdir}/etc/perp/acpid"

    cp -p "${worktree}/archive/acpid/rc.log" \
          "${worktree}/archive/acpid/rc.main" \
          "${destdir}/etc/perp/acpid/"

    chmod 755 "${destdir}"/etc/perp/acpid/rc.*

    # Be an active service by default
    chmod +t "${destdir}/etc/perp/acpid"

    touch "${destdir}/etc/perp/acpid/.graft-config"
}

path: recipes/daemons/acpid/recipe


code:
# Build recipe for at.
#
# Copyright (c) 2018, 2020-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=at
version=3.2.2
release=1

# Define a category for the output of the package name
pkgcategory=daemons

tarname=${program}_${version}.orig.tar.gz

# Remote source(s)
fetch=http://software.calhariz.com/at/$tarname

description="
The at package provide delayed job execution and batch processing.

It includes:

at     - queues, examines or deletes jobs for later execution.
atd    - is the daemon that runs jobs queued for later execution.
atq    - lists the user's pending jobs, or all jobs, if superuser.
atrm   - deletes jobs, identified by their job number.
atrun  - runs jobs queued for later execution.
batch  - script that executes commands when system load levels permit.
"

homepage=https://blog.calhariz.com/tag/at
license=GPLv2+

# The source documentation will be auto-installed
docsdir="${docdir}/${program}-${version}"

# This source does not support parallel jobs
jobs=1

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    # Update for hosts based on musl
    cp -f "${worktree}/archive/common/config.guess" config.guess
    cp -f "${worktree}/archive/common/config.sub" config.sub

    # Fix Makefile.in so that the documentation directory is
    # installed in the specified docdir (Thanks to BLFS!)
    sed -i '/docdir/s/=.*/= @docdir@/' Makefile.in

    # Apply a patch (from "Void Linux") to solve build issues
    patch -p0 < "${worktree}/patches/at/flex_isleap.patch"

    ./configure CPPFLAGS="$QICPPFLAGS" \
    CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
    SENDMAIL=/usr/sbin/sendmail \
     $configure_args \
     --mandir=$mandir \
     --docdir=$docsdir \
     --with-jobdir=/var/spool/atd \
     --with-atspool=/var/spool/atd \
     --with-daemon_username=daemon \
     --with-daemon_groupname=daemon \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} IROOT="$destdir" install

    # Clean up installed file
    rm -f "${destdir}/var/spool/atd/.SEQ"

    # Set permissions for the spool directory
    chmod 770 "${destdir}/var/spool/atd"

    # Install atd perp service(s)

    mkdir -p "${destdir}/etc/perp/atd"

    cp -p "${worktree}/archive/at/rc.log" \
          "${worktree}/archive/at/rc.main" \
          "${destdir}/etc/perp/atd/"

    chmod 755 "${destdir}"/etc/perp/atd/rc.*

    # THIS SERVICE IS DISABLED BY DEFAULT
    chmod -t "${destdir}/etc/perp/atd"

    # Manage (dot) new files via graft(1)
    touch "${destdir}/etc/.graft-config" \
          "${destdir}/etc/perp/atd/.graft-config"

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi
}

path: recipes/daemons/at/recipe


code:
# To validate UUIDs (Universally Unique IDs)
chroot "$rootdir" /usr/bin/dbus-uuidgen --ensure 2> /dev/null

# Make symlink for compatibility at /etc
mkdir -p -- "${rootdir}/var/lib/dbus"
chown -- messagebus "${rootdir}/var/lib/dbus"
ln -sf -- "${rootdir}/var/lib/dbus/machine-id" "${rootdir}/etc"


code:
# Build recipe for dbus.
#
# Copyright (C) 2018, MMPG <mmpg@vp.pl>
# Copyright (c) 2018-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=dbus
version=1.14.0
release=1

pkgname=dbus-x11

# Define a category for the output of the package name
pkgcategory=daemons

# The installation of this package replaces to
replace=dbus

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch=https://dbus.freedesktop.org/releases/dbus/$tarname

description="
A system daemon and a per user login session daemon (with X11 support).

The message bus is built on top of a general one-to-one message passing
framework, which can be used by any two apps to communicate directly
(without going through the message bus daemon).
"

homepage=https://www.freedesktop.org/wiki/Software/dbus/
license="AFLv2.1 | GPLv2+"

# Source documentation
docs="AUTHORS CONTRIBUTING.md COPYING NEWS README"
docsdir="${docdir}/${pkgname}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Apply a patch to allow root to do anything (Thanks to "Slackware Linux").
    patch -Np1 \
     -i "${worktree}/patches/dbus/dbus-1.12.x-allow_root_globally.diff"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" \
    CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --mandir=$mandir \
     --docdir=$docsdir \
     --enable-static=no \
     --enable-shared=yes \
     --enable-debug=no \
     --enable-inotify \
     --enable-x11-autolaunch \
     --disable-selinux \
     --disable-doxygen-docs \
     --with-xml=expat \
     --with-system-socket=/var/run/dbus/system_bus_socket \
     --with-system-pid-file=/var/run/dbus/dbus.pid \
     --with-console-auth-dir=/dev/console \
     --with-systemduserunitdir=no \
     --with-systemdsystemunitdir=no \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} check
    make -j${jobs} DESTDIR="$destdir" install

    chown root:messagebus "${destdir}/usr/libexec/dbus-daemon-launch-helper"
    chmod 4750 "${destdir}/usr/libexec/dbus-daemon-launch-helper"

    mkdir -p "${destdir}/etc/dbus-1/system.d"

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"

    # Install perp service for DBUS

    mkdir -p "${destdir}/etc/perp/dbus"
    cp -p "${worktree}/archive/dbus/rc.log" \
          "${worktree}/archive/dbus/rc.main" \
          "${destdir}/etc/perp/dbus/"

    chmod 755 "${destdir}"/etc/perp/dbus/rc.*

    # Be an active service by default
    chmod +t "${destdir}/etc/perp/dbus"

    # To handle config file(s)
    touch "${destdir}/etc/dbus-1/.graft-config" \
          "${destdir}/etc/perp/dbus/.graft-config"
}


path: recipes/daemons/dbus/post-install


code:
# Build recipe for dbus (Use 'dbus-x11' instead for the X11 support).
#
# Copyright (C) 2018, MMPG <mmpg@vp.pl>
# Copyright (c) 2018-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=dbus
version=1.14.0
release=1

# Define a category for the output of the package name
pkgcategory=daemons

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch=https://dbus.freedesktop.org/releases/dbus/$tarname

description="
A system daemon and a per user login session daemon.

The message bus is built on top of a general one-to-one message passing
framework, which can be used by any two apps to communicate directly
(without going through the message bus daemon).
"

homepage=https://www.freedesktop.org/wiki/Software/dbus/
license="AFLv2.1 | GPLv2+"

# Source documentation
docs="AUTHORS CONTRIBUTING.md COPYING NEWS README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Apply a patch to allow root to do anything (Thanks to "Slackware Linux").
    patch -Np1 \
     -i "${worktree}/patches/dbus/dbus-1.12.x-allow_root_globally.diff"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" \
    CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --mandir=$mandir \
     --docdir=$docsdir \
     --enable-static=no \
     --enable-shared=yes \
     --enable-debug=no \
     --enable-inotify \
     --disable-x11-autolaunch \
     --disable-systemd \
     --disable-selinux \
     --disable-doxygen-docs \
     --with-xml=expat \
     --with-system-socket=/var/run/dbus/system_bus_socket \
     --with-system-pid-file=/var/run/dbus/dbus.pid \
     --with-console-auth-dir=/dev/console \
     --with-systemduserunitdir=no \
     --with-systemdsystemunitdir=no \
     --without-x \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} check
    make -j${jobs} DESTDIR="$destdir" install

    chown root:messagebus "${destdir}/usr/libexec/dbus-daemon-launch-helper"
    chmod 4750 "${destdir}/usr/libexec/dbus-daemon-launch-helper"

    mkdir -p "${destdir}/etc/dbus-1/system.d"

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"

    # Install perp service for DBUS

    mkdir -p "${destdir}/etc/perp/dbus"
    cp -p "${worktree}/archive/dbus/rc.log" \
          "${worktree}/archive/dbus/rc.main" \
          "${destdir}/etc/perp/dbus/"

    chmod 755 "${destdir}"/etc/perp/dbus/rc.*

    # Be an active service by default
    chmod +t "${destdir}/etc/perp/dbus"

    # To handle config file(s)
    touch "${destdir}/etc/dbus-1/.graft-config" \
          "${destdir}/etc/perp/dbus/.graft-config"
}

path: recipes/daemons/dbus/recipe


code:
# Build recipe for scron.
#
# Copyright (c) 2017 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=scron
version=0.4
release=1

# Define a category for the output of the package name
pkgcategory=daemons

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=https://dl.2f30.org/releases/$tarname

description="
Clock daemon.

Scron schedules commands to be run at specified dates and times.
"

homepage=https://git.2f30.org/scron
license=MIT/X

# Source documentation
docs="LICENSE README TODO"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    make -j${jobs} \
     CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS -std=c99 -Wall -Wextra -pedantic -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE" \
     LDFLAGS="$QILDFLAGS -static" \
     PREFIX=/usr \
     MANPREFIX=$mandir \
     DESTDIR="$destdir" install

    # Compress man page and copy the documentation

    lzip -9 "${destdir}/${mandir}/man1/scron.1"
    ln -s scron.1.lz "${destdir}/${mandir}/man1/cron.1.lz"	# Symlink-compatibility.

    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"

    # Create directories adding the crontab file

    mkdir -p "${destdir}/etc/cron.hourly"  \
             "${destdir}/etc/cron.daily"   \
             "${destdir}/etc/cron.weekly"  \
             "${destdir}/etc/cron.monthly"

    # Incorporate our "run-parts" version for running cron jobs
    cp -p "${worktree}/archive/scron/run-parts" "${destdir}/usr/bin/"
    chmod 755 "${destdir}/usr/bin/run-parts"

    # Add the crontab file
    mkdir -p "${destdir}/etc"
    cp -p "${worktree}/archive/scron/crontab" "${destdir}/etc/"
    chmod 644 "${destdir}/etc/crontab"

    # Install scron perp service

    mkdir -p "${destdir}/etc/perp/crond"

    cp -p "${worktree}/archive/scron/rc.log" \
          "${worktree}/archive/scron/rc.main" \
          "${destdir}/etc/perp/crond/"

    chmod 755 "${destdir}"/etc/perp/crond/rc.*

    # Be an active service by default
    chmod +t "${destdir}/etc/perp/crond"

    # To handle config file(s)
    touch "${destdir}/etc/.graft-config" \
          "${destdir}/etc/perp/crond/.graft-config"
}

path: recipes/daemons/scron/recipe


code:
# Build recipe for sysklogd.
#
# Copyright (c) 2021-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=sysklogd
version=2.3.0
release=1

# Define a category for the output of the package name
pkgcategory=daemons

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=https://github.com/troglobit/sysklogd/releases/download/v${version}/$tarname

description="
Logging system.

The sysklogd package contains programs for logging system messages,
such as those given by the kernel when unusual things happen.
"

homepage=https://github.com/troglobit/sysklogd
license="BSD 3-clause"

# Source documentation
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" \
    CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --mandir=$mandir \
     --docdir=$docsdir \
     --without-logger \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # Set up configuration file

    mkdir -p "${destdir}/etc/syslog.d"
    cp -p "${worktree}/archive/sysklogd/syslog.conf" "${destdir}/etc"
    chmod 644 "${destdir}/etc/syslog.conf"

    # Set up file for logrotate

    mkdir -p "${destdir}/etc/logrotate.d"
    cp -p "${worktree}/archive/sysklogd/syslogd.logrotate" \
          "${destdir}/etc/logrotate.d"
    chmod 644 "${destdir}/etc/logrotate.d/syslogd.logrotate"

    # Install inetd perp service

    mkdir -p "${destdir}/etc/perp/syslogd"

    cp -p "${worktree}/archive/sysklogd/rc.log" \
          "${worktree}/archive/sysklogd/rc.main" \
          "${destdir}/etc/perp/syslogd/"

    chmod 755 "${destdir}"/etc/perp/syslogd/rc.*

    # THIS SERVICE IS ENABLED BY DEFAULT
    chmod +t "${destdir}/etc/perp/syslogd"

    # To handle dot .new file(s)
    touch "${destdir}/etc/.graft-config" \
          "${destdir}/etc/logrotate.d/.graft-config" \
          "${destdir}/etc/perp/syslogd/.graft-config"

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi
}

path: recipes/daemons/sysklogd/recipe