Advertisement
barjac

Untitled

Jun 21st, 2011
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.41 KB | None | 0 0
  1. %define name get-skype
  2. %define version 2.2.0.35
  3. %define release %mkrel 13
  4. %define instdir %{_datadir}/skype
  5. %define langdir %{instdir}/lang
  6. %define avatardir %{instdir}/avatars
  7. %define sounddir %{instdir}/sounds
  8. %define icondir %{instdir}/icons
  9. %define docdir %{_datadir}/doc/skype
  10. %define dbusdir /etc/dbus-1/system.d
  11. %define md5 b60a19345ee7b3522b5fe4047150aaf8
  12. %define tmp_download_dir %{_localstatedir}/lib/%{name}
  13.  
  14. Summary: Download and Install Skype
  15. Name: %{name}
  16. Version: %{version}
  17. Release: %{release}
  18. License: Proprietary
  19. Group: Networking/Instant messaging
  20. URL: http://www.skype.com
  21. Buildarch: i586
  22. Requires: wget
  23. Requires: liblcms1
  24. Requires: libmng1
  25. Requires: libqtcore4
  26. Requires: libqtdbus4
  27. Requires: libqtnetwork4
  28. Requires: libqtgui4
  29. Requires: libqtsvg4
  30. Requires: libqtxml4
  31. Requires: libxscrnsaver1
  32. Requires: libxv1
  33. Requires: libv4l-wrappers
  34.  
  35. # The following are lists of filenames (124 in total) placed
  36. # in versioned text files to save clutter in the spec file.
  37. Source0: avatars-%{version}.txt
  38. Source1: sounds-%{version}.txt
  39. Source2: lang-%{version}.txt
  40. # skype-txt-gen is a script to generate the above txt files, it
  41. # also computes the md5sum from a downloaded version.
  42. # See notes in the script.
  43. Source3: skype-txt-gen
  44. # Manually created skype.desktop to replace invalid original in tar.bz2
  45. Source4: skype.desktop
  46.  
  47.  
  48.  
  49. %description
  50. This is an installer for Skype-%{version}.
  51.  
  52. This package does not contain any program files as the Skype license does
  53. not allow distribution. By installing this package you will download and
  54. install Skype from skype.com.
  55. You must accept the Skype EULA before using it.
  56. Please be patient, this is a 23 MB download and may take some time.
  57. Removing this package will uninstall Skype from your system.
  58.  
  59. %pre
  60.  
  61. mkdir %{tmp_download_dir}
  62. [[ -d %{tmp_download_dir} ]] || exit 1
  63. cd %{tmp_download_dir} || exit 1
  64. wget -nc "http://download.skype.com/linux/skype-%{version}.tar.bz2"
  65.  
  66. md5chk=$(md5sum skype-%{version}.tar.bz2 | cut -d' ' -f1)
  67. if [[ %{md5} != $md5chk ]]; then
  68. echo "Error - download checksum failed"
  69. rm skype-%{version}.tar.bz2
  70. cd ..
  71. rm -r %{tmp_download_dir}
  72. exit 1
  73. fi
  74.  
  75. %install
  76.  
  77. rm -rf $RPM_BUILD_ROOT
  78. install -d -m 0755 %buildroot%{_bindir}
  79. install -d -m 0755 %buildroot%{_datadir}/applications
  80. install -m 755 %{SOURCE4} %buildroot%{_datadir}/applications/
  81. install -d -m 0755 %buildroot%{instdir}
  82. touch %buildroot%{instdir}/skype
  83. install -d -m 0755 %buildroot%{dbusdir}
  84. touch %buildroot%{dbusdir}/skype.conf
  85. install -d -m 0755 %buildroot%{docdir}
  86. touch %buildroot%{docdir}/{LICENSE,README}
  87.  
  88. install -d -m 0755 %buildroot%{langdir}
  89. while read line; do
  90. touch %buildroot%{langdir}/skype_"$line"
  91. done < %{SOURCE2}
  92.  
  93. install -d -m 0755 %buildroot%{instdir}/icons
  94. install -d -m 0755 %buildroot%{_iconsdir}
  95. touch %buildroot%{_iconsdir}/skype.png
  96. for i in 16 32 48; do
  97. touch %buildroot%{_iconsdir}/SkypeBlue_${i}x${i}.png
  98. touch %buildroot%{instdir}/icons/SkypeBlue_${i}x${i}.png
  99. done
  100.  
  101. install -d -m 0755 %buildroot%{avatardir}
  102. while read line; do
  103. touch %buildroot%{avatardir}/"$line"
  104. done < %{SOURCE0}
  105.  
  106. install -d -m 0755 %buildroot%{sounddir}
  107. while read line; do
  108. touch %buildroot%{sounddir}/"$line"
  109. done < %{SOURCE1}
  110.  
  111. echo "#!/bin/bash
  112. LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so %{instdir}/skype"\
  113. > %buildroot%{_bindir}/skype && chmod +x %buildroot%{_bindir}/skype
  114.  
  115. %post
  116.  
  117. tmp_extract_dir=$(mktemp -d)
  118. if ! [[ -d $tmp_extract_dir ]]; then
  119. echo "Failed to create temporary directory"
  120. rm -r %{tmp_download_dir}
  121. exit 1
  122. fi
  123.  
  124. %define tmp_skype_dir ${tmp_extract_dir}/skype-%{version}
  125.  
  126. cd ${tmp_extract_dir}
  127. tar jxf %{tmp_download_dir}/skype-%{version}.tar.bz2
  128.  
  129. if ! [[ -d %{tmp_skype_dir} ]]; then
  130. echo "Extracted file folder missing"
  131. cd ..
  132. rm -rf ${tmp_extract_dir}
  133. rm -r %{tmp_download_dir}
  134. exit 1
  135. fi
  136.  
  137. # If any extra files are installed here then
  138. # corresponding ghost files need to be added in files
  139.  
  140. mkdir -p %{instdir}
  141.  
  142. cp -a %{tmp_skype_dir}/icons/* %{_iconsdir}
  143. cp -a %{_iconsdir}/SkypeBlue_48x48.png %{_iconsdir}/skype.png
  144. cp -af %{tmp_skype_dir}/skype.conf %{dbusdir}
  145. cp -af %{tmp_skype_dir}/LICENSE %{docdir}
  146. cp -af %{tmp_skype_dir}/README %{docdir}
  147. cp -af %{tmp_skype_dir}/skype %{instdir}
  148. mkdir -p %{instdir}/avatars
  149. cp -af %{tmp_skype_dir}/avatars %{instdir}
  150. mkdir -p %{instdir}/lang
  151. cp -af %{tmp_skype_dir}/lang %{langdir}
  152. mkdir -p %{instdir}/sounds
  153. cp -af %{tmp_skype_dir}/sounds %{sounddir}
  154. mkdir -p %{instdir}/icons
  155. cp -af %{tmp_skype_dir}/icons %{icondir}
  156. rm -r %{tmp_skype_dir}
  157. cd ..
  158. rm -r ${tmp_extract_dir}
  159. # rm -r %{tmp_download_dir}
  160.  
  161. %clean
  162.  
  163. rm -rf $RPM_BUILD_ROOT
  164.  
  165. %files
  166. %defattr(-,root,root)
  167. %ghost %doc %{docdir}
  168. %{_bindir}/skype
  169. %attr(0644, root, root) %{_datadir}/applications/skype.desktop
  170. %ghost %{_iconsdir}/skype.png
  171. %ghost %{_iconsdir}/SkypeBlue_*.png
  172. %ghost %{instdir}
  173. %ghost %{dbusdir}/skype.conf
  174.  
  175. %changelog
  176.  
  177. * Tue Jun 21 2011 Barry Jackson <zen25000@zen.co.uk> 2.2.0.35-12.mga1
  178. - Manually created skype.desktop as original fails validation.
  179.  
  180. * Fri Jun 17 2011 Barry Jackson <zen25000@zen.co.uk> 2.2.0.35-11.mga1
  181. - Update due to change of checksum at Skype. Query placed with Skype
  182. - support to find out why this happened.
  183.  
  184. * Tue Jun 14 2011 Barry Jackson <zen25000@zen.co.uk> 2.2.0.35-10.mga1
  185. - Build arch changed to i586
  186.  
  187. * Mon Jun 13 2011 Barry Jackson <zen25000@zen.co.uk> 2.2.0.35-9.mga1
  188. - Added || exit 1 in pre
  189. - Changed tmp file var names to be more descriptive.
  190. - Added skype-txt-gen script as source to create txt files and md5sum.
  191.  
  192. * Sun Jun 12 2011 Barry Jackson <zen25000@zen.co.uk> 2.2.0.35-8.mga1
  193. - Removed full stop from summary.
  194.  
  195. * Sun Jun 12 2011 Barry Jackson <zen25000@zen.co.uk> 2.2.0.35-7.mga1
  196. - Added tests for failed directory creation, exiting with cleanup.
  197. - Added note in post.
  198. - Removed resource option on launch command line as we use default.
  199.  
  200. * Sat Jun 11 2011 Barry Jackson <zen25000@zen.co.uk> 2.2.0.35-6.mga1
  201. - Added md5sum check on download and cleanup on fail.
  202. - Downloads to /var/lib/get-skype - removed after install.
  203. - Creates unique /tmp/tmp.xxxx dir for extraction of tar.
  204. - Added versioning to .txt files.
  205. - Added removal of all tmp directories after install.
  206. - Corrected URL:
  207.  
  208. * Thu Jun 9 2011 Barry Jackson <zen25000@zen.co.uk> 2.2.0.35-5.mga1
  209. - Bumped release to test update - no changes
  210.  
  211. * Thu Jun 9 2011 Barry Jackson <zen25000@zen.co.uk> 2.2.0.35-4.mga1
  212. - Moved installation to /usr/share instead of /opt
  213. - Changed group and license
  214. - Changed temporary dir
  215. - Changed to wget for d/l
  216.  
  217. * Mon Jun 6 2011 Barry Jackson <zen25000@zen.co.uk> 2.2.0.35-2.mga1
  218. - Moved download to pre to stop install if d/l fails
  219.  
  220. * Sun Jun 5 2011 Barry Jackson <zen25000@zen.co.uk> 2.2.0.35-1.mga1
  221. - Changed get-skype version to follow Skype version.
  222. - Changed URL to directly download only correct version.
  223. - A copy of the downloaded file is retained in /tmp/skype-<version> to
  224. - speed re-installation (unless you clean /tmp)
  225.  
  226. * Sat Jun 4 2011 Barry Jackson <zen25000@zen.co.uk> 0.2.mga1
  227. - Now all files are registered in rpm database.
  228. - lang, avatar and sound filenames supplied in source files.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement