From 279ead0999d15fa18fe979eb6c6cb2d6735d361b Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 26 Jul 2015 10:22:35 +0200 Subject: [PATCH] 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. --- common/environment/setup/sourcepkg.sh | 2 +- common/xbps-src/shutils/common.sh | 5 +++++ etc/defaults.conf | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/common/environment/setup/sourcepkg.sh b/common/environment/setup/sourcepkg.sh index b74dd9fd074..fd70a3b0d2d 100644 --- a/common/environment/setup/sourcepkg.sh +++ b/common/environment/setup/sourcepkg.sh @@ -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 diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh index a0a60eac974..0bdf7322437 100644 --- a/common/xbps-src/shutils/common.sh +++ b/common/xbps-src/shutils/common.sh @@ -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" diff --git a/etc/defaults.conf b/etc/defaults.conf index b0ab6b10035..c0de5762050 100644 --- a/etc/defaults.conf +++ b/etc/defaults.conf @@ -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: #