libutempter-1.1.6-r2.ebuild 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit user multilib flag-o-matic
  5. DESCRIPTION="Library that allows non-privileged apps to write utmp (login) info, which need root access"
  6. HOMEPAGE="http://altlinux.org/index.php?module=sisyphus&package=libutempter"
  7. SRC_URI="ftp://ftp.altlinux.org/pub/people/ldv/${PN}/${P}.tar.bz2"
  8. LICENSE="LGPL-2.1"
  9. SLOT="0"
  10. KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
  11. IUSE="static-libs elibc_FreeBSD"
  12. RDEPEND="!sys-apps/utempter"
  13. pkg_setup() {
  14. enewgroup utmp 406
  15. }
  16. src_prepare() {
  17. local args=(
  18. -e "/^libdir /s:/usr/lib:${EPREFIX}/usr/$(get_libdir):"
  19. -e '/^libexecdir /s:=.*:= $(libdir)/misc:'
  20. -e '/^CFLAGS = $(RPM_OPT_FLAGS)/d'
  21. -e 's:,-stats::'
  22. -e "/^includedir /s:/usr/include:${EPREFIX}/usr/include:"
  23. -e "/^mandir /s:=.*:= ${EPREFIX}/usr/share/man:"
  24. )
  25. use static-libs || args+=(
  26. -e '/^STATICLIB/d'
  27. -e '/INSTALL.*STATICLIB/d'
  28. )
  29. sed -i "${args[@]}" Makefile || die
  30. }
  31. src_configure() {
  32. use elibc_FreeBSD && append-libs -lutil
  33. tc-export AR CC
  34. }
  35. src_compile() {
  36. emake LDLIBS="${LIBS}"
  37. }
  38. src_install() {
  39. default
  40. if ! use prefix ; then
  41. fowners root:utmp /usr/$(get_libdir)/misc/utempter/utempter
  42. fperms 2755 /usr/$(get_libdir)/misc/utempter/utempter
  43. fi
  44. dodir /usr/sbin
  45. dosym ../$(get_libdir)/misc/utempter/utempter /usr/sbin/utempter
  46. }
  47. pkg_postinst() {
  48. if [ -f "${EROOT}/var/log/wtmp" ] ; then
  49. chown root:utmp "${EROOT}/var/log/wtmp"
  50. chmod 664 "${EROOT}/var/log/wtmp"
  51. fi
  52. if [ -f "${EROOT}/var/run/utmp" ] ; then
  53. chown root:utmp "${EROOT}/var/run/utmp"
  54. chmod 664 "${EROOT}/var/run/utmp"
  55. fi
  56. }