passwordsafe-1.01_beta.ebuild 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. WX_GTK_VER="3.0"
  5. inherit eutils flag-o-matic wxwidgets cmake-utils
  6. MY_PV="${PV/_beta/BETA}"
  7. DESCRIPTION="Password manager with wxGTK based frontend"
  8. HOMEPAGE="https://pwsafe.org/ https://github.com/pwsafe/pwsafe/"
  9. SRC_URI="https://github.com/pwsafe/pwsafe/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
  10. LICENSE="Artistic-2"
  11. SLOT="0"
  12. KEYWORDS="~amd64"
  13. IUSE="minimal test yubikey +xml"
  14. RDEPEND="xml? ( dev-libs/xerces-c )
  15. sys-apps/util-linux
  16. x11-libs/libXt
  17. x11-libs/libXtst
  18. x11-libs/wxGTK:${WX_GTK_VER}[X]
  19. !minimal? ( !!app-misc/pwsafe )
  20. yubikey? ( sys-auth/ykpers )"
  21. DEPEND="${RDEPEND}
  22. sys-devel/gettext
  23. test? ( dev-cpp/gtest )"
  24. S=${WORKDIR}/pwsafe-${MY_PV}
  25. pkg_pretend() {
  26. einfo "Checking for -std=c++11 support in compiler"
  27. test-flags-CXX -std=c++11 > /dev/null || die
  28. }
  29. src_prepare() {
  30. # binary name pwsafe is in use by app-misc/pwsafe, we use passwordsafe
  31. # instead. Perform required changes in linking files
  32. sed -i install/desktop/pwsafe.desktop -e "s/pwsafe/${PN}/g" || die
  33. sed -i docs/pwsafe.1 \
  34. -e 's/PWSAFE/PASSWORDSAFE/' \
  35. -e "s/^.B pwsafe/.B ${PN}/" || die
  36. use test || sed -i -e '/find_package(GTest REQUIRED)/s/^/#/' \
  37. -e '/add_subdirectory (src\/test)/s/^/#/' CMakeLists.txt || die
  38. }
  39. src_configure() {
  40. need-wxwidgets unicode
  41. local mycmakeargs=( $(usex yubikey '' '-DNO_YUBI=ON')
  42. $(usex xml '' '-DNO_XML=ON') )
  43. cmake-utils_src_configure
  44. }
  45. src_install() {
  46. pushd "${BUILD_DIR}" || die
  47. if use minimal; then
  48. newbin pwsafe ${PN}
  49. else
  50. dobin pwsafe
  51. dosym pwsafe /usr/bin/${PN}
  52. fi
  53. insinto /usr/share/locale
  54. doins -r src/ui/wxWidgets/I18N/mos/*
  55. # The upstream Makefile builds this .zip file from html source material for
  56. # use by the package's internal help system. Must prevent
  57. # Portage from applying additional compression.
  58. docompress -x /usr/share/doc/${PN}/help
  59. insinto /usr/share/doc/${PN}/help
  60. doins help/*.zip
  61. popd || die
  62. newman docs/pwsafe.1 ${PN}.1
  63. dodoc README.txt docs/{ReleaseNotes.txt,ChangeLog.txt}
  64. insinto /usr/share/pwsafe/xml
  65. doins xml/*
  66. newicon install/graphics/pwsafe.png ${PN}.png
  67. newmenu install/desktop/pwsafe.desktop ${PN}.desktop
  68. }