2016-02-04 15:32:03 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
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 ))
|
|
|
|
|
2021-03-28 10:16:45 +00:00
|
|
|
vital="false"
|
2016-02-04 15:32:03 +00:00
|
|
|
|
|
|
|
case "${outname}" in
|
2022-01-13 15:57:53 +00:00
|
|
|
bootloader)
|
|
|
|
pkgdeps=""
|
|
|
|
;;
|
2020-01-30 03:01:00 +00:00
|
|
|
clibs)
|
2021-03-28 10:16:45 +00:00
|
|
|
vital="true"
|
2020-01-30 03:01:00 +00:00
|
|
|
# clibs should not have any dependencies or anything
|
|
|
|
# else imposed on it.
|
|
|
|
;;
|
2023-07-31 14:38:45 +00:00
|
|
|
certctl)
|
|
|
|
pkgdeps="caroot openssl"
|
2020-01-29 18:47:08 +00:00
|
|
|
;;
|
2022-11-17 19:22:33 +00:00
|
|
|
|
|
|
|
# -dev packages that have no corresponding non-dev package
|
|
|
|
# as a dependency.
|
2023-01-06 14:44:54 +00:00
|
|
|
libcompat-dev|liby-dev)
|
2022-11-17 19:22:33 +00:00
|
|
|
outname=${outname%%-dev}
|
|
|
|
_descr="Development Files"
|
|
|
|
;;
|
2023-01-06 14:44:54 +00:00
|
|
|
libcompat-lib32_dev|liby-lib32_dev)
|
2022-11-17 19:22:33 +00:00
|
|
|
outname=${outname%%-lib32_dev}
|
|
|
|
_descr="32-bit Libraries, Development Files"
|
|
|
|
;;
|
2023-01-06 14:44:54 +00:00
|
|
|
libcompat-man|libelftc-man)
|
|
|
|
outname=${outname%%-man}
|
|
|
|
_descr="Manual Pages"
|
2023-01-05 22:38:14 +00:00
|
|
|
;;
|
2021-03-28 10:16:45 +00:00
|
|
|
utilities)
|
|
|
|
uclfile="${uclfile}"
|
|
|
|
;;
|
2016-03-08 18:31:26 +00:00
|
|
|
runtime)
|
|
|
|
outname="runtime"
|
2016-11-21 23:29:28 +00:00
|
|
|
_descr="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_DESCR)"
|
2021-03-28 10:16:45 +00:00
|
|
|
vital="true"
|
2016-11-21 23:29:28 +00:00
|
|
|
;;
|
2021-04-26 19:15:31 +00:00
|
|
|
*-lib32_dev)
|
|
|
|
outname="${outname%%-lib32_dev}"
|
2016-02-04 15:32:03 +00:00
|
|
|
_descr="32-bit Libraries, Development Files"
|
|
|
|
pkgdeps="${outname}"
|
|
|
|
;;
|
2021-04-26 19:15:31 +00:00
|
|
|
*-lib32_dbg)
|
|
|
|
outname="${outname%%-lib32_dbg}"
|
2016-02-04 15:32:03 +00:00
|
|
|
_descr="32-bit Libraries, Debugging Symbols"
|
|
|
|
pkgdeps="${outname}"
|
|
|
|
;;
|
2021-04-26 19:15:31 +00:00
|
|
|
*-lib32)
|
|
|
|
outname="${outname%%-lib32}"
|
2016-02-04 15:32:03 +00:00
|
|
|
_descr="32-bit Libraries"
|
|
|
|
pkgdeps="${outname}"
|
|
|
|
;;
|
2021-04-26 19:15:31 +00:00
|
|
|
*-dev)
|
|
|
|
outname="${outname%%-dev}"
|
2016-02-04 15:32:03 +00:00
|
|
|
_descr="Development Files"
|
|
|
|
pkgdeps="${outname}"
|
|
|
|
;;
|
2021-04-26 19:15:31 +00:00
|
|
|
*-dbg)
|
|
|
|
outname="${outname%%-dbg}"
|
2016-02-04 15:32:03 +00:00
|
|
|
_descr="Debugging Symbols"
|
|
|
|
pkgdeps="${outname}"
|
|
|
|
;;
|
2021-04-26 19:15:31 +00:00
|
|
|
*-man)
|
|
|
|
outname="${outname%%-man}"
|
2021-03-16 06:11:56 +00:00
|
|
|
_descr="Manual Pages"
|
|
|
|
pkgdeps="${outname}"
|
|
|
|
;;
|
2016-02-04 15:32:03 +00:00
|
|
|
${origname})
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
uclfile="${outname##*}${origname}"
|
|
|
|
outname="${outname##*}${origname}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
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}"
|
2021-03-28 10:16:45 +00:00
|
|
|
echo "vital=${vital}"
|
2016-02-04 15:32:03 +00:00
|
|
|
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
|
2023-07-31 14:38:45 +00:00
|
|
|
echo 'deps: {' >> ${uclfile}
|
|
|
|
for dep in ${pkgdeps}; do
|
|
|
|
cat <<EOF >> ${uclfile}
|
|
|
|
FreeBSD-${dep}: {
|
2020-01-30 03:01:00 +00:00
|
|
|
origin: "base",
|
|
|
|
version: "${PKG_VERSION}"
|
|
|
|
}
|
|
|
|
EOF
|
2023-07-31 14:38:45 +00:00
|
|
|
done
|
|
|
|
echo '}' >> ${uclfile}
|
2020-01-30 03:01:00 +00:00
|
|
|
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}/" \
|
2021-03-28 10:16:45 +00:00
|
|
|
-e "s/%VITAL%/${vital}/" \
|
2016-02-04 15:32:03 +00:00
|
|
|
-e "s/%CAP_MKDB_ENDIAN%/${cap_arg}/g" \
|
2020-08-11 08:42:24 +00:00
|
|
|
-e "s/%PKG_NAME_PREFIX%/${PKG_NAME_PREFIX}/" \
|
2020-08-11 10:07:59 +00:00
|
|
|
-e "s|%PKG_WWW%|${PKG_WWW}|" \
|
2020-08-11 08:42:24 +00:00
|
|
|
-e "s/%PKG_MAINTAINER%/${PKG_MAINTAINER}/" \
|
2016-02-04 15:32:03 +00:00
|
|
|
${uclfile}
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
main "${@}"
|