From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id E0DA21F5AE for ; Thu, 29 Apr 2021 08:26:19 +0000 (UTC) Received: from localhost ([::1]:57608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lc202-0007SM-QG for e@80x24.org; Thu, 29 Apr 2021 04:26:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lc200-0007S3-Si for dtas-all@nongnu.org; Thu, 29 Apr 2021 04:26:16 -0400 Received: from dcvr.yhbt.net ([64.71.152.64]:40054) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lc1zy-0006jf-UK for dtas-all@nongnu.org; Thu, 29 Apr 2021 04:26:16 -0400 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 57BA61F5AE for ; Thu, 29 Apr 2021 08:26:13 +0000 (UTC) From: Eric Wong To: dtas-all@nongnu.org Subject: [PATCH] build: add "symlink-install" target Date: Thu, 29 Apr 2021 08:26:11 +0000 Message-Id: <20210429082611.16497-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=64.71.152.64; envelope-from=e@80x24.org; helo=dcvr.yhbt.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: dtas-all@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: duct tape audio suite List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dtas-all-bounces+e=80x24.org@nongnu.org Sender: "dtas-all" This is useful for users relying on system Ruby and lack permissions to install gems. --- GNUmakefile | 14 +++++++++++++- dtas.sh | 7 +++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100755 dtas.sh diff --git a/GNUmakefile b/GNUmakefile index e5914b2..084a2d8 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2020 all contributors +# Copyright (C) 2013-2021 all contributors # License: GPL-3.0+ all:: pkg = dtas @@ -74,5 +74,17 @@ $(pkgtgz): .tgz-manifest package: $(pkgtgz) $(pkggem) +# Install symlinks to ~/bin (which is hopefuly in PATH) which point to +# this source tree. +# prefix + bindir matches git.git Makefile: +prefix = $(HOME) +bindir = $(prefix)/bin +symlink-install : + mkdir -p $(bindir) + dtas=$(CURDIR)/dtas.sh && cd $(bindir) && \ + for x in $(CURDIR)/bin/*; do \ + ln -sf "$$dtas" $$(basename "$$x"); \ + done + .PHONY: all .FORCE-GIT-VERSION-FILE test $(test_units) NEWS .PHONY: check-warnings fix-perms diff --git a/dtas.sh b/dtas.sh new file mode 100755 index 0000000..d3ea5e1 --- /dev/null +++ b/dtas.sh @@ -0,0 +1,7 @@ +#!/bin/sh -e +# symlink this file to a directory in PATH to run dtas (or anything in bin/*) +# without needing perms to install globally. Used by "make symlink-install" +p=$(realpath "$0" || readlink "$0") # neither is POSIX, but common +p=$(dirname "$p") c=$(basename "$0") # both are POSIX +exec ${RUBY-ruby} -I"$p"/lib "$p"/bin/"${c%.sh}" "$@" +: this script is too short to copyright