gentoo-syntax-20170225.ebuild 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit vim-plugin
  5. if [[ ${PV} == 9999* ]] ; then
  6. EGIT_REPO_URI="https://github.com/gentoo/gentoo-syntax.git"
  7. inherit git-r3
  8. else
  9. SRC_URI="https://github.com/gentoo/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
  10. KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
  11. fi
  12. DESCRIPTION="Gentoo and portage related syntax highlighting, filetype, and indent settings"
  13. HOMEPAGE="https://github.com/gentoo/gentoo-syntax"
  14. LICENSE="vim"
  15. IUSE="ignore-glep31"
  16. VIM_PLUGIN_HELPFILES="gentoo-syntax"
  17. VIM_PLUGIN_MESSAGES="filetype"
  18. src_prepare() {
  19. default
  20. if use ignore-glep31 ; then
  21. for f in ftplugin/*.vim ; do
  22. ebegin "Removing UTF-8 rules from ${f} ..."
  23. sed -i -e 's~\(setlocal fileencoding=utf-8\)~" \1~' ${f} \
  24. || die "waah! bad sed voodoo. need more goats."
  25. eend $?
  26. done
  27. fi
  28. }
  29. pkg_postinst() {
  30. vim-plugin_pkg_postinst
  31. if [[ -z ${REPLACING_VERSIONS} ]] ; then
  32. if use ignore-glep31 1>/dev/null ; then
  33. ewarn "You have chosen to disable the rules which ensure GLEP 31"
  34. ewarn "compliance. When editing ebuilds, please make sure you get"
  35. ewarn "the character set correct."
  36. else
  37. elog "Note for developers and anyone else who edits ebuilds:"
  38. elog " This release of gentoo-syntax now contains filetype rules to set"
  39. elog " fileencoding for ebuilds and ChangeLogs to utf-8 as per GLEP 31."
  40. elog " If you find this feature breaks things, please submit a bug and"
  41. elog " assign it to vim@gentoo.org. You can use the 'ignore-glep31' USE"
  42. elog " flag to remove these rules."
  43. fi
  44. fi
  45. }