CoolVLViewer.spec 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. %define major 1
  2. %define minor 32
  3. %define micro 2
  4. %define nano 8
  5. %define branch %{major}.%{minor}.%{micro}
  6. %define realver %{branch}.%{nano}
  7. %define tarball CoolVLViewer-src-%{major}%{minor}%{micro}%{nano}.tar.bz2
  8. %define siteurl http://sldev.free.fr/
  9. %define instdir /usr/games
  10. %define tune 0
  11. %{?_with_tune: %{expand: %%global tune 1}}
  12. %{?_with_clang: %{expand: %%global opt_compiler --clang}}
  13. %{?_with_gcc122: %{expand: %%global opt_compiler -v12.2}}
  14. %{?_with_gcc113: %{expand: %%global opt_compiler -v11.3}}
  15. %{?_with_gcc104: %{expand: %%global opt_compiler -v10.4}}
  16. %{?_with_gcc95: %{expand: %%global opt_compiler -v9.5}}
  17. %{?_with_gcc85: %{expand: %%global opt_compiler -v8.5}}
  18. %{?_with_gcc75: %{expand: %%global opt_compiler -v7.5}}
  19. %{?_with_gcc65: %{expand: %%global opt_compiler -v6.5}}
  20. %if %{tune}
  21. %define rel 1.tuned
  22. %else
  23. %define rel 1
  24. %endif
  25. Version: %{nano}
  26. Summary: The Cool VL Viewer for Second Life(tm) and OpenSim grids.
  27. Name: CoolVLViewer-%{branch}
  28. Release: %{rel}
  29. Source0: %{tarball}
  30. Url: %{siteurl}
  31. License: GPL2
  32. Group: Networking/Other
  33. Requires: glibc >= 2.27
  34. Requires: libstdc++6 >= 6.0.25
  35. Requires: glib2
  36. Requires: libfontconfig
  37. # CEF3 plugin dependencies ( = Ubuntu 18.04 versions):
  38. Requires: libx11 >= 1.6.4
  39. Requires: libxi >= 1.7.9
  40. Requires: nspr >= 4.18.0
  41. Requires: nss >= 3.35.0
  42. BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
  43. BuildRequires: python >= 2.6
  44. BuildRequires: cmake >= 2.8.12
  45. BuildRequires: bzip2 gzip tar
  46. BuildRequires: curl
  47. BuildRequires: glibc-devel >= 2.27
  48. BuildRequires: libstdc++6-devel
  49. BuildRequires: X11-devel libxrender-devel libxinerama-devel
  50. BuildRequires: mesa-devel mesaglu-devel
  51. %description
  52. The Cool VL Viewer for Second Life(tm) and OpenSim grids.
  53. %prep
  54. cd %{_builddir}
  55. rm -rf linden
  56. bytes=`wc --bytes %{SOURCE0} | cut -d ' ' -f 1`
  57. if [ "$bytes" == "0" ] ; then
  58. curl %{siteurl}sources/%{tarball} >%{SOURCE0}
  59. fi
  60. bzip2 -cd %{SOURCE0} | tar xf -
  61. cd linden
  62. # If you have patches you want to apply to personal builds, you may place them
  63. # inside ~/.secondlife/patches/cool_vl_viewer/ and have them automatically
  64. # applied when the build is done --with tune. Note that the patches must have
  65. # been produced with: diff -durN linden linden-patched >your_patch_name.patch
  66. # They may then be left as plain text patches, or be gzipped, bzipped or
  67. # xzipped.
  68. # For distribution specific patches, you will have to edit manually this .spec
  69. # file and add them in the usual way ("PatchN: your_patch_N.patch" lines below
  70. # the "Source0:" line above, then "%patchN -p1" lines just just after the
  71. # "cd linden" line above.
  72. %if %{tune}
  73. if [ -d ~/.secondlife/patches/cool_vl_viewer ] ; then
  74. echo "Applying patches..."
  75. for i in ~/.secondlife/patches/cool_vl_viewer/*; do
  76. if echo $i | grep ".gz" &>/dev/null ; then
  77. gzip -cd $i | patch -p1 -s
  78. elif echo $i | grep ".bz2" &>/dev/null ; then
  79. bzip2 -cd $i | patch -p1 -s
  80. elif echo $i | grep ".xz" &>/dev/null ; then
  81. xz -cd $i | patch -p1 -s
  82. else
  83. patch -p1 -s <$i
  84. fi
  85. done
  86. find . -name "*.orig" | xargs rm -f
  87. fi
  88. %endif
  89. %build
  90. %{_builddir}/linden/linux-build.sh \
  91. %if 0%{?opt_compiler:1}
  92. %{opt_compiler} \
  93. %endif
  94. %if %{tune}
  95. --tune \
  96. %endif
  97. --ignore-warnings
  98. %install
  99. rm -rf %{buildroot}
  100. mkdir -p %{buildroot}%{instdir}/%{name}
  101. cd %{_builddir}/linden/viewer-linux-x86_64-release/newview/CoolVLViewer-x86_64-%{realver}
  102. cp -a * %{buildroot}%{instdir}/%{name}/
  103. mkdir -p %{buildroot}%{_datadir}/applications
  104. cat >%{buildroot}%{_datadir}/applications/%{name}.desktop <<EOF
  105. [Desktop Entry]
  106. Encoding=UTF-8
  107. Name=%{name}
  108. Categories=Network;X-MandrivaLinux-Internet
  109. GenericName=%{name}
  110. Icon=%{instdir}/%{name}/cvlv_icon.png
  111. Exec=%{instdir}/%{name}/cool_vl_viewer
  112. StartupNotify=false
  113. Terminal=false
  114. Type=Application
  115. EOF
  116. %clean
  117. rm -rf %{buildroot}
  118. %files
  119. %defattr(-,root,root)
  120. %{instdir}/%{name}
  121. %{_datadir}/applications/*.desktop
  122. %changelog