diff --git a/.gitignore b/.gitignore index 55ac9b7..93af28c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /yaml-1b9791953ba4027efaeb728c7355e542a203be5e.tar.gz +/yaml-d466437aa4adc35830964cffc5b5f262c63ddcb4.tar.gz diff --git a/golang-gopkg-yaml.spec b/golang-gopkg-yaml.spec index 4861d8c..7445da2 100644 --- a/golang-gopkg-yaml.spec +++ b/golang-gopkg-yaml.spec @@ -1,17 +1,28 @@ %global debug_package %{nil} -%global commit 1b9791953ba4027efaeb728c7355e542a203be5e +%global commit d466437aa4adc35830964cffc5b5f262c63ddcb4 %global shortcommit %(c=%{commit}; echo ${c:0:7}) -%global import_path gopkg.in/v1/yaml -%global import_path_sec gopkg.in/yaml.v1 +%global import_path gopkg.in/v2/yaml +%global import_path_sec gopkg.in/yaml.v2 + +%global v1_commit 1b9791953ba4027efaeb728c7355e542a203be5e +%global v1_shortcommit %(c=%{v1_commit}; echo ${c:0:7}) +%global v1_import_path gopkg.in/v1/yaml +%global v1_import_path_sec gopkg.in/yaml.v1 + Name: golang-gopkg-yaml Version: 1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Enables Go programs to comfortably encode and decode YAML values License: LGPLv3 with exceptions URL: http://%{import_path} Source0: https://github.com/go-yaml/yaml/archive/%{commit}/yaml-%{commit}.tar.gz +Source1: https://github.com/go-yaml/yaml/archive/%{v1_commit}/yaml-%{v1_commit}.tar.gz +%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 BuildArch: noarch +%else +ExclusiveArch: %{ix86} x86_64 %{arm} +%endif %description %{summary} @@ -21,12 +32,10 @@ BuildRequires: golang >= 1.2.1-3 BuildRequires: golang(gopkg.in/check.v1) Requires: golang >= 1.2.1-3 Summary: Enables Go programs to comfortably encode and decode YAML values -Provides: golang(%{import_path}) = %{version}-%{release} -Provides: golang(%{import_path_sec}) = %{version}-%{release} +Provides: golang(%{v1_import_path}) = %{version}-%{release} +Provides: golang(%{v1_import_path_sec}) = %{version}-%{release} %description devel -%{summary} - The yaml package enables Go programs to comfortably encode and decode YAML values. It was developed within Canonical as part of the juju project, and is based on a pure Go port of the well-known libyaml C library to parse and @@ -37,30 +46,69 @@ anchors, tags, etc. There are still a few missing bits, such as document merging, base-60 floats (huh?), and multi-document unmarshalling. These features are not hard to add, and will be introduced as necessary. +%package devel-v2 +BuildRequires: golang >= 1.2.1-3 +BuildRequires: golang(gopkg.in/check.v1) +Requires: golang >= 1.2.1-3 +Summary: Enables Go programs to comfortably encode and decode YAML values +Provides: golang(%{import_path}) = %{version}-%{release} +Provides: golang(%{import_path_sec}) = %{version}-%{release} + +%description devel-v2 +The yaml package enables Go programs to comfortably encode and decode YAML +values. It was developed within Canonical as part of the juju project, and +is based on a pure Go port of the well-known libyaml C library to parse and +generate YAML data quickly and reliably. + +The yaml package supports most of YAML 1.1 and 1.2, +including support for anchors, tags, map merging, etc. +Multi-document unmarshalling is not yet implemented, and base-60 floats +from YAML 1.1 are purposefully not supported since they're a poor design + and are gone in YAML 1.2. + + %prep %setup -n yaml-%{commit} -q +%setup -n yaml-%{v1_commit} -T -b 1 %build %install +install -d -p %{buildroot}/%{gopath}/src/%{v1_import_path}/ +cp -pav *.go %{buildroot}/%{gopath}/src/%{v1_import_path}/ +install -d -p %{buildroot}/%{gopath}/src/%{v1_import_path_sec}/ +cp -pav *.go %{buildroot}/%{gopath}/src/%{v1_import_path_sec}/ + +pushd ../yaml-%{commit} install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ cp -pav *.go %{buildroot}/%{gopath}/src/%{import_path}/ install -d -p %{buildroot}/%{gopath}/src/%{import_path_sec}/ cp -pav *.go %{buildroot}/%{gopath}/src/%{import_path_sec}/ +popd %check +GOPATH=%{buildroot}%{gopath}:%{gopath} go test %{v1_import_path_sec} +pushd ../yaml-%{v1_commit} GOPATH=%{buildroot}%{gopath}:%{gopath} go test %{import_path_sec} +popd %files devel %doc LICENSE LICENSE.libyaml README.md -%dir %{gopath}/src/gopkg.in %dir %{gopath}/src/gopkg.in/v1 -%dir %{gopath}/src/%{import_path} -%dir %{gopath}/src/%{import_path_sec} -%{gopath}/src/%{import_path}/*.go -%{gopath}/src/%{import_path_sec}/*.go +%{gopath}/src/%{v1_import_path} +%{gopath}/src/%{v1_import_path_sec} + +%files devel-v2 +%doc LICENSE LICENSE.libyaml README.md +%dir %{gopath}/src/gopkg.in/v2 +%{gopath}/src/%{import_path} +%{gopath}/src/%{import_path_sec} %changelog +* Wed Dec 10 2014 jchaloup - 1-5 +- Update to gopkg.in/check.v2 but still provide gopkg.in/check.v1 + related: #1141875 + * Fri Oct 10 2014 jchaloup - 1-4 - Adding go test and deps on gopkg.in/check.v1 - Adding another Provides diff --git a/sources b/sources index 2d759f6..da65a5d 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ db4790a1e1c2ce0ce068434efb4f01dc yaml-1b9791953ba4027efaeb728c7355e542a203be5e.tar.gz +2f235793d937f59e262c95f8b4b46813 yaml-d466437aa4adc35830964cffc5b5f262c63ddcb4.tar.gz