make, scripts: Add support for [pkg.provides.xxx]

Add Support for manually specifying arbitrary package capabilities in
project.conf.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2019-01-07 14:34:58 +00:00
commit f28afc777c
5 changed files with 45 additions and 31 deletions

View file

@ -409,10 +409,17 @@ build_pkg()
local tar_archive=$src_base.tar.bz2
local tar_archive_orig=$src_base.orig.tar.bz2
local distribution=`os`
local RPM_REQUIRES_RUN=`echo $RPM_REQUIRES_RUN | sed "s/__NEXT_VERSION__/$version/g; s/VERSION-REVISION/$version/g; s/VERSION/$version/g"`
local RPM_REQUIRES_DEVEL=`echo $RPM_REQUIRES_DEVEL | sed "s/__NEXT_VERSION__/$version/g; s/VERSION-REVISION/$version/g; s/VERSION/$version/g"`
local RPM_CONFLICTS_RUN=`echo $RPM_CONFLICTS_RUN | sed "s/__NEXT_VERSION__/$version/g; s/VERSION-REVISION/$version/g; s/VERSION/$version/g"`
local RPM_CONFLICTS_DEVEL=`echo $RPM_CONFLICTS_DEVEL | sed "s/__NEXT_VERSION__/$version/g; s/VERSION-REVISION/$version/g; s/VERSION/$version/g"`
expand_version_macros() {
echo $@ | sed "s/__NEXT_VERSION__/$version/g; s/VERSION-REVISION/$version/g; s/VERSION/$version/g"
}
local rpm_requires_run=`expand_version_macros $RPM_REQUIRES_RUN`
local rpm_requires_devel=`expand_version_macros $RPM_REQUIRES_DEVEL`
local rpm_conflicts_run=`expand_version_macros $RPM_CONFLICTS_RUN`
local rpm_conflicts_devel=`expand_version_macros $RPM_CONFLICTS_DEVEL`
local rpm_provides_run=`expand_version_macros $RPM_PROVIDES_RUN`
local rpm_provides_devel=`expand_version_macros $RPM_PROVIDES_DEVEL`
# --- create source directory tree
create_empty_dir $src_tree "Source files compilation directory"
@ -466,10 +473,12 @@ build_pkg()
-V $version \
-S $tar_archive \
-N $RPM_PROJECT \
-R "$RPM_REQUIRES_RUN" \
-X "$RPM_CONFLICTS_RUN" \
-D "$RPM_REQUIRES_DEVEL" \
-Y "$RPM_CONFLICTS_DEVEL" \
-R "$rpm_requires_run" \
-X "$rpm_conflicts_run" \
-D "$rpm_requires_devel" \
-Y "$rpm_conflicts_devel" \
--provides-run "$rpm_provides_run" \
--provides-devel "$rpm_provides_devel" \
-P $PROJECT \
-d $distribution \
> $RPM_PROJECT.$deffmt
@ -1049,23 +1058,7 @@ SCM=cvs
[ "$CVS_RSH" ] && SSH=$CVS_RSH
[ -d .git ] && SCM=git
opts='ht:p:m:N:R:D:X:Y:P:a:F:B:A:'
args=("$@")
global_args=()
while [ "$1" ]; do
[ ${#1} = 2 -a ${1:0:1} = - ] && echo $opts | grep -q "${1:1}" && {
echo $opts | grep -q "${1:1}" && shift
shift
continue
}
break
done
cmd=$1
set -- "${args[@]}"
#set -- "${@/$cmd/--}"
while [ "$1" != -- -a "$1" != "$cmd" ] ; do
while [ ${1:0:1} = - ]; do
case "$1" in
-h)
usage 0;;
@ -1101,6 +1094,14 @@ while [ "$1" != -- -a "$1" != "$cmd" ] ; do
eval RPM_CONFLICTS_DEVEL=\"$2\"
shift
;;
--provides-run)
eval RPM_PROVIDES_RUN=\"$2\"
shift
;;
--provides-devel)
eval RPM_PROVIDES_DEVEL=\"$2\"
shift
;;
-P)
eval PROJECT=\"$2\"
shift
@ -1121,9 +1122,15 @@ while [ "$1" != -- -a "$1" != "$cmd" ] ; do
eval upload_file_attrib=\"$2\"
shift
;;
*)
echo "unrecognized option $1, giving up" >&2
usage 1
;;
esac
shift
done
cmd=$1
shift
export MOD_SCRIPT_DIR=`readlink -f $MOD_SCRIPT_DIR`
@ -1140,7 +1147,10 @@ RPMS_DIR=$RPMS_BUILD_DIR/RPMS/$RPM_ARCH
# shift
[ ! "$cmd" ] && usage 1
[ ! "$cmd" ] && {
echo "missing command, giving up" >&2
usage 1
}
case $PKG_FORMAT in
rpm)