]> git.pld-linux.org Git - packages/direnv.git/blob - direnv.spec
Update to 2.21.3
[packages/direnv.git] / direnv.spec
1 Summary:        Per-directory shell configuration tool
2 Name:           direnv
3 Version:        2.21.3
4 Release:        1
5 License:        MIT
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
10 BuildRequires:  golang
11 BuildRequires:  rpmbuild(macros) >= 1.647
12 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
13
14 # go stuff
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
18
19 %description
20 direnv augments existing shells with a new feature that can load and
21 unload environment variables depending on the current directory.
22
23 %prep
24 %setup -qc
25 mv %{name}-*/man .
26 mv %{name}-*/docs .
27 mv %{name}-*/*.md .
28 mv %{name}-*/*.txt .
29
30 # don't you love go?
31 install -d src/$(dirname %{import_path})
32 mv %{name}-* src/%{import_path}
33 cd src/%{import_path}
34
35 %build
36 export GOPATH=$(pwd)
37 cd src/%{import_path}
38 export PATH=$(pwd):$PATH
39 %gobuild -o $GOPATH/bin/%{name} %{import_path}
40
41 %install
42 rm -rf $RPM_BUILD_ROOT
43 install -d $RPM_BUILD_ROOT%{_bindir}
44 install -p bin/* $RPM_BUILD_ROOT%{_bindir}
45
46 install -d $RPM_BUILD_ROOT%{_mandir}/man1
47 install -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
48
49 %clean
50 rm -rf $RPM_BUILD_ROOT
51
52 %files
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*
This page took 0.209971 seconds and 3 git commands to generate.