[golang-googlecode-go-exp] Extend import paths for golang.org/x/ - related: #1148481

Jan Chaloupka jchaloup at fedoraproject.org
Mon Nov 24 11:06:14 UTC 2014


commit 6e996586031c1117b0e1acdde6f7a809f560aa13
Author: Jan Chaloupka <jchaloup at redhat.com>
Date:   Fri Nov 21 12:17:29 2014 +0100

    Extend import paths for golang.org/x/
    - related: #1148481

 golang-googlecode-go-exp.spec |   74 ++++++++++++++++++++++++++++++----------
 1 files changed, 55 insertions(+), 19 deletions(-)
---
diff --git a/golang-googlecode-go-exp.spec b/golang-googlecode-go-exp.spec
index 41a5536..ba83d85 100644
--- a/golang-googlecode-go-exp.spec
+++ b/golang-googlecode-go-exp.spec
@@ -1,17 +1,24 @@
+%global debug_package   %{nil}
+
 %global provider_prefix code
 %global provider        google
 %global provider_tld    com
 %global project         p
 %global repo            go.exp
 %global commit          bd8df7009305d6ada223ea3c95b94c0f38bfa119
-
-%global import_path     %{provider_prefix}.%{provider}.%{provider_tld}/%{project}/%{repo}
 %global shortcommit     %(c=%{commit}; echo ${c:0:12})
-%global debug_package   %{nil}
+%global import_path     %{provider_prefix}.%{provider}.%{provider_tld}/%{project}/%{repo}
+
+%global x_provider      golang
+%global x_provider_tld  org
+%global x_project       x
+%global x_repo          exp
+%global x_import_path   %{x_provider}.%{x_provider_tld}/x/%{x_repo}
+%global x_name          golang-%{x_provider}%{x_provider_tld}-%{x_repo}
 
 Name:           golang-googlecode-go-exp
 Version:        0
-Release:        0.2.hg%{shortcommit}%{?dist}
+Release:        0.3.hg%{shortcommit}%{?dist}
 Summary:        Experimental tools and packages for Go
 License:        BSD
 URL:            http://%{import_path}
@@ -30,8 +37,8 @@ BuildRequires:  golang >= 1.2.1-3
 BuildRequires:  golang(code.google.com/p/go.text/language)
 BuildRequires:  golang(code.google.com/p/go.text/collate/colltab)
 Requires:       golang >= 1.2.1-3
-BuildRequires:  golang(code.google.com/p/go.text/language)
-BuildRequires:  golang(code.google.com/p/go.text/collate/colltab)
+Requires:       golang(code.google.com/p/go.text/language)
+Requires:       golang(code.google.com/p/go.text/collate/colltab)
 Summary:        %{summary}
 Provides:       golang(%{import_path}) = %{version}-%{release}
 Provides:       golang(%{import_path}/ebnf) = %{version}-%{release}
@@ -44,6 +51,25 @@ Provides:       golang(%{import_path}/old) = %{version}-%{release}
 Provides:       golang(%{import_path}/old/netchan) = %{version}-%{release}
 Provides:       golang(%{import_path}/utf8string) = %{version}-%{release}
 
+%package -n %{x_name}-devel
+BuildRequires:  golang >= 1.2.1-3
+BuildRequires:  golang(golang.org/x/text/language)
+BuildRequires:  golang(golang.org/x/text/collate/colltab)
+Requires:       golang >= 1.2.1-3
+Requires:       golang(golang.org/x/text/language)
+Requires:       golang(golang.org/x/text/collate/colltab)
+Summary:        %{summary}
+Provides:       golang(%{x_import_path}) = %{version}-%{release}
+Provides:       golang(%{x_import_path}/ebnf) = %{version}-%{release}
+Provides:       golang(%{x_import_path}/ebnflint) = %{version}-%{release}
+Provides:       golang(%{x_import_path}/fsnotify) = %{version}-%{release}
+Provides:       golang(%{x_import_path}/inotify) = %{version}-%{release}
+Provides:       golang(%{x_import_path}/locale) = %{version}-%{release}
+Provides:       golang(%{x_import_path}/locale/search) = %{version}-%{release}
+Provides:       golang(%{x_import_path}/old) = %{version}-%{release}
+Provides:       golang(%{x_import_path}/old/netchan) = %{version}-%{release}
+Provides:       golang(%{x_import_path}/utf8string) = %{version}-%{release}
+
 # winfsnotify is for Windows only
 
 %description devel
@@ -52,6 +78,12 @@ Provides:       golang(%{import_path}/utf8string) = %{version}-%{release}
 This package contains library source intended for
 building other packages which use %{project}/%{repo}.
 
+%description -n %{x_name}-devel
+%{summary}.
+
+This package contains library source intended for
+building other packages which use %{x_project}/%{x_repo}.
+
 %prep
 %setup -q -n %{repo}-%{shortcommit}
 
@@ -59,32 +91,36 @@ building other packages which use %{project}/%{repo}.
 
 %install
 install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
+install -d -p %{buildroot}/%{gopath}/src/%{x_import_path}/
 for d in ebnf ebnflint fsnotify inotify locale old utf8string; do
         cp -pav $d %{buildroot}/%{gopath}/src/%{import_path}/
+        cp -pav $d %{buildroot}/%{gopath}/src/%{x_import_path}/
 done
 
+cd %{buildroot}/%{gopath}/src/%{x_import_path}
+# from https://groups.google.com/forum/#!topic/golang-nuts/eD8dh3T9yyA, first post
+sed -i 's/"code\.google\.com\/p\/go\./"golang\.org\/x\//g' \
+        $(find . -name '*.go')
+
 %check
 GOPATH=%{buildroot}/%{gopath}:%{gopath} go test %{import_path}/{ebnf,ebnflint,fsnotify,inotify,locale/search,old/netchan,utf8string}
 
 %files devel
 %doc LICENSE PATENTS README 
-%dir %{gopath}/src/%{import_path}
-%dir %{gopath}/src/%{import_path}/ebnf
-%dir %{gopath}/src/%{import_path}/ebnflint
-%dir %{gopath}/src/%{import_path}/fsnotify
-%dir %{gopath}/src/%{import_path}/inotify
-%dir %{gopath}/src/%{import_path}/locale
-%dir %{gopath}/src/%{import_path}/locale/search
-%dir %{gopath}/src/%{import_path}/old
-%dir %{gopath}/src/%{import_path}/old/netchan
-%dir %{gopath}/src/%{import_path}/utf8string
-%{gopath}/src/%{import_path}/*/*.go
-%{gopath}/src/%{import_path}/*/*/*.go
+%{gopath}/src/%{import_path}
+
+%files -n %{x_name}-devel
+%doc LICENSE PATENTS README 
+%{gopath}/src/%{x_import_path}
 
 %changelog
+* Fri Nov 21 2014 jchaloup <jchaloup at redhat.com> - 0-0.3.hgbd8df7009305
+- Extend import paths for golang.org/x/
+  related: #1148481
+
 * Sun Oct 26 2014 jchaloup <jchaloup at redhat.com> - 0-0.2.hgbd8df7009305
 - Choose the correct architecture
-  relates: #1148481
+  related: #1148481
 
 * Mon Sep 15 2014 Eric Paris <eparis at redhat.com - 0-0.1.hgbd8df7009305
 - Bump to upstream bd8df7009305d6ada223ea3c95b94c0f38bfa119


More information about the scm-commits mailing list