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
72d9852
%global commit          a49d542059b53dba71202d64a64f81e980868522
84ab691
84ab691
Name: direnv
72d9852
Version: 2.12.2
6a6eba0
Release: 2%{?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
72d9852
# Used like an external library, but shipped in-project
72d9852
mkdir -p gopath/src/%{import_path}
72d9852
mv dotenv gopath/src/%{import_path}
72d9852
84ab691
%build
72d9852
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
72d9852
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
6a6eba0
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.12.2-2
6a6eba0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
6a6eba0
72d9852
* Sun Sep 10 2017 Dominic Cleal <dominic@cleal.org> - 2.12.2-1
72d9852
- Update to 2.12.2
72d9852
7b840bc
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.0-7
7b840bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
7b840bc
92e9020
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.0-6
92e9020
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
92e9020
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