slim-1.3.6-r5.ebuild 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit cmake-utils pam eutils systemd versionator
  5. DESCRIPTION="Simple Login Manager"
  6. HOMEPAGE="https://sourceforge.net/projects/slim.berlios/"
  7. SRC_URI="mirror://sourceforge/project/${PN}.berlios/${P}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="amd64 arm ~mips ppc ppc64 sparc x86 ~x86-fbsd"
  11. IUSE="branding pam consolekit"
  12. REQUIRED_USE="consolekit? ( pam )"
  13. RDEPEND="x11-libs/libXmu
  14. x11-libs/libX11
  15. x11-libs/libXpm
  16. x11-libs/libXft
  17. x11-libs/libXrandr
  18. media-libs/libpng:0=
  19. virtual/jpeg:=
  20. x11-apps/sessreg
  21. consolekit? ( sys-auth/consolekit
  22. sys-apps/dbus )
  23. pam? ( virtual/pam
  24. !x11-misc/slimlock )"
  25. DEPEND="${RDEPEND}
  26. virtual/pkgconfig
  27. x11-proto/xproto"
  28. PDEPEND="branding? ( >=x11-themes/slim-themes-1.2.3a-r3 )"
  29. src_prepare() {
  30. # Our Gentoo-specific config changes
  31. epatch "${FILESDIR}"/${P}-config.diff \
  32. "${FILESDIR}"/${PN}-1.3.5-arm.patch \
  33. "${FILESDIR}"/${P}-honour-cflags.patch \
  34. "${FILESDIR}"/${P}-libslim-cmake-fixes.patch \
  35. "${FILESDIR}"/${PN}-1.3.5-disable-ck-for-systemd.patch \
  36. "${FILESDIR}"/${P}-strip-systemd-unit-install.patch \
  37. "${FILESDIR}"/${P}-systemd-session.patch \
  38. "${FILESDIR}"/${P}-session-chooser.patch \
  39. "${FILESDIR}"/${P}-fix-slimlock-nopam-v2.patch \
  40. "${FILESDIR}"/${P}-drop-zlib.patch \
  41. "${FILESDIR}"/${P}-freetype.patch \
  42. "${FILESDIR}"/${P}-envcpy-bad-pointer-arithmetic.patch
  43. if use elibc_FreeBSD; then
  44. sed -i -e 's/"-DHAVE_SHADOW"/"-DNEEDS_BASENAME"/' CMakeLists.txt \
  45. || die
  46. fi
  47. if use branding; then
  48. sed -i -e 's/ default/ slim-gentoo-simple/' slim.conf || die
  49. fi
  50. epatch_user
  51. }
  52. src_configure() {
  53. mycmakeargs=(
  54. $(cmake-utils_use pam USE_PAM)
  55. $(cmake-utils_use consolekit USE_CONSOLEKIT)
  56. )
  57. cmake-utils_src_configure
  58. }
  59. src_install() {
  60. cmake-utils_src_install
  61. if use pam ; then
  62. pamd_mimic system-local-login slim auth account session
  63. pamd_mimic system-local-login slimlock auth
  64. fi
  65. systemd_dounit slim.service
  66. insinto /usr/share/slim
  67. newins "${FILESDIR}/Xsession-r3" Xsession
  68. insinto /etc/logrotate.d
  69. newins "${FILESDIR}/slim.logrotate" slim
  70. dodoc xinitrc.sample ChangeLog README TODO THEMES
  71. }
  72. pkg_postinst() {
  73. # massage ${REPLACING_VERSIONS} to come up with whether or not it's a new install
  74. # or if it's older than 1.3.2-r7
  75. # Note - there should only ever be zero or one version as this package isn't slotted,
  76. # so the logic doesn't worry about what happens if there's two, due to the case where
  77. # a previous emerge attempt failed in the middle of qmerge.
  78. local rv=none
  79. for rv in ${REPLACING_VERSIONS} ; do
  80. if version_is_at_least "1.3.2-r7" "${rv}" ; then
  81. rv=newer
  82. break;
  83. fi
  84. if version_is_at_least "1.0" "${rv}" ; then
  85. rv=older
  86. break;
  87. fi
  88. done
  89. if [[ ${rv} == none ]]; then
  90. elog
  91. elog "The configuration file is located at /etc/slim.conf."
  92. elog
  93. elog "If you wish ${PN} to start automatically, set DISPLAYMANAGER=\"${PN}\" "
  94. elog "in /etc/conf.d/xdm and run \"rc-update add xdm default\"."
  95. fi
  96. if [[ ${rv} != newer ]]; then
  97. elog
  98. elog "By default, ${PN} is set up to do proper X session selection, including ~/.xsession"
  99. elog "support, as well as selection between sessions available in"
  100. elog "/etc/X11/Sessions/ at login by pressing [F1]."
  101. elog
  102. elog "The XSESSION environment variable is still supported as a default"
  103. elog "if no session has been specified by the user."
  104. elog
  105. elog "If you want to use .xinitrc in the user's home directory for session"
  106. elog "management instead, see README and xinitrc.sample in"
  107. elog "/usr/share/doc/${PF} and change your login_cmd in /etc/slim.conf"
  108. elog "accordingly."
  109. elog
  110. ewarn "Please note that slim supports consolekit directly. Please do not use any "
  111. ewarn "old work-arounds (including calls to 'ck-launch-session' in xinitrc scripts)"
  112. ewarn "and enable USE=\"consolekit\" instead."
  113. ewarn
  114. fi
  115. if ! use pam; then
  116. elog "You have merged ${PN} without USE=\"pam\", this will cause ${PN} to fall back to"
  117. elog "the console when restarting your window manager. If this is not desired, then"
  118. elog "please remerge ${PN} with USE=\"pam\""
  119. elog
  120. fi
  121. }