xbps-src: added XBPS_ALLOW_RESTRICTED conf option for restricted pkgs.

Such packages should set the `restricted' var to allow building a binary package.
Note that such packages do not allow redistribution of sources and binaries,
so that it's up to the user if (s)he wants to pkg it locally.
This commit is contained in:
Juan RP 2015-07-26 10:22:35 +02:00
parent e2e65a8ea4
commit 279ead0999
3 changed files with 12 additions and 1 deletions

View File

@ -7,7 +7,7 @@ unset -v only_for_archs distfiles checksum build_style nocross broken
unset -v configure_script configure_args wrksrc build_wrksrc create_wrksrc
unset -v make_cmd make_build_args make_install_args make_build_target make_install_target python_versions
unset -v patch_args disable_parallel_build keep_libtool_archives
unset -v reverts subpackages makedepends hostmakedepends depends
unset -v reverts subpackages makedepends hostmakedepends depends restricted
unset -v build_pie build_options build_options_default bootstrap repository reverts
unset -v CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LD_LIBRARY_PATH
unset -v CC CXX CPP GCC LD AR AS RANLIB NM OBJDUMP OBJCOPY STRIP READELF

View File

@ -446,6 +446,11 @@ setup_pkg() {
exit 2
fi
if [ -n "$restricted" -a -z "$XBPS_ALLOW_RESTRICTED" ]; then
msg_red "$pkgver: does not allow redistribution of sources/binaries (restricted license).\n"
exit 2
fi
export XBPS_STATEDIR="${XBPS_BUILDDIR}/.xbps-${sourcepkg}"
export XBPS_WRAPPERDIR="${XBPS_STATEDIR}/wrappers"

View File

@ -88,6 +88,12 @@ XBPS_SUCMD="sudo /bin/sh -c"
#
#XBPS_PKG_OPTIONS_foo=opt,~opt2,opt3,~opt4
# [OPTIONAL]
# Enable building package locally that are restricted legally for redistribution.
# NOTE: you can't distribute the sources or binaries for such kind of packages.
#
#XBPS_ALLOW_RESTRICTED=yes
# [OPTIONAL]
# Set the preferred chroot style. Available styles at common/chroot-style/*.sh:
#