-
Notifications
You must be signed in to change notification settings - Fork 13
/
s3proxy.spec
66 lines (52 loc) · 1.97 KB
/
s3proxy.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# This specfile is a bit "weird" in the sense that it's meant to be run directly
# off the git repository, not with a tarball in the RPM source dir.
# Check the build-rpm.sh and build-srpm.sh scripts to see how to use it.
# debuginfo not supported with Go
%global debug_package %{nil}
%define latestcommitstamp %(git rev-list -n1 --format=format:%ct HEAD | tail -n1)
%define releasestr %(date -u +%Y%m%dT%H%M%SZ --date=@%{latestcommitstamp}).git%(git rev-list --abbrev-commit -n1 HEAD)
%if %{?s3proxy_intree_build:%{s3proxy_intree_build}}%{!?s3proxy_intree_build:0}
%define s3proxy_src_dir $RPM_SOURCE_DIR
%else
%define s3proxy_src_dir $(readlink -m .)
%endif
Name: s3proxy
Version: 0
Release: %{releasestr}%{?dist}
Summary: HTTP proxy authenticating requests to AWS S3 buckets
Group: Applications/Internet
License: GPLv2
URL: https://github.com/abustany/s3proxy
BuildRequires: golang >= 1.1
%if %{?s3proxy_intree_build:%{s3proxy_intree_build}}%{!?s3proxy_intree_build:0}
# No need for a Source field since we're (ab)using $RPM_SOURCE_DIR
%else
Source0: s3proxy-%{releasestr}.tar.bz2
%endif
%description
S3Proxy is an HTTP proxy that can be configured to authenticate requests to AWS
S3 buckets. That allows applications to access private buckets as normal
websites, without needing to know the API keys.
%prep
%if %{?s3proxy_intree_build:%{s3proxy_intree_build}}%{!?s3proxy_intree_build:0}
%else
%setup -q -n s3proxy-%{releasestr}
%endif
%build
export GOPATH="%{s3proxy_src_dir}"
go install s3proxy
%check
export GOPATH="%{s3proxy_src_dir}"
go test s3proxy
%install
install -D -m 0755 %{s3proxy_src_dir}/bin/s3proxy $RPM_BUILD_ROOT%{_bindir}/s3proxy
install -D -m 0644 %{s3proxy_src_dir}/config.json.dist \
$RPM_BUILD_ROOT%{_sysconfdir}/s3proxy/config.json.dist
%files
%defattr(-,root,root,-)
%doc %{s3proxy_src_dir}/README.md %{s3proxy_src_dir}/LICENSE
%{_sysconfdir}/s3proxy/config.json.dist
%{_bindir}/s3proxy
%changelog
* Tue Jul 09 2013 Adrien Bustany <[email protected]> - 0
- Initial specfile