qingy-1.0.0-r2.ebuild 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit autotools elisp-common eutils pam systemd
  5. GENTOO_THEME_VERSION=2.1
  6. DESCRIPTION="a DirectFB getty replacement"
  7. HOMEPAGE="http://qingy.sourceforge.net/"
  8. SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2
  9. mirror://gentoo/${PN}-gentoo-theme-${GENTOO_THEME_VERSION}.tar.bz2
  10. https://dev.gentoo.org/~gienah/2big4tree/sys-apps/qingy/${P}-screensavers.patch.gz
  11. https://dev.gentoo.org/~gienah/2big4tree/sys-apps/qingy/${P}-consolekit-pam.patch.gz"
  12. LICENSE="GPL-2"
  13. SLOT="0"
  14. KEYWORDS="amd64 ppc x86"
  15. IUSE="consolekit crypt directfb emacs gpm opensslcrypt pam static X"
  16. RDEPEND=">=sys-libs/ncurses-5.7-r7:=
  17. opensslcrypt? ( dev-libs/openssl:0= )
  18. crypt? ( >=dev-libs/libgcrypt-1.2.1:0= )
  19. directfb? ( >=dev-libs/DirectFB-1.4.2[fbcon,jpeg,png,truetype] )
  20. emacs? ( virtual/emacs )
  21. pam? ( >=sys-libs/pam-0.75-r11 )
  22. X? (
  23. x11-libs/libX11:=
  24. x11-libs/libXScrnSaver:=
  25. x11-proto/scrnsaverproto
  26. )"
  27. DEPEND="${RDEPEND}
  28. >=sys-apps/sed-4.1.4-r1
  29. virtual/pkgconfig"
  30. RDEPEND="${RDEPEND}
  31. consolekit? (
  32. sys-auth/consolekit
  33. sys-apps/dbus )
  34. pam? ( sys-auth/pambase )"
  35. SITEFILE=50${PN}-gentoo.el
  36. src_prepare() {
  37. epatch "${FILESDIR}"/${P}-tinfo.patch
  38. # bug #359637 and bug #462634 - fixes from upstream
  39. epatch "${DISTDIR}"/${P}-screensavers.patch.gz
  40. # bug #372675 - fix from upstream
  41. epatch "${DISTDIR}"/${P}-consolekit-pam.patch.gz
  42. epatch_user #510738
  43. eautoreconf
  44. }
  45. src_configure() {
  46. local crypto_support="--disable-crypto"
  47. local emacs_support="--disable-emacs --without-lispdir"
  48. if use crypt && use opensslcrypt; then
  49. echo
  50. ewarn "You can have openssl or libgcrypt as a crypto library, not both."
  51. ewarn "Using libgcrypt now..."
  52. echo
  53. fi
  54. use emacs && emacs_support="--enable-emacs --with-lispdir=${SITELISP}/${PN}"
  55. use opensslcrypt && crypto_support="--enable-crypto=openssl"
  56. use crypt && crypto_support="--enable-crypto=libgcrypt"
  57. econf \
  58. --sbindir=/sbin \
  59. --disable-optimizations \
  60. $(use_enable consolekit) \
  61. $(use_enable pam) \
  62. $(use_enable static static-build) \
  63. $(use_enable gpm gpm-lock) \
  64. $(use_enable X x-support) \
  65. $(use_enable directfb DirectFB-support ) \
  66. ${crypto_support} \
  67. ${emacs_support}
  68. }
  69. src_install() {
  70. # Copy documentation manually as make install only installs info files
  71. # INSTALL is left because it contains also configuration informations
  72. dodoc AUTHORS ChangeLog INSTALL NEWS README THANKS TODO
  73. # Install the program
  74. emake DESTDIR="${D}" install
  75. # Set the settings file umask to 600, in case somebody
  76. # wants to make use of the autologin feature
  77. /bin/chmod 600 "${D}"/etc/qingy/settings
  78. # Install Gentoo theme
  79. dodir /usr/share/${PN}/themes/gentoo
  80. cp "${WORKDIR}"/gentoo/* "${D}"/usr/share/${PN}/themes/gentoo || die
  81. # Alter config file so that it uses our theme
  82. sed -i 's/theme = "default"/theme = "gentoo"/' "${D}"/etc/${PN}/settings
  83. # Install log rotation policy
  84. insinto /etc/logrotate.d
  85. newins "${FILESDIR}"/${PN}-logrotate ${PN}
  86. use emacs && elisp-site-file-install "${FILESDIR}"/${SITEFILE}
  87. rm "${D}"/etc/pam.d/qingy
  88. pamd_mimic system-local-login qingy auth account password session
  89. systemd_newunit "${FILESDIR}/${PN}_at.service" "${PN}@.service"
  90. }
  91. pkg_postinst() {
  92. einfo "In order to use qingy you must first edit your /etc/inittab"
  93. einfo "Check the documentation at ${HOMEPAGE}"
  94. einfo "for instructions on how to do that."
  95. echo
  96. einfo "Also, make sure to adjust qingy settings file (/etc/qingy/settings)"
  97. einfo "to your preferences/machine configuration..."
  98. if use crypt; then
  99. echo
  100. einfo "You will have to create a key pair using 'qingy-keygen'"
  101. echo
  102. ewarn "Note that sometimes a generated key-pair may pass the internal tests"
  103. ewarn "but fail to work properly. You will get a 'regenerate your keys'"
  104. ewarn "message. If this is your case, please remove /etc/qingy/public_key"
  105. ewarn "and /etc/qingy/private_key and run qingy-keygen again..."
  106. fi
  107. use emacs && echo && elisp-site-regen
  108. }
  109. pkg_postrm() {
  110. use emacs && elisp-site-regen
  111. }