From d0ddbae8497429789a3a8baf8b41679e262dd20d Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Thu, 20 Feb 2014 12:16:11 -0600 Subject: [PATCH 1/4] re-order some patches, remove unneeded glibc deprecated macros _BSD_SOURCE and _SVID_SOURCE --- golang-1.2-BSD-SVID-SOURCE.patch | 12 ++++++++++++ golang.spec | 29 +++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 golang-1.2-BSD-SVID-SOURCE.patch diff --git a/golang-1.2-BSD-SVID-SOURCE.patch b/golang-1.2-BSD-SVID-SOURCE.patch new file mode 100644 index 0000000..9ad1677 --- /dev/null +++ b/golang-1.2-BSD-SVID-SOURCE.patch @@ -0,0 +1,12 @@ +--- include/u.h.orig 2014-02-20 11:27:46.943079375 -0600 ++++ include/u.h 2014-02-20 11:27:54.126195603 -0600 +@@ -38,9 +38,6 @@ + # define __MAKECONTEXT_V2_SOURCE 1 + # endif + #endif +-#define _BSD_SOURCE 1 +-#define _NETBSD_SOURCE 1 /* NetBSD */ +-#define _SVID_SOURCE 1 + #if !defined(__APPLE__) && !defined(__OpenBSD__) + # define _XOPEN_SOURCE 1000 + # define _XOPEN_SOURCE_EXTENDED 1 diff --git a/golang.spec b/golang.spec index 90b56be..7c495b5 100644 --- a/golang.spec +++ b/golang.spec @@ -25,7 +25,7 @@ Name: golang Version: 1.2 -Release: 6%{?dist} +Release: 7%{?dist} Summary: The Go Programming Language License: BSD @@ -35,7 +35,11 @@ Source0: https://go.googlecode.com/files/go%{version}.src.tar.gz # this command moved places %if 0%{?fedora} >= 21 BuildRequires: /usr/bin/hostname -Patch1: golang-f21-hostname.patch +Patch210: golang-f21-hostname.patch + +# Patch211 - F21+ has glibc 2.19.90 (2.20 devel)+ which deprecates +# _BSD_SOURCE and _SVID_SOURCE +Patch211: golang-1.2-BSD-SVID-SOURCE.patch %else BuildRequires: /bin/hostname %endif @@ -55,16 +59,16 @@ Requires: glibc Patch0: golang-1.2-verbose-build.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1038683 -Patch2: golang-1.2-remove-ECC-p224.patch +Patch1: golang-1.2-remove-ECC-p224.patch # disable flaky test for now # http://code.google.com/p/go/issues/detail?id=6522 -Patch3: ./golang-1.2-skipCpuProfileTest.patch +Patch2: ./golang-1.2-skipCpuProfileTest.patch # Pull in new archive/tar upstream patch to support xattrs for # docker-0.8.1 # https://code.google.com/p/go/source/detail?r=a15f344a9efa -Patch4: golang-1.2-archive_tar-xattr.patch +Patch3: golang-1.2-archive_tar-xattr.patch # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -146,17 +150,22 @@ end cp %SOURCE400 src/pkg/archive/tar/testdata/xattrs.tar +%if 0%{?fedora} >= 21 +%patch210 -p0 +%patch211 -p0 +%endif + # increase verbosity of build %patch0 -p1 # remove the P224 curve -%patch2 -p1 +%patch1 -p1 # skip flaky test -%patch3 -p1 +%patch2 -p1 # new archive/tar implementation from upstream -%patch4 -p1 +%patch3 -p1 # create a [dirty] gcc wrapper to allow us to build with our own flags # (dirty because it is spoofing 'gcc' since CC value is stored in the go tool) @@ -309,6 +318,10 @@ cp -av %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d/golang.conf %changelog +* Thu Feb 20 2014 Adam Miller 1.2-7 +- Remove _BSD_SOURCE and _SVID_SOURCE, they are deprecated in recent + versions of glibc and aren't needed + * Wed Feb 19 2014 Adam Miller 1.2-6 - pull in upstream archive/tar implementation that supports xattr for docker 0.8.1 From 969848f0f9c81275b40dc6989c2c49fa453c0976 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Thu, 20 Feb 2014 13:02:19 -0600 Subject: [PATCH 2/4] fix patchlevel for patch200 --- golang.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index 7c495b5..3dbbcdc 100644 --- a/golang.spec +++ b/golang.spec @@ -151,7 +151,7 @@ end cp %SOURCE400 src/pkg/archive/tar/testdata/xattrs.tar %if 0%{?fedora} >= 21 -%patch210 -p0 +%patch210 -p1 %patch211 -p0 %endif From a9aa1838b73b3980384203d607a0c883ff1e88b5 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Thu, 20 Feb 2014 13:16:56 -0600 Subject: [PATCH 3/4] update hostname patch --- golang-f21-hostname.patch | 10 ++++------ golang.spec | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/golang-f21-hostname.patch b/golang-f21-hostname.patch index acc3c6c..6025ecb 100644 --- a/golang-f21-hostname.patch +++ b/golang-f21-hostname.patch @@ -1,11 +1,9 @@ -Index: go/src/pkg/os/os_test.go -=================================================================== ---- go.orig/src/pkg/os/os_test.go -+++ go/src/pkg/os/os_test.go -@@ -842,7 +842,7 @@ func run(t *testing.T, cmd []string) str - if err != nil { +--- src/pkg/os/os_test.go.orig 2014-02-20 13:14:45.543644182 -0600 ++++ src/pkg/os/os_test.go 2014-02-20 13:14:55.934813622 -0600 +@@ -854,7 +854,7 @@ t.Fatal(err) } + defer r.Close() - p, err := StartProcess("/bin/hostname", []string{"hostname"}, &ProcAttr{Files: []*File{nil, w, Stderr}}) + p, err := StartProcess("/usr/bin/hostname", []string{"hostname"}, &ProcAttr{Files: []*File{nil, w, Stderr}}) if err != nil { diff --git a/golang.spec b/golang.spec index 3dbbcdc..7c495b5 100644 --- a/golang.spec +++ b/golang.spec @@ -151,7 +151,7 @@ end cp %SOURCE400 src/pkg/archive/tar/testdata/xattrs.tar %if 0%{?fedora} >= 21 -%patch210 -p1 +%patch210 -p0 %patch211 -p0 %endif From 64f9c1459a3af3e8d31daddc9c57f443b6985771 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Thu, 20 Feb 2014 14:39:08 -0600 Subject: [PATCH 4/4] fix BSD/SVID patch, and fix up changelog entry (rpmlint was complaining about invalid date) --- golang-1.2-BSD-SVID-SOURCE.patch | 29 ++++++++++++++++++++++++----- golang.spec | 2 +- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/golang-1.2-BSD-SVID-SOURCE.patch b/golang-1.2-BSD-SVID-SOURCE.patch index 9ad1677..d65e04a 100644 --- a/golang-1.2-BSD-SVID-SOURCE.patch +++ b/golang-1.2-BSD-SVID-SOURCE.patch @@ -1,12 +1,31 @@ ---- include/u.h.orig 2014-02-20 11:27:46.943079375 -0600 -+++ include/u.h 2014-02-20 11:27:54.126195603 -0600 -@@ -38,9 +38,6 @@ +--- include/u.h.orig 2014-02-20 13:51:53.456000000 -0600 ++++ include/u.h 2014-02-20 13:55:51.072000000 -0600 +@@ -38,9 +38,12 @@ # define __MAKECONTEXT_V2_SOURCE 1 # endif #endif --#define _BSD_SOURCE 1 ++#if defined __linux__ || defined __GNU__ || defined __GLIBC__ ++#define _DEFAULT_SOURCE 1 ++#else + #define _BSD_SOURCE 1 -#define _NETBSD_SOURCE 1 /* NetBSD */ --#define _SVID_SOURCE 1 + #define _SVID_SOURCE 1 ++#endif #if !defined(__APPLE__) && !defined(__OpenBSD__) # define _XOPEN_SOURCE 1000 # define _XOPEN_SOURCE_EXTENDED 1 +--- src/lib9/utf/utfecpy.c.orig 2014-02-20 14:12:27.735000000 -0600 ++++ src/lib9/utf/utfecpy.c 2014-02-20 14:13:09.242000000 -0600 +@@ -11,7 +11,11 @@ + * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + */ +-#define _BSD_SOURCE 1 ++#if defined __linux__ || defined __GNU__ || defined __GLIBC__ ++#define _DEFAULT_SOURCE 1 ++#else ++ #define _BSD_SOURCE 1 ++#endif + #include + #include "utf.h" + #include "utfdef.h" diff --git a/golang.spec b/golang.spec index 7c495b5..5b2882c 100644 --- a/golang.spec +++ b/golang.spec @@ -329,7 +329,7 @@ cp -av %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d/golang.conf * Tue Feb 18 2014 Vincent Batts 1.2-5 - provide 'go', so users can yum install 'go' -* Thu Jan 24 2014 Vincent Batts 1.2-4 +* Fri Jan 24 2014 Vincent Batts 1.2-4 - skip a flaky test that is sporadically failing on the build server * Thu Jan 16 2014 Vincent Batts 1.2-3