84ab691
# https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12
84ab691
%global _dwz_low_mem_die_limit 0
84ab691
84ab691
# Used by automated scanning tools to run tests
84ab691
# https://bugzilla.redhat.com/show_bug.cgi?id=1358215#c8
84ab691
%global provider        github
84ab691
%global provider_tld    com
84ab691
%global project         direnv
84ab691
%global repo            direnv
84ab691
# https://github.com/direnv/direnv
84ab691
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
84ab691
%global import_path     %{provider_prefix}
84ab691
# Keep SHA in sync with tagged commits
bc9bc5a
%global commit          a49d542059b53dba71202d64a64f81e980868522
84ab691
84ab691
Name: direnv
bc9bc5a
Version: 2.12.2
bc9bc5a
Release: 1%{?dist}
84ab691
Summary: Environment variable switcher for the shell
84ab691
License: MIT
84ab691
URL: http://direnv.net/
84ab691
Source0: https://%{provider_prefix}/archive/v%{version}.tar.gz
84ab691
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
84ab691
ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
84ab691
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
84ab691
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
84ab691
84ab691
%description
84ab691
direnv is an environment switcher for the shell. It knows how to hook
84ab691
into bash, zsh, tcsh and fish shell to load or unload environment
84ab691
variables depending on the current directory. This allows
84ab691
project-specific environment variables without cluttering the
84ab691
"~/.profile" file.
84ab691
84ab691
%prep
84ab691
%setup -q
84ab691
bc9bc5a
# Used like an external library, but shipped in-project
bc9bc5a
mkdir -p gopath/src/%{import_path}
bc9bc5a
mv dotenv gopath/src/%{import_path}
bc9bc5a
84ab691
%build
bc9bc5a
export GOPATH=$(pwd)/gopath
84ab691
make %{?_smp_mflags} GO_LDFLAGS="-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')"
84ab691
84ab691
%install
84ab691
install -d -p %{buildroot}%{_bindir}
84ab691
install -p -m 0755 direnv %{buildroot}%{_bindir}
84ab691
84ab691
install -d -p %{buildroot}%{_mandir}/man1
84ab691
install -p -m 0644 man/*.1 %{buildroot}%{_mandir}/man1
84ab691
84ab691
%check
bc9bc5a
export GOPATH=$(pwd)/gopath
84ab691
make test
84ab691
84ab691
%files
84ab691
%license LICENSE.md
84ab691
%doc CHANGELOG.md README.md
84ab691
%doc %{_mandir}/man1/%{name}.1*
84ab691
%doc %{_mandir}/man1/%{name}-stdlib.1*
84ab691
%{_bindir}/direnv
84ab691
84ab691
%changelog
bc9bc5a
* Sun Sep 10 2017 Dominic Cleal <dominic@cleal.org> - 2.12.2-1
bc9bc5a
- Update to 2.12.2
bc9bc5a
e0d18b9
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.0-5
e0d18b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
e0d18b9
84ab691
* Tue Aug 30 2016 Dominic Cleal <dominic@cleal.org> - 2.9.0-4
84ab691
- Use repo macros in Source0, add comments
84ab691
- Replace URL with correct homepage
84ab691
84ab691
* Tue Aug 30 2016 Dominic Cleal <dominic@cleal.org> - 2.9.0-3
84ab691
- Add upstream commit and repo macros
84ab691
84ab691
* Tue Aug 30 2016 Dominic Cleal <dominic@cleal.org> - 2.9.0-2
84ab691
- Fix make call to use parallel flag macro
84ab691
- Fix default values of EA/BRs when macros aren't defined
84ab691
84ab691
* Wed Jul 20 2016 Dominic Cleal <dominic@cleal.org> - 2.9.0-1
84ab691
- Initial build for Fedora