Blob Blame History Raw
%global _dwz_low_mem_die_limit 0

# Used by automated scanning tools to run tests
%global provider        github
%global provider_tld    com
%global project         direnv
%global repo            direnv
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path     %{provider_prefix}
# Keep SHA in sync with tagged commits
%global commit          2bb2df4ca3bf3f45d1f36372c279615239e5c0f4

Name: direnv
Version: 2.9.0
Release: 4%{?dist}
Summary: Environment variable switcher for the shell
License: MIT
Source0: https://%{provider_prefix}/archive/v%{version}.tar.gz
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}

direnv is an environment switcher for the shell. It knows how to hook
into bash, zsh, tcsh and fish shell to load or unload environment
variables depending on the current directory. This allows
project-specific environment variables without cluttering the
"~/.profile" file.

%setup -q

make %{?_smp_mflags} GO_LDFLAGS="-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')"

install -d -p %{buildroot}%{_bindir}
install -p -m 0755 direnv %{buildroot}%{_bindir}

install -d -p %{buildroot}%{_mandir}/man1
install -p -m 0644 man/*.1 %{buildroot}%{_mandir}/man1

make test

%doc %{_mandir}/man1/%{name}.1*
%doc %{_mandir}/man1/%{name}-stdlib.1*

* Tue Aug 30 2016 Dominic Cleal <> - 2.9.0-4
- Use repo macros in Source0, add comments
- Replace URL with correct homepage

* Tue Aug 30 2016 Dominic Cleal <> - 2.9.0-3
- Add upstream commit and repo macros

* Tue Aug 30 2016 Dominic Cleal <> - 2.9.0-2
- Fix make call to use parallel flag macro
- Fix default values of EA/BRs when macros aren't defined

* Wed Jul 20 2016 Dominic Cleal <> - 2.9.0-1
- Initial build for Fedora