Advertisement
Guest User

Untitled

a guest
Apr 5th, 2012
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Summary: Digital Mars D Compiler
  2. Name: dmd
  3. Version: 2.058
  4. Release: 1%{?dist}
  5. License: Proprietary
  6. Group: Applications/Programming
  7. BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
  8. URL: http://www.digitalmars.com/
  9. Source0: dmd-%{version}.src.tar.gz
  10. Source1: dmd.conf
  11. Source2: dmd.conf.x86_64
  12. Source3: dmd
  13. Source4: make_src.sh
  14. BuildRequires: make
  15. BuildRequires: gcc-c++
  16.  
  17. %description
  18. Compiler for the D Programming language
  19.  
  20. %define src_dmd $RPM_BUILD_DIR/%{name}-%{version}/dmd
  21. %define src_phobos $RPM_BUILD_DIR/%{name}-%{version}/phobos
  22. %define src_druntime $RPM_BUILD_DIR/%{name}-%{version}/druntime
  23.  
  24. %ifarch %{ix86}
  25.     %define path_libphobos %{src_phobos}/generated/linux/release/32/libphobos2.a
  26.     %define conf_source %{SOURCE1}
  27.     %define model 32
  28. %endif
  29.  
  30. %ifarch ia64 amd64 x86_64 ia32e
  31.     %define path_libphobos %{src_phobos}/generated/linux/release/64/libphobos2.a
  32.     %define conf_source %{SOURCE2}
  33.     %define model 64
  34. %endif
  35.  
  36. %define include_dmd /usr/include/d/dmd
  37. %define include_druntime $RPM_BUILD_ROOT%{include_dmd}/druntime
  38. %define include_phobos $RPM_BUILD_ROOT%{include_dmd}/phobos
  39.  
  40. %prep
  41. %setup -q
  42.  
  43. %build
  44. cd %{src_dmd}
  45. make -f posix.mak MODEL=%{model}
  46. export PATH=$PATH:%{src_dmd}
  47. cd %{src_phobos}
  48. make -f posix.mak MODEL=%{model} DRUNTIME_PATH=%{src_druntime}
  49.  
  50. %install
  51. rm -rf $RPM_BUILD_ROOT
  52. mkdir -p $RPM_BUILD_ROOT%{_bindir}
  53. cp %{src_dmd}/dmd $RPM_BUILD_ROOT%{_bindir}/
  54. cp %{src_dmd}/idgen $RPM_BUILD_ROOT%{_bindir}/
  55. cp %{src_dmd}/impcnvgen $RPM_BUILD_ROOT%{_bindir}/
  56. cp %{src_dmd}/optabgen $RPM_BUILD_ROOT%{_bindir}/
  57. mkdir -p $RPM_BUILD_ROOT%{_libdir}
  58. cp %{path_libphobos} $RPM_BUILD_ROOT%{_libdir}/
  59. mkdir -p %{include_druntime}
  60. cp -r %{src_druntime}/import %{include_druntime}/
  61. mkdir -p %{include_phobos}
  62. cp -r %{src_phobos}/etc %{include_phobos}/
  63. cp -r %{src_phobos}/std %{include_phobos}/
  64. cp %{src_phobos}/*.d %{include_phobos}/
  65. cp %{src_phobos}/*.ddoc %{include_phobos}/
  66. cp %{src_phobos}/phoboslicense.txt %{include_phobos}/
  67. mkdir -p $RPM_BUILD_ROOT/etc
  68. cp %{conf_source} $RPM_BUILD_ROOT/etc/dmd.conf
  69. mkdir -p $RPM_BUILD_ROOT/etc/bash_completion.d
  70. cp %{SOURCE3} $RPM_BUILD_ROOT/etc/bash_completion.d/dmd
  71.  
  72. %files
  73. %defattr(755,root,root,-)
  74. %{_bindir}/dmd
  75. %{_bindir}/idgen
  76. %{_bindir}/impcnvgen
  77. %{_bindir}/optabgen
  78. %defattr(-,root,root,-)
  79. %{_libdir}/libphobos2.a
  80. /usr/include/d
  81. /etc/dmd.conf
  82. /etc/bash_completion.d/dmd
  83.  
  84. %clean
  85. rm -rf $RPM_BUILD_ROOT
  86.  
  87. %changelog
  88. * Thu Apr  5 2012 - <->
  89. - new package
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement