Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions LICENSES-AND-NOTICES/SPECS/data/licenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -2284,6 +2284,7 @@
"dcos-cli",
"debugedit",
"dejavu-fonts",
"direnv",
"distroless-packages",
"docker-buildx",
"docker-cli",
Expand Down
6 changes: 6 additions & 0 deletions SPECS-EXTENDED/direnv/direnv.signatures.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"Signatures": {
"direnv-2.37.1-vendor.tar.gz": "fccdc1c9f73df55c66ade6ef39ca599b1793ca2e412190bd29c78fdacea5422b",
"direnv-2.37.1.tar.gz": "4142fbb661f3218913fac08d327c415e87b3e66bd0953185294ff8f3228ead24"
}
}
58 changes: 58 additions & 0 deletions SPECS-EXTENDED/direnv/direnv.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Summary: A shell extension that manages your environment
Name: direnv
Version: 2.37.1
Release: 1%{?dist}
License: MIT
Vendor: Microsoft Corporation
Distribution: Azure Linux
URL: https://github.com/direnv/direnv
Source0: https://github.com/direnv/direnv/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: %{name}-%{version}-vendor.tar.gz
BuildRequires: golang
BuildRequires: make
%global debug_package %{nil}
%define our_gopath %{_topdir}/.gopath

%description
direnv is an extension for your shell. It augments existing shells with a new
feature that can load and unload environment variables depending on the current
directory. Before each prompt, direnv checks for the existence of a .envrc file
in the current and parent directories. If the file exists, it is loaded into a
bash sub-shell and all exported variables are then captured by direnv and made
available to the current shell.

%prep
%autosetup -p1 -n %{name}-%{version} -a1

%build
export GOPATH=%{our_gopath}
export GO111MODULE=on
# Use the local vendor cache, do not download modules.
export GOFLAGS="-buildmode=pie -trimpath -mod=vendor -modcacherw"
make build BASH_PATH=%{_bindir}/bash

%install
install -d %{buildroot}%{_bindir}
install -m 0755 -p direnv %{buildroot}%{_bindir}/direnv
install -d %{buildroot}%{_mandir}/man1
cp -p man/*.1 %{buildroot}%{_mandir}/man1
install -d %{buildroot}%{_datadir}/fish/vendor_conf.d
echo "%{_bindir}/direnv hook fish | source" > %{buildroot}%{_datadir}/fish/vendor_conf.d/direnv.fish

%check
./direnv version

%files
%license LICENSE
%doc README.md CHANGELOG.md CONTRIBUTING.md
%{_bindir}/direnv
%{_mandir}/man1/direnv.1*
%{_mandir}/man1/direnv-fetchurl.1*
%{_mandir}/man1/direnv-stdlib.1*
%{_mandir}/man1/direnv.toml.1*
%{_datadir}/fish/vendor_conf.d/direnv.fish

%changelog
* Wed Jul 15 2026 Siva Kannan <sikannan@microsoft.com> - 2.37.1-1
- Original version for Azure Linux (license: MIT).
- License verified
103 changes: 103 additions & 0 deletions SPECS-EXTENDED/direnv/generate_source_tarball.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#!/bin/bash
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

# Quit on failure
set -e

PKG_VERSION=""
SRC_TARBALL=""
OUT_FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# parameters:
#
# --srcTarball : src tarball file
# this file contains the 'initial' source code of the component
# and should be replaced with the new/modified src code
# --outFolder : folder where to copy the new tarball(s)
# --pkgVersion : package version
#
PARAMS=""
while (( "$#" )); do
case "$1" in
--srcTarball)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
SRC_TARBALL=$2
shift 2
else
echo "Error: Argument for $1 is missing" >&2
exit 1
fi
;;
--outFolder)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
OUT_FOLDER=$2
shift 2
else
echo "Error: Argument for $1 is missing" >&2
exit 1
fi
;;
--pkgVersion)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
PKG_VERSION=$2
shift 2
else
echo "Error: Argument for $1 is missing" >&2
exit 1
fi
;;
-*|--*=) # unsupported flags
echo "Error: Unsupported flag $1" >&2
exit 1
;;
*) # preserve positional arguments
PARAMS="$PARAMS $1"
shift
;;
esac
done

echo "--srcTarball -> $SRC_TARBALL"
echo "--outFolder -> $OUT_FOLDER"
echo "--pkgVersion -> $PKG_VERSION"

if [ -z "$PKG_VERSION" ]; then
echo "--pkgVersion parameter cannot be empty"
exit 1
fi

echo "-- create temp folder"
tmpdir=$(mktemp -d)
function cleanup {
echo "+++ cleanup -> remove $tmpdir"
rm -rf $tmpdir
}
trap cleanup EXIT

cp $SRC_TARBALL $tmpdir

pushd $tmpdir > /dev/null

PKG_NAME="direnv"
NAME_VER="$PKG_NAME-$PKG_VERSION"
VENDOR_TARBALL="$OUT_FOLDER/$NAME_VER-vendor.tar.gz"

echo "Unpacking source tarball..."
tar -xf $SRC_TARBALL

echo "Vendor go modules..."
cd "$NAME_VER"
go mod vendor

echo ""
echo "========================="
echo "Tar vendored tarball"
tar --sort=name \
--mtime="2021-04-26 00:00Z" \
--owner=0 --group=0 --numeric-owner \
--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \
-cf "$VENDOR_TARBALL" vendor

popd > /dev/null
echo "$PKG_NAME vendored modules are available at $VENDOR_TARBALL"
10 changes: 10 additions & 0 deletions cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2723,6 +2723,16 @@
}
}
},
{
"component": {
"type": "other",
"other": {
"name": "direnv",
"version": "2.37.1",
"downloadUrl": "https://github.com/direnv/direnv/archive/refs/tags/v2.37.1.tar.gz"
}
}
},
{
"component": {
"type": "other",
Expand Down
Loading