golang-vl.spec 8.4 KB

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