lightdm-1.18.3.ebuild 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit autotools eutils flag-o-matic pam qmake-utils readme.gentoo-r1 systemd versionator xdg-utils
  5. TRUNK_VERSION="$(get_version_component_range 1-2)"
  6. DESCRIPTION="A lightweight display manager"
  7. HOMEPAGE="https://www.freedesktop.org/wiki/Software/LightDM"
  8. SRC_URI="https://launchpad.net/${PN}/${TRUNK_VERSION}/${PV}/+download/${P}.tar.xz
  9. mirror://gentoo/introspection-20110205.m4.tar.bz2"
  10. LICENSE="GPL-3 LGPL-3"
  11. SLOT="0"
  12. KEYWORDS="amd64 arm ~arm64 ppc ppc64 x86"
  13. IUSE="audit +gtk +introspection kde qt4 qt5 +gnome"
  14. REQUIRED_USE="|| ( gtk kde )"
  15. COMMON_DEPEND="audit? ( sys-process/audit )
  16. >=dev-libs/glib-2.32.3:2
  17. dev-libs/libxml2
  18. gnome? ( sys-apps/accountsservice )
  19. virtual/pam
  20. x11-libs/libX11
  21. >=x11-libs/libxklavier-5
  22. introspection? ( >=dev-libs/gobject-introspection-1 )
  23. qt4? (
  24. dev-qt/qtcore:4
  25. dev-qt/qtdbus:4
  26. dev-qt/qtgui:4
  27. )
  28. qt5? (
  29. dev-qt/qtcore:5
  30. dev-qt/qtdbus:5
  31. dev-qt/qtgui:5
  32. )"
  33. RDEPEND="${COMMON_DEPEND}
  34. >=sys-auth/pambase-20101024-r2"
  35. DEPEND="${COMMON_DEPEND}
  36. dev-util/gtk-doc-am
  37. dev-util/intltool
  38. gnome? ( gnome-base/gnome-common )
  39. sys-devel/gettext
  40. virtual/pkgconfig"
  41. PDEPEND="gtk? ( x11-misc/lightdm-gtk-greeter )
  42. kde? ( x11-misc/lightdm-kde )"
  43. DOCS=( NEWS )
  44. RESTRICT="test"
  45. src_prepare() {
  46. xdg_environment_reset
  47. sed -i -e 's:getgroups:lightdm_&:' tests/src/libsystem.c || die #412369
  48. sed -i -e '/minimum-uid/s:500:1000:' data/users.conf || die
  49. einfo "Fixing the session-wrapper variable in lightdm.conf"
  50. sed -i -e \
  51. "/session-wrapper/s@^.*@session-wrapper=/etc/${PN}/Xsession@" \
  52. data/lightdm.conf || die "Failed to fix lightdm.conf"
  53. # use correct version of qmake. bug #566950
  54. sed -i -e "/AC_CHECK_TOOLS(MOC4/a AC_SUBST(MOC4,$(qt4_get_bindir)/moc)" configure.ac || die
  55. sed -i -e "/AC_CHECK_TOOLS(MOC5/a AC_SUBST(MOC5,$(qt5_get_bindir)/moc)" configure.ac || die
  56. default
  57. # Remove bogus Makefile statement. This needs to go upstream
  58. sed -i /"@YELP_HELP_RULES@"/d help/Makefile.am || die
  59. if has_version dev-libs/gobject-introspection; then
  60. eautoreconf
  61. else
  62. AT_M4DIR=${WORKDIR} eautoreconf
  63. fi
  64. }
  65. src_configure() {
  66. # Set default values if global vars unset
  67. local _greeter _session _user
  68. _greeter=${LIGHTDM_GREETER:=lightdm-gtk-greeter}
  69. _session=${LIGHTDM_SESSION:=gnome}
  70. _user=${LIGHTDM_USER:=root}
  71. # Let user know how lightdm is configured
  72. einfo "Gentoo configuration"
  73. einfo "Default greeter: ${_greeter}"
  74. einfo "Default session: ${_session}"
  75. einfo "Greeter user: ${_user}"
  76. use qt5 && append-cxxflags -std=c++11
  77. # also disable tests because libsystem.c does not build. Tests are
  78. # restricted so it does not matter anyway.
  79. econf \
  80. --localstatedir=/var \
  81. --disable-static \
  82. --disable-tests \
  83. $(use_enable audit libaudit) \
  84. $(use_enable introspection) \
  85. $(use_enable qt4 liblightdm-qt) \
  86. $(use_enable qt5 liblightdm-qt5) \
  87. --with-user-session=${_session} \
  88. --with-greeter-session=${_greeter} \
  89. --with-greeter-user=${_user} \
  90. --with-html-dir="${EPREFIX}"/usr/share/doc/${PF}/html
  91. }
  92. src_install() {
  93. default
  94. # Delete apparmor profiles because they only work with Ubuntu's
  95. # apparmor package. Bug #494426
  96. if [[ -d ${D}/etc/apparmor.d ]]; then
  97. rm -r "${D}/etc/apparmor.d" || die \
  98. "Failed to remove apparmor profiles"
  99. fi
  100. insinto /etc/${PN}
  101. doins data/{${PN},keys}.conf
  102. doins "${FILESDIR}"/Xsession
  103. fperms +x /etc/${PN}/Xsession
  104. # /var/lib/lightdm-data could be useful. Bug #522228
  105. dodir /var/lib/lightdm-data
  106. prune_libtool_files --all
  107. rm -rf "${ED}"/etc/init
  108. # Remove existing pam file. We will build a new one. Bug #524792
  109. rm -rf "${ED}"/etc/pam.d/${PN}{,-greeter}
  110. pamd_mimic system-local-login ${PN} auth account password session #372229
  111. pamd_mimic system-local-login ${PN}-greeter auth account password session #372229
  112. dopamd "${FILESDIR}"/${PN}-autologin #390863, #423163
  113. readme.gentoo_create_doc
  114. systemd_dounit "${FILESDIR}/${PN}.service"
  115. }