bitpim-1.0.6-r2.ebuild 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit distutils-r1 eutils fdo-mime multilib
  6. DESCRIPTION="View and manipulate data on LG VX4400/VX6000 and Sanyo Sprint mobile phones"
  7. HOMEPAGE="http://www.bitpim.org/"
  8. SRC_URI="mirror://gentoo/${P}.tar.bz2"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~x86"
  12. # this needs fixing
  13. #KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
  14. IUSE="crypt evo usb"
  15. COMMON_DEPEND="dev-python/apsw[${PYTHON_USEDEP}]
  16. dev-python/pyserial[${PYTHON_USEDEP}]
  17. dev-python/python-dsv[${PYTHON_USEDEP}]
  18. dev-python/wxpython:2.8[${PYTHON_USEDEP}]
  19. crypt? (
  20. >=dev-python/paramiko-1.7.1[${PYTHON_USEDEP}]
  21. dev-python/pycrypto[${PYTHON_USEDEP}]
  22. )
  23. usb? ( virtual/libusb:0 )"
  24. DEPEND="${COMMON_DEPEND}
  25. usb? ( dev-lang/swig )"
  26. RDEPEND="${COMMON_DEPEND}
  27. media-libs/netpbm
  28. virtual/ffmpeg"
  29. PATCHES=( "${FILESDIR}/${P}-gentoo.patch" "${FILESDIR}/${P}-ffmpeg_quality.patch" "${FILESDIR}/${P}-gcc43.patch" )
  30. src_prepare() {
  31. distutils-r1_src_prepare
  32. python_setup
  33. sed -i -e "s/^PYTHONVER=.*/PYTHONVER=\$PYTHON/" \
  34. src/native/usb/build.sh || die "sed failed"
  35. sed -i "s/\$(EXTRADEFINES)\ -O2/\$(CXXFLAGS) \$(LDFLAGS)/" \
  36. src/native/av/bmp2avi/Makefile || die "sed failed"
  37. }
  38. src_compile() {
  39. # USB stuff
  40. if use usb; then
  41. cd "${S}/src/native/usb"
  42. sh ./build.sh || die "compilation of native/usb failed"
  43. fi
  44. # strings
  45. cd "${S}/src/native/strings"
  46. distutils-r1_src_compile
  47. # bmp2avi
  48. cd "${S}/src/native/av/bmp2avi"
  49. PLATFORM=linux emake CXX="$(tc-getCXX)"
  50. }
  51. src_install() {
  52. # Install files into right place
  53. #
  54. # BitPim is a self-contained app, so jamming it into
  55. # Python's site-packages might not be worthwhile. We'll
  56. # Put it in its own home, and add the PYTHONPATH in the
  57. # wrapper executables below.
  58. local RLOC=/usr/$(get_libdir)/${P}
  59. # Main Python source
  60. insinto ${RLOC}
  61. doins src/*.py
  62. # Phone specifics
  63. insinto ${RLOC}/phones
  64. doins src/phones/*.py
  65. # Native products
  66. insinto ${RLOC}/native
  67. doins src/native/*.py
  68. insinto ${RLOC}/native/qtopiadesktop
  69. doins src/native/qtopiadesktop/*.py
  70. insinto ${RLOC}/native/outlook
  71. doins src/native/outlook/*.py
  72. insinto ${RLOC}/native/egroupware
  73. doins src/native/egroupware/*.py
  74. if use evo ; then
  75. insinto ${RLOC}/native/evolution
  76. doins src/native/evolution/*.py
  77. fi
  78. # strings
  79. cd "${S}/src/native/strings"
  80. distutils-r1_src_install
  81. cd "${S}"
  82. insinto $RLOC/native/strings
  83. doins src/native/strings/__init__.py src/native/strings/jarowpy.py
  84. # usb
  85. if use usb; then
  86. insinto ${RLOC}/native/usb
  87. doins src/native/usb/*.py
  88. doins src/native/usb/*.so
  89. fi
  90. # Helpers and resources
  91. dobin src/native/av/bmp2avi/bmp2avi
  92. insinto ${RLOC}/resources
  93. doins resources/*
  94. # Bitfling
  95. if use crypt; then
  96. FLINGDIR="${RLOC}/bitfling"
  97. insinto $FLINGDIR
  98. cd "${S}/src/bitfling"
  99. doins *.py
  100. cd "${S}"
  101. fi
  102. # Creating scripts
  103. echo '#!/bin/sh' > "${T}/bitpim"
  104. echo "exec $PYTHON ${RLOC}/bp.py \"\$@\"" >> "${T}/bitpim"
  105. dobin "${T}/bitpim"
  106. if use crypt; then
  107. echo '#!/bin/sh' > "${T}/bitfling"
  108. echo "exec $PYTHON ${RLOC}/bp.py \"\$@\" bitfling" >> "${T}/bitfling"
  109. dobin "${T}/bitfling"
  110. fi
  111. # Desktop file
  112. sed -i \
  113. -e "s|%%INSTALLBINDIR%%|/usr/bin|" \
  114. -e "s|%%INSTALLLIBDIR%%|${RLOC}|" \
  115. -e "s|Terminal=0|Terminal=true|" \
  116. -e "s|Application;Calendar;ContactManagement;Utility;|Calendar;ContactManagement;Utility;|" \
  117. packaging/bitpim.desktop || die "sed failed"
  118. domenu packaging/bitpim.desktop
  119. }
  120. pkg_postinst() {
  121. fdo-mime_desktop_database_update
  122. }
  123. pkg_postrm() {
  124. fdo-mime_desktop_database_update
  125. }