forked from gofed/gofed
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgofed.spec
92 lines (82 loc) · 2.96 KB
/
gofed.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
%global _dwz_low_mem_die_limit 0
%global provider github
%global provider_tld com
%global project ingvagabund
%global repo gofed
%global commit 8933880ff3e785a6f2f98aaa3b8bb476a61034ae
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: gofed
Version: 0.0.3
Release: 0.1.git%{shortcommit}%{?dist}
Summary: Tool for development of golang devel packages
License: GPLv2+
URL: https://github.com/%{project}/%{repo}
Source0: https://github.com/%{project}/%{repo}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
ExclusiveArch: %{ix86} x86_64 %{arm}
BuildRequires: golang
Requires: python >= 2.7.5, bash, wget, rpmdevtools, rpmlint
Requires: fedpkg, koji, coreutils, rpm-build, openssh-clients, tar
Requires: python-PyGithub, bash-completion
Requires: graphviz
%description
Tool to automize packaging of golang devel source codes.
The main goal is to automatize packaging (spec file generator),
dependency discovering, testing (scratch builds), to prepare package review.
If possible, all in one command.
%prep
%setup -q -n %{repo}-%{commit}
%build
function gobuild { go build -a -ldflags "-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -v -x "$@"; }
gobuild parseGo.go
%install
# copy bash completition
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/
./gen_bash_completion.sh %{name} > %{buildroot}%{_sysconfdir}/bash_completion.d/%{name}
# copy man page
mkdir -p %{buildroot}%{_mandir}/man1
cp man/gofed-help.1 %{buildroot}/%{_mandir}/man1/gofed.1
# copy scripts
mkdir -p %{buildroot}/usr/share/%{name}
cp bitbucket2gospec.sh gen_bash_completion.sh github2gospec.sh \
googlecode2gospec.sh %{buildroot}/usr/share/%{name}/.
cp *.py %{buildroot}/usr/share/%{name}/.
cp -r modules %{buildroot}/usr/share/%{name}/.
cp parseGo %{buildroot}/usr/share/%{name}/.
# copy config
mkdir -p %{buildroot}%{_sysconfdir}/
cp config/gofed.conf %{buildroot}%{_sysconfdir}/.
# copy the tool script
cp %{name} %{buildroot}/usr/share/%{name}/.
# directory for local database
mkdir -p %{buildroot}%{_sharedstatedir}/%{name}
install -m 755 -d %{buildroot}/%{_sharedstatedir}/%{name}
install -m 755 -d %{buildroot}/usr/bin
# copy golang list and native imports
cp -r data %{buildroot}%{_sharedstatedir}/%{name}/.
ln -s /usr/share/%{name}/%{name} %{buildroot}/usr/bin/%{name}
# symlinks
cp build gcp pull push scratch-build update bbobranches %{buildroot}/usr/share/%{name}/.
%files
%doc README.md LICENSE
%config(noreplace) /etc/gofed.conf
%{_sysconfdir}/bash_completion.d/%{name}
/usr/share/%{name}
%{_mandir}/man1/gofed.1.gz
%{_sharedstatedir}/%{name}
/usr/bin/%{name}
%check
function gofed { %{buildroot}/usr/share/%{name}/%{name} "$@" --dry; }
gofed scratch-build
gofed build
gofed pull
gofed push
gofed update
gofed gcpmaster
gofed tools --git-reset
gofed tools --bbo --dry test
gofed tools --bbo --wait --dry test
gofed tools --waitbbo --dry test
gofed wizard --scratch --dry
%changelog
* Fri May 08 2015 jchaloup <jchaloup@redhat.com> - 0.0.3-0.1.git8933880
- Initial commit for Fedora