1 Summary: Per-directory shell configuration tool
6 Group: Applications/Shells
7 Source0: https://github.com/direnv/direnv/archive/v%{version}/%{name}-%{version}.tar.gz
8 # Source0-md5: afab222f7406f90726733f99c095eb0a
9 URL: https://direnv.net
11 BuildRequires: rpmbuild(macros) >= 1.647
12 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
15 %define _enable_debug_packages 0
16 %define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v %{?debug:-x} %{?**};
17 %define import_path github.com/direnv/direnv
20 direnv augments existing shells with a new feature that can load and
21 unload environment variables depending on the current directory.
31 install -d src/$(dirname %{import_path})
32 mv %{name}-* src/%{import_path}
38 export PATH=$(pwd):$PATH
39 %gobuild -o $GOPATH/bin/%{name} %{import_path}
42 rm -rf $RPM_BUILD_ROOT
43 install -d $RPM_BUILD_ROOT%{_bindir}
44 install -p bin/* $RPM_BUILD_ROOT%{_bindir}
46 install -d $RPM_BUILD_ROOT%{_mandir}/man1
47 install -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
50 rm -rf $RPM_BUILD_ROOT
53 %defattr(644,root,root,755)
54 %doc docs CHANGELOG.md README.md version.txt
55 %attr(755,root,root) %{_bindir}/direnv
56 %{_mandir}/man1/direnv-stdlib.1*
57 %{_mandir}/man1/direnv.1*
58 %{_mandir}/man1/direnv.toml.1*