libfm-extra-1.2.3.ebuild 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit autotools fdo-mime
  5. MY_PV=${PV/_/}
  6. MY_PN="libfm"
  7. MY_P="${MY_PN}-${MY_PV}"
  8. DESCRIPTION="A library for file management"
  9. HOMEPAGE="http://pcmanfm.sourceforge.net/"
  10. SRC_URI="https://dev.gentoo.org/~hwoarang/distfiles/${MY_P}.tar.xz"
  11. KEYWORDS="~alpha amd64 arm ~arm64 ~mips ppc x86 ~amd64-linux ~x86-linux"
  12. LICENSE="GPL-2"
  13. SLOT="0/4.3.0" #copy ABI_VERSION because it seems upstream change it randomly
  14. IUSE=""
  15. RDEPEND=">=dev-libs/glib-2.18:2"
  16. DEPEND="${RDEPEND}
  17. app-arch/xz-utils
  18. >=dev-util/intltool-0.40
  19. virtual/pkgconfig
  20. sys-devel/gettext
  21. !!<=x11-libs/libfm-1.2.3"
  22. S="${WORKDIR}"/${MY_P}
  23. src_prepare() {
  24. sed -ie '/^SUBDIR.*=/s#docs##' "${S}"/Makefile.am || die "sed failed"
  25. sed -ie '/^[[:space:]]*docs/d' configure.ac || die "sed failed"
  26. sed -i -e "s:-O0::" -e "/-DG_ENABLE_DEBUG/s: -g::" \
  27. configure.ac || die "sed failed"
  28. #disable unused translations. Bug #356029
  29. for trans in app-chooser ask-rename exec-file file-prop preferred-apps \
  30. progress;do
  31. echo "data/ui/"${trans}.ui >> po/POTFILES.in
  32. done
  33. #Remove -Werror for automake-1.12. Bug #421101
  34. sed -i "s:-Werror::" configure.ac || die
  35. # subslot sanity check
  36. local sub_slot=${SLOT#*/}
  37. local libfm_major_abi=$(sed -rne '/ABI_VERSION/s:.*=::p' src/Makefile.am | tr ':' '.')
  38. if [[ ${sub_slot} != ${libfm_major_abi} ]]; then
  39. eerror "Ebuild sub-slot (${sub_slot}) does not match ABI_VERSION(${libfm_major_abi})"
  40. eerror "Please update SLOT variable as follows:"
  41. eerror " SLOT=\"${SLOT%%/*}/${libfm_major_abi}\""
  42. eerror
  43. die "sub-slot sanity check failed"
  44. fi
  45. eautoreconf
  46. rm -r autom4te.cache || die
  47. }
  48. src_configure() {
  49. econf --sysconfdir="${EPREFIX}/etc" --disable-dependency-tracking \
  50. --disable-static --with-extra-only
  51. }
  52. src_install() {
  53. default
  54. find "${D}" -name '*.la' -exec rm -f '{}' +
  55. # Sometimes a directory is created instead of a symlink. No idea why...
  56. # It is wrong anyway. We expect a libfm-1.0 directory and then a libfm
  57. # symlink to it.
  58. if [[ -h ${D}/usr/include/${MY_PN} || -d ${D}/usr/include/${MY_PN} ]]; then
  59. rm -r "${D}"/usr/include/${MY_PN}
  60. fi
  61. }
  62. pkg_preinst() {
  63. # Resolve the symlink mess. Bug #439570
  64. [[ -d "${ROOT}"/usr/include/${MY_PN} ]] && \
  65. rm -rf "${ROOT}"/usr/include/${MY_PN}
  66. if [[ -d "${D}"/usr/include/${MY_PN}-1.0 ]]; then
  67. cd "${D}"/usr/include
  68. ln -s --force ${MY_PN}-1.0 ${MY_PN}
  69. fi
  70. }
  71. pkg_postinst() {
  72. fdo-mime_mime_database_update
  73. }
  74. pkg_postrm() {
  75. fdo-mime_mime_database_update
  76. }