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