sobexsrv-1.0.1-r1.ebuild 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit python-single-r1 toolchain-funcs user
  6. MY_P="${P/_pre/pre}"
  7. DESCRIPTION="Scripting/Secure OBEX Server (for BlueZ Linux)"
  8. SRC_URI="http://www.mulliner.org/bluetooth/${MY_P}.tar.gz
  9. https://dev.gentoo.org/~joker/${P}-fix64.patch"
  10. HOMEPAGE="http://www.mulliner.org/bluetooth/sobexsrv.php"
  11. SLOT="0"
  12. LICENSE="GPL-2"
  13. KEYWORDS="amd64 ppc x86"
  14. IUSE="gtk"
  15. DEPEND="
  16. dev-libs/openobex
  17. net-wireless/bluez
  18. gtk? ( ${PYTHON_DEPS} )"
  19. RDEPEND="${DEPEND}
  20. gtk? (
  21. ${PYTHON_DEPS}
  22. >=dev-python/pygtk-2.2
  23. )"
  24. REQUIRED_USE="
  25. gtk? ( ${PYTHON_REQUIRED_USE} )"
  26. S="${WORKDIR}/${MY_P}"
  27. PATCHES=(
  28. "${DISTDIR}/${P}"-fix64.patch
  29. "${FILESDIR}/${P}"-openobex16.patch
  30. )
  31. pkg_setup() {
  32. use gtk && python-single-r1_pkg_setup
  33. enewgroup sobexsrv
  34. enewuser sobexsrv -1 -1 /var/spool/sobexsrv sobexsrv
  35. }
  36. src_prepare() {
  37. default
  38. sed -e 's:/usr/man/man8:/usr/share/man/man8:' \
  39. -e 's/install: all/install:/' \
  40. -i Makefile || die
  41. sed -e 's/^CFLAGS =/CFLAGS +=/' \
  42. -e 's/^CC =/CC ?=/' \
  43. -e 's/$(CC) $(CFLAGS)/$(CC) $(LDFLAGS) $(CFLAGS)/' \
  44. -i src/Makefile || die
  45. }
  46. src_compile() {
  47. tc-export CC
  48. emake -C src
  49. }
  50. src_install() {
  51. default
  52. dodoc AUTHOR CONFIG SECURITY THANKS
  53. if use gtk; then
  54. python_doscript "${D}/usr/bin/sobexsrv_handler"
  55. newdoc "${S}/scripts/test" sobexsrv_handler.sample_script
  56. else
  57. rm "${D}/usr/bin/sobexsrv_handler" || die
  58. fi
  59. newinitd "${FILESDIR}/init.d_sobexsrv" sobexsrv
  60. newconfd "${FILESDIR}/conf.d_sobexsrv" sobexsrv
  61. keepdir /var/spool/sobexsrv
  62. fowners sobexsrv:sobexsrv /var/spool/sobexsrv
  63. }
  64. pkg_postinst() {
  65. elog
  66. elog "/usr/bin/sobexsrv is *NOT* installed set-uid root by"
  67. elog "default. suid is required for the chroot option (-R)."
  68. elog
  69. elog "Execute the following commands to enable suid:"
  70. elog
  71. elog "chown root:sobexsrv /usr/bin/sobexsrv"
  72. elog "chmod 4710 /usr/bin/sobexsrv"
  73. elog
  74. }