2016-02-04 15:32:03 +00:00
|
|
|
#!/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
|
2020-01-30 03:01:00 +00:00
|
|
|
clibs)
|
|
|
|
# clibs should not have any dependencies or anything
|
|
|
|
# else imposed on it.
|
|
|
|
;;
|
2020-01-29 18:47:08 +00:00
|
|
|
caroot)
|
|
|
|
pkgdeps="utilities"
|
|
|
|
;;
|
2016-03-08 18:31:26 +00:00
|
|
|
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)"
|
|
|
|
;;
|
2016-11-21 23:29:28 +00:00
|
|
|
jail_*)
|
|
|
|
outname="${origname}"
|
|
|
|
uclfile="${outname##*}${uclfile}"
|
|
|
|
pkgdeps="runtime"
|
|
|
|
_descr="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_DESCR)"
|
|
|
|
;;
|
2020-05-20 19:45:22 +00:00
|
|
|
*_lib32_dev)
|
|
|
|
outname="${outname%%_lib32_dev}"
|
2016-02-04 15:32:03 +00:00
|
|
|
_descr="32-bit Libraries, Development Files"
|
|
|
|
pkgdeps="${outname}"
|
|
|
|
;;
|
2020-05-20 19:45:22 +00:00
|
|
|
*_lib32_dbg)
|
|
|
|
outname="${outname%%_lib32_dbg}"
|
2016-02-04 15:32:03 +00:00
|
|
|
_descr="32-bit Libraries, Debugging Symbols"
|
|
|
|
pkgdeps="${outname}"
|
|
|
|
;;
|
|
|
|
*_lib32)
|
|
|
|
outname="${outname%%_lib32}"
|
|
|
|
_descr="32-bit Libraries"
|
|
|
|
pkgdeps="${outname}"
|
|
|
|
;;
|
2020-05-20 19:45:22 +00:00
|
|
|
*_dev)
|
|
|
|
outname="${outname%%_dev}"
|
2016-02-04 15:32:03 +00:00
|
|
|
_descr="Development Files"
|
|
|
|
pkgdeps="${outname}"
|
|
|
|
;;
|
2020-05-20 19:45:22 +00:00
|
|
|
*_dbg)
|
|
|
|
outname="${outname%%_dbg}"
|
2016-02-04 15:32:03 +00:00
|
|
|
_descr="Debugging Symbols"
|
|
|
|
pkgdeps="${outname}"
|
|
|
|
;;
|
|
|
|
${origname})
|
|
|
|
pkgdeps="runtime"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
uclfile="${outname##*}${origname}"
|
|
|
|
outname="${outname##*}${origname}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
outname="${outname%%_*}"
|
|
|
|
|
2020-08-07 10:20:39 +00:00
|
|
|
pkgdeps="$(echo ${pkgdeps} | tr '_' '-')"
|
|
|
|
|
2016-02-04 15:32:03 +00:00
|
|
|
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}"
|
2020-01-30 03:01:00 +00:00
|
|
|
if [ ! -z "${pkgdeps}" ]; then
|
|
|
|
cat <<EOF >> ${uclfile}
|
|
|
|
deps: {
|
|
|
|
FreeBSD-${pkgdeps}: {
|
|
|
|
origin: "base",
|
|
|
|
version: "${PKG_VERSION}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
fi
|
2018-06-28 13:48:59 +00:00
|
|
|
cap_arg="$( make -f ${srctree}/share/mk/bsd.endian.mk -VCAP_MKDB_ENDIAN )"
|
2016-02-04 15:32:03 +00:00
|
|
|
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 "${@}"
|