golang-vl.spec 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. # build ids are not currently generated:
  2. # https://code.google.com/p/go/issues/detail?id=5238
  3. #
  4. # also, debuginfo extraction currently fails with
  5. # "Failed to write file: invalid section alignment"
  6. %global debug_package %{nil}
  7. # we are shipping the full contents of src in the data subpackage, which
  8. # contains binary-like things (ELF data for tests, etc)
  9. %global _binaries_in_noarch_packages_terminate_build 0
  10. # Do not check any files in doc or src for requires
  11. %global __requires_exclude_from ^(%{_datadir}|%{_libdir})/%{name}/(doc|src)/.*$
  12. # Don't alter timestamps of especially the .a files (or else go will rebuild later)
  13. # Actually, don't strip at all since we are not even building debug packages and this corrupts the dwarf testdata
  14. %global __strip /bin/true
  15. # rpmbuild magic to keep from having meta dependency on libc.so.6
  16. %define _use_internal_dependency_generator 0
  17. %define __find_requires %{nil}
  18. %global debug_package %{nil}
  19. %global __spec_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot \
  20. /usr/lib/rpm/brp-compress
  21. Name: golang
  22. Version: 1.2
  23. Release: 1%{?_dist_release}
  24. Summary: The Go Programming Language
  25. License: BSD
  26. URL: http://golang.org/
  27. Source0: https://go.googlecode.com/files/go%{version}.src.tar.gz
  28. # 'hostname' command
  29. BuildRequires: net-tools
  30. # We strip the meta dependency, but go does require glibc.
  31. # This is an odd issue, still looking for a better fix.
  32. Requires: glibc
  33. Patch0: golang-1.2-verbose-build.patch
  34. # https://bugzilla.redhat.com/show_bug.cgi?id=1038683
  35. Patch2: golang-1.2-remove-ECC-p224.patch
  36. # disable flaky test for now
  37. # http://code.google.com/p/go/issues/detail?id=6522
  38. Patch3: ./golang-1.2-skipCpuProfileTest.patch
  39. ExclusiveArch: %{ix86} x86_64
  40. Source100: golang-gdbinit
  41. Source101: golang-prelink.conf
  42. %description
  43. %{summary}.
  44. # Workaround old RPM bug of symlink-replaced-with-dir failure
  45. %pretrans -p <lua>
  46. for _,d in pairs({"api", "doc", "include", "lib", "src"}) do
  47. path = "%{_libdir}/%{name}/" .. d
  48. if posix.stat(path, "type") == "link" then
  49. os.remove(path)
  50. posix.mkdir(path)
  51. end
  52. end
  53. %prep
  54. %setup -q -n go
  55. # increase verbosity of build
  56. %patch0 -p1
  57. # remove the P224 curve
  58. %patch2 -p1
  59. # skip flaky test
  60. %patch3 -p1
  61. # create a [dirty] gcc wrapper to allow us to build with our own flags
  62. # (dirty because it is spoofing 'gcc' since CC value is stored in the go tool)
  63. # TODO: remove this and just set CFLAGS/LDFLAGS once upstream supports it
  64. # https://code.google.com/p/go/issues/detail?id=6882
  65. mkdir -p zz
  66. echo -e "#!/bin/sh\n/usr/bin/gcc $RPM_OPT_FLAGS $RPM_LD_FLAGS \"\$@\"" > ./zz/gcc
  67. chmod +x ./zz/gcc
  68. %build
  69. # set up final install location
  70. export GOROOT_FINAL=%{_libdir}/%{name}
  71. # TODO use the system linker to get the system link flags and build-id
  72. # when https://code.google.com/p/go/issues/detail?id=5221 is solved
  73. #export GO_LDFLAGS="-linkmode external -extldflags $RPM_LD_FLAGS"
  74. # build
  75. cd src
  76. # use our gcc wrapper
  77. PATH="$(pwd -P)/../zz:$PATH" CC="gcc" ./make.bash
  78. cd ..
  79. %check
  80. export GOROOT=$(pwd -P)
  81. export PATH="$PATH":"$GOROOT"/bin
  82. cd src
  83. # not using our 'gcc' since the CFLAGS fails crash_cgo_test.go due to unused variables
  84. # https://code.google.com/p/go/issues/detail?id=6883
  85. ./run.bash --no-rebuild
  86. cd ..
  87. %install
  88. rm -rf $RPM_BUILD_ROOT
  89. # create the top level directories
  90. mkdir -p $RPM_BUILD_ROOT%{_bindir}
  91. mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}
  92. # install everything into libdir (until symlink problems are fixed)
  93. # https://code.google.com/p/go/issues/detail?id=5830
  94. cp -av api bin doc favicon.ico include lib pkg robots.txt src \
  95. $RPM_BUILD_ROOT%{_libdir}/%{name}
  96. # remove the unnecessary zoneinfo file (Go will always use the system one first)
  97. rm -rfv $RPM_BUILD_ROOT%{_libdir}/%{name}/lib/time
  98. # remove the doc Makefile
  99. rm -rfv $RPM_BUILD_ROOT%{_libdir}/%{name}/doc/Makefile
  100. # put binaries to bindir
  101. pushd $RPM_BUILD_ROOT%{_bindir}
  102. for z in $RPM_BUILD_ROOT%{_libdir}/%{name}/bin/*
  103. do mv $RPM_BUILD_ROOT%{_libdir}/%{name}/bin/$(basename $z) .
  104. done
  105. popd
  106. # misc/bash
  107. mkdir -p $RPM_BUILD_ROOT%{_datadir}/bash-completion/completions
  108. cp -av misc/bash/go $RPM_BUILD_ROOT%{_datadir}/bash-completion/completions
  109. for z in 8l 6l 5l 8g 6g 5g gofmt gccgo
  110. do ln -s go $RPM_BUILD_ROOT%{_datadir}/bash-completion/completions/$z
  111. done
  112. # misc/zsh
  113. mkdir -p $RPM_BUILD_ROOT%{_datadir}/zsh/site-functions
  114. cp -av misc/zsh/go $RPM_BUILD_ROOT%{_datadir}/zsh/site-functions
  115. # gdbinit
  116. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d
  117. cp -av %{SOURCE100} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d/golang
  118. # prelink blacklist
  119. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d
  120. cp -av %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d/golang.conf
  121. %files
  122. %doc AUTHORS CONTRIBUTORS LICENSE PATENTS VERSION
  123. # go files
  124. %{_libdir}/%{name}
  125. # binary executables
  126. %{_bindir}/go
  127. %{_bindir}/gofmt
  128. # autocomplete
  129. %{_datadir}/bash-completion
  130. %{_datadir}/zsh
  131. # gdbinit (for gdb debugging)
  132. %{_sysconfdir}/gdbinit.d
  133. # prelink blacklist
  134. %{_sysconfdir}/prelink.conf.d
  135. %changelog
  136. * Sat Feb 1 2014 IWAI, Masaharu <iwaim.sub@gmail.com> 1.2
  137. - initial build for Vine Linux
  138. - drop emacs and vim package
  139. * Thu Jan 24 2014 Vincent Batts <vbatts@redhat.com> 1.2-4
  140. - skip a flaky test that is sporadically failing on the build server
  141. * Thu Jan 16 2014 Vincent Batts <vbatts@redhat.com> 1.2-3
  142. - remove golang-godoc dependency. cyclic dependency on compiling godoc
  143. * Wed Dec 18 2013 Vincent Batts <vbatts@redhat.com> - 1.2-2
  144. - removing P224 ECC curve
  145. * Mon Dec 2 2013 Vincent Batts <vbatts@fedoraproject.org> - 1.2-1
  146. - Update to upstream 1.2 release
  147. - remove the pax tar patches
  148. * Tue Nov 26 2013 Vincent Batts <vbatts@redhat.com> - 1.1.2-8
  149. - fix the rpmspec conditional for rhel and fedora
  150. * Thu Nov 21 2013 Vincent Batts <vbatts@redhat.com> - 1.1.2-7
  151. - patch tests for testing on rawhide
  152. - let the same spec work for rhel and fedora
  153. * Wed Nov 20 2013 Vincent Batts <vbatts@redhat.com> - 1.1.2-6
  154. - don't symlink /usr/bin out to ../lib..., move the file
  155. - seperate out godoc, to accomodate the go.tools godoc
  156. * Fri Sep 20 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-5
  157. - Pull upstream patches for BZ#1010271
  158. - Add glibc requirement that got dropped because of meta dep fix
  159. * Fri Aug 30 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-4
  160. - fix the libc meta dependency (thanks to vbatts [at] redhat.com for the fix)
  161. * Tue Aug 27 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-3
  162. - Revert incorrect merged changelog
  163. * Tue Aug 27 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-2
  164. - This was reverted, just a placeholder changelog entry for bad merge
  165. * Tue Aug 20 2013 Adam Miller <maxamillion@fedoraproject.org> - 1.1.2-1
  166. - Update to latest upstream
  167. * Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-7
  168. - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
  169. * Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 1.1.1-6
  170. - Perl 5.18 rebuild
  171. * Wed Jul 10 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-5
  172. - Blacklist testdata files from prelink
  173. - Again try to fix #973842
  174. * Fri Jul 5 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-4
  175. - Move src to libdir for now (#973842) (upstream issue https://code.google.com/p/go/issues/detail?id=5830)
  176. - Eliminate noarch data package to work around RPM bug (#975909)
  177. - Try to add runtime-gdb.py to the gdb safe-path (#981356)
  178. * Wed Jun 19 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-3
  179. - Use lua for pretrans (http://fedoraproject.org/wiki/Packaging:Guidelines#The_.25pretrans_scriptlet)
  180. * Mon Jun 17 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-2
  181. - Hopefully really fix #973842
  182. - Fix update from pre-1.1.1 (#974840)
  183. * Thu Jun 13 2013 Adam Goode <adam@spicenitz.org> - 1.1.1-1
  184. - Update to 1.1.1
  185. - Fix basically useless package (#973842)
  186. * Sat May 25 2013 Dan Horák <dan[at]danny.cz> - 1.1-3
  187. - set ExclusiveArch
  188. * Fri May 24 2013 Adam Goode <adam@spicenitz.org> - 1.1-2
  189. - Fix noarch package discrepancies
  190. * Fri May 24 2013 Adam Goode <adam@spicenitz.org> - 1.1-1
  191. - Initial Fedora release.
  192. - Update to 1.1
  193. * Thu May 9 2013 Adam Goode <adam@spicenitz.org> - 1.1-0.3.rc3
  194. - Update to rc3
  195. * Thu Apr 11 2013 Adam Goode <adam@spicenitz.org> - 1.1-0.2.beta2
  196. - Update to beta2
  197. * Tue Apr 9 2013 Adam Goode <adam@spicenitz.org> - 1.1-0.1.beta1
  198. - Initial packaging.