All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m32s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m48s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 5m6s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m41s
CI / Packaging test (push) Successful in 0s
The spec generator only supports Requires, Conflicts and Provides from the [pkg.requires.*], [pkg.conflicts.*] and [pkg.provides.*] sections of make/project.conf. A package that works without but is better with another package, like jw-amavis-run without jw-clamav-run, must hard-require it, so the dependency is pulled in on every install and cannot be removed without dragging the depending package along. This commit adds Recommends support to the spec generation chain: - CmdPkgRecommends: new pkg-recommends command that reads the [pkg.recommends.<flavour>] sections, same base as pkg-requires - pkg-dist.mk: compute PKG_RECOMMENDS_RUN and pass it to pkg.sh via a new -E option - pkg.sh: accept -E and forward it to the mkspec wrapper - mkspec-wrapper.sh: accept -E and export RECOMMENDS_RUN - create-mkspec.sh: emit a Recommends: line when RECOMMENDS_<subpkg> is set - create-mkdebian.sh: emit a Recommends: field in the debian control file Projects without a [pkg.recommends.*] section generate unchanged specs: every new line is guarded by a non-empty test. zypper follows Recommends by default, so existing OpenSUSE installations are unaffected; a recommended package can be removed without dragging the depending package along. Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.85.1 Signed-off-by: Jan Lindemann <jan@janware.com>
167 lines
3.6 KiB
Shell
167 lines
3.6 KiB
Shell
#!/bin/bash
|
|
|
|
_cat()
|
|
{
|
|
sed 's/^ *|//'
|
|
}
|
|
|
|
cfg_section()
|
|
{
|
|
ini_section "$inifile" "$@"
|
|
}
|
|
|
|
cfg_value()
|
|
{
|
|
ini_value "$inifile" "$@"
|
|
}
|
|
|
|
# -- here we go
|
|
|
|
echo "== running $0" "$@" >&2
|
|
|
|
export LANG=POSIX
|
|
dir=`dirname $0`
|
|
inifile="$1"
|
|
. $dir/ini-tools.sh
|
|
|
|
_cat <<- EOT
|
|
|format_depends()
|
|
|{
|
|
| echo "\$@" | sed 's/ */,/g; s/,\([><=]\+\),*/\1/g; s/, *,*/,/g; s/, *$//; s/^ *,//; s/\([><=]\+\)\([0-9.-]\+\)/ (\1\2) /g'
|
|
|}
|
|
|
|
|
|#changelog()
|
|
|#{
|
|
|# #dch -c /dev/stdout --create -v \$VERSION-\$RELEASE --package \$NAME
|
|
|#cat << EOF
|
|
|#\$NAME (\$VERSION-\$RELEASE) UNRELEASED; urgency=medium
|
|
|#
|
|
|# * Initial release. (Closes: #XXXXXX)
|
|
|#
|
|
|# -- Jan Lindemann <jan@janware.com> `date -R`
|
|
|#
|
|
|#EOF
|
|
|#}
|
|
|
|
|
|compat()
|
|
|{
|
|
| echo -n 9
|
|
|}
|
|
|
|
|
|control()
|
|
|{
|
|
|cat << EOF
|
|
|Source: \$NAME
|
|
|Maintainer: janware GmbH <`cfg_value global.jw-maintainer`@janware.com>
|
|
|Homepage: https://janware.com/code/janware/\$NAME
|
|
|Section: `cfg_value global.group`
|
|
|Priority: optional
|
|
|Standards-Version: 3.9.2
|
|
|Build-Depends: debhelper (>= 9)
|
|
EOT
|
|
|
|
cfg_value global.subpackages | grep -q run && _cat <<- EOT
|
|
|
|
|
|Package: \$NAME-run
|
|
|Architecture: any
|
|
|Depends: \`format_depends "\${shlibs:Depends}, \${misc:Depends}, \$REQUIRES_RUN"\`
|
|
|EOF
|
|
|[ -n "\$RECOMMENDS_RUN" ] && echo "Recommends: \`format_depends "\$RECOMMENDS_RUN"\`"
|
|
|cat << EOF
|
|
|# untested:
|
|
|Conflicts: \`format_depends "\$CONFLICTS_RUN"\`
|
|
|Description: `cfg_value summary`
|
|
|`cfg_value description | sed 's/^/ /'`
|
|
EOT
|
|
|
|
cfg_value global.subpackages | grep -q devel && _cat <<- EOT
|
|
|
|
|
|Package: \$NAME-devel
|
|
|Architecture: any
|
|
|Depends: \`format_depends "\$NAME-run = \$VERSION-\$RELEASE, \$REQUIRES_DEVEL"\`
|
|
|# untested:
|
|
|Conflicts: \`format_depends "\$CONFLICTS_DEVEL"\`
|
|
|Description: \$NAME Development Package
|
|
| Development tools for \$NAME-run
|
|
EOT
|
|
|
|
_cat <<- EOT
|
|
|EOF
|
|
|}
|
|
|
|
|
|copyright()
|
|
|{
|
|
| echo -n "Copyright (c) `date +'%Y'`, janware GmbH"
|
|
|}
|
|
|
|
|
|format()
|
|
|{
|
|
| echo "3.0 (quilt)"
|
|
|}
|
|
|
|
|
|rules()
|
|
|{
|
|
|cat << "EOF"
|
|
|#!/usr/bin/make -f
|
|
|
|
|
|# tip from https://pkg-perl.alioth.debian.org/debhelper.html
|
|
|# PACKAGE = \$(firstword \$(shell dh_listpackages))
|
|
|# TMP = \$(CURDIR)/debian/\$(PACKAGE)
|
|
|
|
|
|NAME = \$(shell pwd | xargs basename | sed 's/-[0-9.-]\+//')
|
|
|DEB_DIR = \$\$(pwd)/debian
|
|
|ENV_PREFIX = \$\$(pwd)/debian/tmp/inst-root
|
|
|EOF
|
|
|
|
|
|echo INSTALL_LOG = \$INSTALL_LOG
|
|
|
|
|
|cat << "EOF"
|
|
|%:
|
|
|EOF
|
|
|echo -e "\tdh \$""@"
|
|
|cat << EOF
|
|
|
|
|
|override_dh_auto_test:
|
|
|
|
|
|override_dh_installdirs:
|
|
| @echo "running override_dh_installdirs ($@)"
|
|
| #dh_installdirs
|
|
|
|
|
|override_dh_auto_install:
|
|
| @echo "running override_dh_auto_install ($@)"
|
|
| mkdir -p \`dirname \$INSTALL_LOG\`
|
|
| > \$INSTALL_LOG
|
|
| \\\$(MAKE) ENV_PREFIX=\\\$(ENV_PREFIX) INSTALL_LOG=\\\$(INSTALL_LOG) install
|
|
| PATH=$JWB_SCRIPT_DIR:\\\$(PATH) /bin/bash pkg.sh -m $JWB_SCRIPT_DIR milk-install-log -p \\\$(ENV_PREFIX) -n \\\$(NAME) -t deb \$INSTALL_LOG \\\$(DEB_DIR)
|
|
| dh_installdirs
|
|
|
|
|
|override_dh_install:
|
|
| dh_install --sourcedir=./debian/tmp/inst-root
|
|
|
|
|
|override_dh_shlibdeps:
|
|
| LD_LIBRARY_PATH=lib:\\\$(LD_LIBRARY_PATH) dh_shlibdeps
|
|
|
|
|
|override_dh_auto_clean:
|
|
|
|
|
|override_dh_compress:
|
|
|
|
|
|EOF
|
|
|}
|
|
|
|
|
|mkdir -p debian
|
|
|#dch --create --empty
|
|
|cd debian
|
|
|
|
|
|for file in compat control copyright format rules; do
|
|
| test -e \$file && continue
|
|
| \$file > \$file
|
|
|done
|
|
|
|
|
|chmod 755 rules
|
|
|
|
|
|cd ..
|
|
|
|
|
|dch --create --newversion \$VERSION-\$RELEASE --controlmaint --package \$NAME --force-distribution --distribution \$DISTRIBUTION "Release built by $0"
|
|
|
|
|
|echo "Produced by $0, the output should be in the \"debian\" sub-directory."
|
|
EOT
|