freebsd-nq/release/packages/generate-ucl.sh
Kyle Evans 9c5d67e942 pkgbase: remove logic for _profile packages
We don't produce these anymore as of r356797, remove the remnant in
generate-ucl.sh that accounted for them. This isn't strictly necessary, but
future work is needed for the various packages that can be generated on a
lib build.

Namely, we may produce -development packages for private/internal libs that
should be installed but won't have the base FreeBSD-libfoo pkg to depend on
because it's internal (e.g. liby, libpmcstat, libifconfig) but we want the
headers installed. It may be a better move to just shove these into
-runtime-development instead, but if not then we've just simplified the
cases that need to take private/internal libs into account.
2020-03-02 15:58:50 +00:00

152 lines
3.2 KiB
Bash
Executable File

#!/bin/sh
#
# $FreeBSD$
#
main() {
desc=
comment=
debug=
uclsource=
while getopts "do:s:u:" arg; do
case ${arg} in
d)
debug=1
;;
o)
outname="${OPTARG}"
origname="${OPTARG}"
;;
s)
srctree="${OPTARG}"
;;
u)
uclfile="${OPTARG}"
;;
*)
echo "Unknown argument"
;;
esac
done
shift $(( ${OPTIND} - 1 ))
outname="$(echo ${outname} | tr '-' '_')"
case "${outname}" in
clibs)
# clibs should not have any dependencies or anything
# else imposed on it.
;;
caroot)
pkgdeps="utilities"
;;
runtime)
outname="runtime"
uclfile="${uclfile}"
;;
runtime_manuals)
outname="${origname}"
pkgdeps="runtime"
;;
runtime_*)
outname="${origname}"
uclfile="${outname##*}${uclfile}"
pkgdeps="runtime"
_descr="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_DESCR)"
;;
jail_*)
outname="${origname}"
uclfile="${outname##*}${uclfile}"
pkgdeps="runtime"
_descr="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_DESCR)"
;;
*_lib32_development)
outname="${outname%%_lib32_development}"
_descr="32-bit Libraries, Development Files"
pkgdeps="${outname}"
;;
*_lib32_debug)
outname="${outname%%_lib32_debug}"
_descr="32-bit Libraries, Debugging Symbols"
pkgdeps="${outname}"
;;
*_lib32)
outname="${outname%%_lib32}"
_descr="32-bit Libraries"
pkgdeps="${outname}"
;;
*_development)
outname="${outname%%_development}"
_descr="Development Files"
pkgdeps="${outname}"
;;
*_debug)
outname="${outname%%_debug}"
_descr="Debugging Symbols"
pkgdeps="${outname}"
;;
${origname})
pkgdeps="runtime"
;;
*)
uclfile="${outname##*}${origname}"
outname="${outname##*}${origname}"
;;
esac
outname="${outname%%_*}"
desc="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_DESC)"
comment="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_COMMENT)"
uclsource="${srctree}/release/packages/${outname}.ucl"
if [ ! -e "${uclsource}" ]; then
uclsource="${srctree}/release/packages/template.ucl"
fi
if [ ! -z "${debug}" ]; then
echo ""
echo "==============================================================="
echo "DEBUG:"
echo "_descr=${_descr}"
echo "outname=${outname}"
echo "origname=${origname}"
echo "srctree=${srctree}"
echo "uclfile=${uclfile}"
echo "desc=${desc}"
echo "comment=${comment}"
echo "cp ${uclsource} -> ${uclfile}"
echo "==============================================================="
echo ""
echo ""
echo ""
fi
[ -z "${comment}" ] && comment="${outname} package"
[ ! -z "${_descr}" ] && comment="${comment} (${_descr})"
[ -z "${desc}" ] && desc="${outname} package"
cp "${uclsource}" "${uclfile}"
if [ ! -z "${pkgdeps}" ]; then
cat <<EOF >> ${uclfile}
deps: {
FreeBSD-${pkgdeps}: {
origin: "base",
version: "${PKG_VERSION}"
}
}
EOF
fi
cap_arg="$( make -f ${srctree}/share/mk/bsd.endian.mk -VCAP_MKDB_ENDIAN )"
sed -i '' -e "s/%VERSION%/${PKG_VERSION}/" \
-e "s/%PKGNAME%/${origname}/" \
-e "s/%COMMENT%/${comment}/" \
-e "s/%DESC%/${desc}/" \
-e "s/%CAP_MKDB_ENDIAN%/${cap_arg}/g" \
${uclfile}
return 0
}
main "${@}"