mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
Everywhere: Remove everything non-essential for "make clean all"
This commit removes everything not strictly necessary for running "make clean all" inside jw-build. packaging jw-devtest. This cuts the repo down from 24077 to 4725 lines of code. The idea is to 1) Further remove bloat from the remaining bits 2) Re-add what's necessary to build and package other essential repos. The decision should be based on whether or not jw-build can also be useful in a non-janware context. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
c36c83c164
commit
bc883deed4
199 changed files with 0 additions and 18851 deletions
|
|
@ -1,168 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
_cat()
|
||||
{
|
||||
sed 's/^ *|//'
|
||||
}
|
||||
|
||||
cfg_section()
|
||||
{
|
||||
ini_section "$inifile" $@
|
||||
}
|
||||
|
||||
cfg_value()
|
||||
{
|
||||
ini_value "$inifile" $@
|
||||
}
|
||||
|
||||
cfg_escape()
|
||||
{
|
||||
sed 's/\\/\\\\/g; s/\$/\\$/g; s/`/\\`/g'
|
||||
}
|
||||
|
||||
# unneeded but kept, because it might come in handy in the future
|
||||
have_pkg()
|
||||
{
|
||||
echo "$subpackages" | grep -q "\(^[ ]*\|[ ]\+\)$1\([ ]\+\|$\)"
|
||||
return $?
|
||||
}
|
||||
|
||||
subpackage_description()
|
||||
{
|
||||
case $1 in
|
||||
run)
|
||||
echo "Runtime files"
|
||||
;;
|
||||
devel)
|
||||
echo "Development files"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
os_cascade()
|
||||
{
|
||||
# might want to run python3 path/to/projects.py --os=suse-tumbleweed os-cascade
|
||||
# or turn this into a python script and use projects.py as a module.
|
||||
|
||||
if [ "$DISTRIBUTION" ]; then
|
||||
echo os linux $DISTRIBUTION | sed 's/\([^-]\+\)-\([^-]\+\)/\1 \1-\2/g'
|
||||
else
|
||||
echo os linux
|
||||
fi
|
||||
}
|
||||
|
||||
# -- here we go
|
||||
|
||||
echo "== running $0" "$@" >&2
|
||||
|
||||
export LANG=POSIX
|
||||
dir=`dirname $0`
|
||||
inifile="$1"
|
||||
. $dir/ini-tools.sh
|
||||
|
||||
subpackages=`cfg_value global.subpackages`
|
||||
license=`cfg_value global.license`
|
||||
[ "$license" ] || license="janware GmbH proprietary license"
|
||||
vendor=`cfg_value global.vendor`
|
||||
[ "$vendor" ] || vendor="janware GmbH"
|
||||
url=`cfg_value global.url`
|
||||
[ "$url" ] || url="https://janware.com"
|
||||
|
||||
_cat <<- EOT
|
||||
|echo "%define debug_package %{nil}"
|
||||
|# ---------------------------------------
|
||||
|echo "Name: \$NAME"
|
||||
|echo "Summary: `cfg_value summary`"
|
||||
|echo "Version: \$VERSION"
|
||||
|echo "Release: \$RELEASE"
|
||||
|echo "License: $license"
|
||||
|echo "Group: System/Libraries"
|
||||
|[ -n "\$SOURCE" ] && echo "Source: \$SOURCE"
|
||||
|echo "Vendor: $vendor"
|
||||
|echo "URL: $url"
|
||||
|echo "BuildRoot: /var/tmp/%{name}-buildroot"
|
||||
|echo "Distribution: jw / openSUSE Tumbleweed"
|
||||
|echo ""
|
||||
|echo "%description"
|
||||
|echo "`cfg_value description`"
|
||||
|echo ""
|
||||
|# ---------------------------------------
|
||||
|echo "%prep"
|
||||
|echo "%setup -q -n \$NAME-\$V"
|
||||
|echo ""
|
||||
|echo "%build"
|
||||
|echo 'pwd'
|
||||
|echo 'make config'
|
||||
|echo 'make'
|
||||
|echo ""
|
||||
|echo "%install"
|
||||
|echo 'rm -rf \$RPM_BUILD_ROOT'
|
||||
|echo "export ENV_PREFIX=\\\$RPM_BUILD_ROOT"
|
||||
|echo "export INSTALL_LOG=\$INSTALL_LOG"
|
||||
|echo "mkdir -p \`dirname \$INSTALL_LOG\`"
|
||||
|echo "> \$INSTALL_LOG"
|
||||
|echo "make install"
|
||||
|echo "export PATH=$JWB_SCRIPT_DIR:\\\$PATH"
|
||||
|echo "/bin/bash pkg.sh milk-install-log -p \\\$ENV_PREFIX -n \$NAME -t rpm -s \\"$subpackages\\" \$INSTALL_LOG \`dirname \$INSTALL_LOG\`"
|
||||
|echo "exit 0" # <- Cut short CentOS magic appended to install scriptlet, which would generate .pyo files and other cruft.
|
||||
EOT
|
||||
|
||||
for p in $subpackages; do
|
||||
|
||||
P=${p^^}
|
||||
|
||||
_cat <<- EOT
|
||||
|echo ""
|
||||
|echo "# --------------------------------------- subpackage $p"
|
||||
|echo ""
|
||||
|echo "%package -n \$NAME-$p"
|
||||
|echo "Summary: `cfg_value summary`"
|
||||
|echo "Group: `cfg_value global.group`"
|
||||
|[ "\$REQUIRES_$P" ] && echo "Requires: \$REQUIRES_$P"
|
||||
|[ "\$CONFLICTS_$P" ] && echo "Conflicts: \$CONFLICTS_$P"
|
||||
|[ "\$PROVIDES_$P" ] && echo "Provides: \$PROVIDES_$P"
|
||||
|echo ""
|
||||
EOT
|
||||
|
||||
descr=`subpackage_description $p`
|
||||
if [ "$descr" ]; then
|
||||
_cat <<- EOT
|
||||
|echo ""
|
||||
|echo "%description -n \$NAME-$p"
|
||||
|echo "$descr"
|
||||
EOT
|
||||
fi
|
||||
|
||||
for stage in pre preun post postun; do
|
||||
echo "== processing stage $stage: cfg_section pkg.$p.$stage" >&2
|
||||
out=""
|
||||
#for os in '' `os_cascade | sed 's/\(^\| \)/ ./g'`; do
|
||||
for os in '' `os_cascade`; do
|
||||
sec=pkg.$p.$stage
|
||||
if [ "$os" ]; then
|
||||
sec="$sec.$os"
|
||||
head="\n# --- $os\n"
|
||||
else
|
||||
head=""
|
||||
fi
|
||||
cfg_section $sec | grep -q . || continue
|
||||
out="$out$head`cfg_section $sec`"
|
||||
done
|
||||
if [ "$out" ]; then
|
||||
echo -e "$out" >&2
|
||||
_cat <<- EOT
|
||||
|echo ""
|
||||
|echo "%$stage -n \$NAME-$p"
|
||||
EOT
|
||||
echo "cat << EOT"
|
||||
echo -e "$out" | cfg_escape
|
||||
echo "EOT"
|
||||
fi
|
||||
done
|
||||
|
||||
_cat <<- EOT
|
||||
|echo ""
|
||||
|echo "%files -n \$NAME-$p -f \$INSTALL_LOG.\$NAME-$p"
|
||||
|echo '%defattr (-, root, root)'
|
||||
EOT
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue