Blob Blame History Raw
%global debug_package   %{nil}
%global import_path     code.google.com/p/go.tools
%global gopath          %{_datadir}/gocode
%global rev             17c8fe23290ad2f8aab00230300e0d0075ba659c
%global shortrev        %(r=%{rev}; echo ${r:0:12})

Name:           golang-googlecode-tools
Version:        0
Release:        0.3.hg%{shortrev}%{?dist}
Summary:        Supplementary tools and packages for Go
License:        BSD
URL:            http://%{import_path}
Source0:        https://tools.go.googlecode.com/archive/%{rev}.zip
BuildRequires:  golang

%description
%{summary}


%package -n golang-godoc
Summary:        Documentation tool for the Go programming language
%description -n golang-godoc
Godoc extracts and generates documentation for Go programs.


%package -n golang-vet
Summary:        Go programming language code vetting tool
%description -n golang-vet
Vet examines Go source code and reports suspicious constructs, such as
Printf calls whose arguments do not align with the format string. Vet
uses heuristics that do not guarantee all reports are genuine problems,
but it can find errors not caught by the compilers.


%package -n golang-cover
Summary:        Code coverage tool for the Go programming language
%description -n golang-cover
Cover is a program for analyzing the coverage profiles generated by 'go
test -coverprofile=cover.out'.


%package -n golang-gotype
Summary:        Go programming language source code analysis tool
%description -n golang-gotype
The gotype command does syntactic and semantic analysis of Go files and
packages like the front-end of a Go compiler. Errors are reported if the
analysis fails; otherwise gotype is quiet.


%package -n golang-html2article
Summary:        Tool for creating articles from HTML files
BuildRequires:   golang(code.google.com/p/go.net/html)
BuildRequires:   golang(code.google.com/p/go.net/html/atom)
%description -n golang-html2article
This program takes an HTML file and outputs a corresponding article file
in present format. See: code.google.com/p/go.tools/present


## did not include the subpackages for ./cmd/oracle and ./cmd/ssadump, as they
## do not build for go1.1.2 https://bugzilla.redhat.com/show_bug.cgi?id=1029587

%package devel
Requires:       golang
Summary:        Libraries of supplementary Go tools
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
BuildArch:      noarch
%else
ExclusiveArch:  %{ix86} x86_64 %{arm}
%endif
Provides:       golang(%{import_path}/blog) = %{version}-%{release}
Provides:       golang(%{import_path}/blog/atom) = %{version}-%{release}
Provides:       golang(%{import_path}/call) = %{version}-%{release}
Provides:       golang(%{import_path}/cmd/vet/whitelist) = %{version}-%{release}
Provides:       golang(%{import_path}/dashboard/app/build) = %{version}-%{release}
Provides:       golang(%{import_path}/dashboard/app/cache) = %{version}-%{release}
Provides:       golang(%{import_path}/dashboard/builder) = %{version}-%{release}
Provides:       golang(%{import_path}/go/exact) = %{version}-%{release}
Provides:       golang(%{import_path}/go/types) = %{version}-%{release}
Provides:       golang(%{import_path}/go/types/typemap) = %{version}-%{release}
Provides:       golang(%{import_path}/go/vcs) = %{version}-%{release}
Provides:       golang(%{import_path}/godoc) = %{version}-%{release}
Provides:       golang(%{import_path}/godoc/redirect) = %{version}-%{release}
Provides:       golang(%{import_path}/godoc/static) = %{version}-%{release}
Provides:       golang(%{import_path}/godoc/util) = %{version}-%{release}
Provides:       golang(%{import_path}/godoc/vfs) = %{version}-%{release}
Provides:       golang(%{import_path}/godoc/vfs/httpfs) = %{version}-%{release}
Provides:       golang(%{import_path}/godoc/vfs/mapfs) = %{version}-%{release}
Provides:       golang(%{import_path}/godoc/vfs/zipfs) = %{version}-%{release}
Provides:       golang(%{import_path}/importer) = %{version}-%{release}
Provides:       golang(%{import_path}/oracle) = %{version}-%{release}
Provides:       golang(%{import_path}/oracle/serial) = %{version}-%{release}
Provides:       golang(%{import_path}/playground) = %{version}-%{release}
Provides:       golang(%{import_path}/playground/socket) = %{version}-%{release}
Provides:       golang(%{import_path}/pointer) = %{version}-%{release}
Provides:       golang(%{import_path}/present) = %{version}-%{release}
Provides:       golang(%{import_path}/ssa) = %{version}-%{release}
Provides:       golang(%{import_path}/ssa/interp) = %{version}-%{release}

%description devel
%{summary}

This package contains library source intended for building other packages
which use the supplementary Go tools libraries.


%prep

%setup -n tools.go-%{shortrev}

%build
mkdir _build
pushd _build

mkdir -p src/$(dirname %{import_path})
ln -s $(dirs +1 -l) src/%{import_path}
export GOPATH=$(pwd):%{gopath}
for cmd in \
  cover \
  godoc \
  gotype \
  html2article \
  vet
do
  go build -v -a %{import_path}/cmd/$cmd
done

popd

%install
install -d %{buildroot}%{_bindir}
install -p -m 755 _build/cover %{buildroot}%{_bindir}
install -p -m 755 _build/godoc %{buildroot}%{_bindir}
install -p -m 755 _build/gotype %{buildroot}%{_bindir}
install -p -m 755 _build/html2article %{buildroot}%{_bindir}
install -p -m 755 _build/vet %{buildroot}%{_bindir}

install -d %{buildroot}/%{gopath}/src/%{import_path}
for d in \
  blog \
  call \
  cmd \
  dashboard \
  go \
  godoc \
  importer \
  oracle \
  playground \
  pointer \
  present \
  ssa
do
   cp -av $d %{buildroot}/%{gopath}/src/%{import_path}/
done

%files -n golang-godoc
%defattr(-,root,root,-)
%{_bindir}/godoc

%files -n golang-vet
%defattr(-,root,root,-)
%{_bindir}/vet

%files -n golang-cover
%defattr(-,root,root,-)
%{_bindir}/cover

%files -n golang-gotype
%defattr(-,root,root,-)
%{_bindir}/gotype

%files -n golang-html2article
%defattr(-,root,root,-)
%{_bindir}/html2article

%files devel
%defattr(-,root,root,-)
%doc AUTHORS CONTRIBUTORS LICENSE PATENTS README
%dir %attr(755,root,root) %{gopath}/src/%{import_path}
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/blog
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/blog/atom
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/call
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/cmd/cover
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/cmd/godoc
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/cmd/gotype
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/cmd/html2article
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/cmd/oracle
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/cmd/ssadump
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/cmd/vet
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/cmd/vet/whitelist
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/dashboard/app/build
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/dashboard/app/cache
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/dashboard/builder
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/go/exact
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/go/types
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/go/types/typemap
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/go/vcs
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/godoc
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/godoc/redirect
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/godoc/static
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/godoc/util
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/godoc/vfs
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/godoc/vfs/httpfs
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/godoc/vfs/mapfs
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/godoc/vfs/zipfs
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/importer
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/oracle
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/oracle/serial
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/playground
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/playground/socket
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/pointer
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/present
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/ssa
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/ssa/interp
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/cmd/cover/testdata
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/cmd/vet/testdata
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/go/types/testdata
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/importer/testdata
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/oracle/testdata/src/lib
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/oracle/testdata/src/main
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/pointer/testdata
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/ssa/interp/testdata
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/ssa/testdata
%{gopath}/src/%{import_path}/blog/*.go
%{gopath}/src/%{import_path}/blog/atom/*.go
%{gopath}/src/%{import_path}/call/*.go
%{gopath}/src/%{import_path}/cmd/cover/*.go
%{gopath}/src/%{import_path}/cmd/cover/testdata/*.go
%{gopath}/src/%{import_path}/cmd/godoc/*.bash
%{gopath}/src/%{import_path}/cmd/godoc/*.go
%{gopath}/src/%{import_path}/cmd/godoc/*.godoc-app
%{gopath}/src/%{import_path}/cmd/gotype/*.go
%{gopath}/src/%{import_path}/cmd/html2article/*.go
%{gopath}/src/%{import_path}/cmd/oracle/*.bash
%{gopath}/src/%{import_path}/cmd/oracle/*.el
%{gopath}/src/%{import_path}/cmd/oracle/*.go
%{gopath}/src/%{import_path}/cmd/oracle/*.vim
%{gopath}/src/%{import_path}/cmd/ssadump/*.go
%{gopath}/src/%{import_path}/cmd/vet/*.go
%{gopath}/src/%{import_path}/cmd/vet/testdata/*.go
%{gopath}/src/%{import_path}/cmd/vet/testdata/*.s
%{gopath}/src/%{import_path}/cmd/vet/whitelist/*.go
%{gopath}/src/%{import_path}/dashboard/README
%{gopath}/src/%{import_path}/dashboard/app/*.yaml
%{gopath}/src/%{import_path}/dashboard/app/build/*.go
%{gopath}/src/%{import_path}/dashboard/app/build/*.html
%{gopath}/src/%{import_path}/dashboard/app/build/*.txt
%{gopath}/src/%{import_path}/dashboard/app/cache/*.go
%{gopath}/src/%{import_path}/dashboard/app/static/*.gif
%{gopath}/src/%{import_path}/dashboard/builder/*.go
%{gopath}/src/%{import_path}/dashboard/builder/Makefile
%{gopath}/src/%{import_path}/go/exact/*.go
%{gopath}/src/%{import_path}/go/types/*.go
%{gopath}/src/%{import_path}/go/types/testdata/*.go
%{gopath}/src/%{import_path}/go/types/testdata/*.src
%{gopath}/src/%{import_path}/go/types/typemap/*.go
%{gopath}/src/%{import_path}/go/vcs/*.go
%{gopath}/src/%{import_path}/godoc/*.go
%{gopath}/src/%{import_path}/godoc/redirect/*.go
%{gopath}/src/%{import_path}/godoc/static/*.css
%{gopath}/src/%{import_path}/godoc/static/*.go
%{gopath}/src/%{import_path}/godoc/static/*.html
%{gopath}/src/%{import_path}/godoc/static/*.js
%{gopath}/src/%{import_path}/godoc/static/*.sh
%{gopath}/src/%{import_path}/godoc/static/*.txt
%{gopath}/src/%{import_path}/godoc/static/*.xml
%{gopath}/src/%{import_path}/godoc/util/*.go
%{gopath}/src/%{import_path}/godoc/vfs/*.go
%{gopath}/src/%{import_path}/godoc/vfs/httpfs/*.go
%{gopath}/src/%{import_path}/godoc/vfs/mapfs/*.go
%{gopath}/src/%{import_path}/godoc/vfs/zipfs/*.go
%{gopath}/src/%{import_path}/importer/*.go
%{gopath}/src/%{import_path}/importer/testdata/*.go
%{gopath}/src/%{import_path}/oracle/*.go
%{gopath}/src/%{import_path}/oracle/serial/*.go
%{gopath}/src/%{import_path}/oracle/testdata/src/lib/*.go
%{gopath}/src/%{import_path}/oracle/testdata/src/main/*.go
%{gopath}/src/%{import_path}/oracle/testdata/src/main/*.golden
%{gopath}/src/%{import_path}/playground/*.go
%{gopath}/src/%{import_path}/playground/socket/*.go
%{gopath}/src/%{import_path}/pointer/*.go
%{gopath}/src/%{import_path}/pointer/TODO
%{gopath}/src/%{import_path}/pointer/testdata/*.go
%{gopath}/src/%{import_path}/present/*.go
%{gopath}/src/%{import_path}/ssa/*.go
%{gopath}/src/%{import_path}/ssa/interp/*.go
%{gopath}/src/%{import_path}/ssa/interp/testdata/*.go
%{gopath}/src/%{import_path}/ssa/testdata/*.go

%changelog
* Tue Nov 12 2013 Vincent Batts <vbatts@redhat.com> 0-0.3.hg17c8fe23290a
- removing conflicting directory ownership

* Tue Nov 12 2013 Vincent Batts <vbatts@redhat.com> 0-0.2.hg17c8fe23290a
- adding subpackages for all available commands

* Sun Nov 10 2013 Vincent Batts <vbatts@redhat.com> 0-0.1.hg17c8fe23290a
- initial build