adjtimex-1.29-r1.ebuild 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="2"
  4. inherit eutils fixheadtails toolchain-funcs
  5. DEBIAN_PV="2"
  6. MY_P="${P/-/_}"
  7. DEBIAN_URI="mirror://debian/pool/main/${PN:0:1}/${PN}"
  8. DEBIAN_PATCH="${MY_P}-${DEBIAN_PV}.diff.gz"
  9. DEBIAN_SRC="${MY_P}.orig.tar.gz"
  10. DESCRIPTION="display or set the kernel time variables"
  11. HOMEPAGE="http://www.ibiblio.org/linsearch/lsms/adjtimex.html"
  12. SRC_URI="${DEBIAN_URI}/${DEBIAN_PATCH}
  13. ${DEBIAN_URI}/${DEBIAN_SRC}"
  14. LICENSE="GPL-2"
  15. SLOT="0"
  16. KEYWORDS="alpha amd64 ppc x86"
  17. IUSE=""
  18. DEPEND="sys-apps/sed"
  19. RDEPEND=""
  20. src_prepare() {
  21. cd "${WORKDIR}"
  22. epatch "${DISTDIR}"/${DEBIAN_PATCH}
  23. cd "${S}"
  24. for i in debian/adjtimexconfig debian/adjtimexconfig.8 ; do
  25. sed -e 's|/etc/default/adjtimex|/etc/conf.d/adjtimex|' \
  26. -i.orig ${i}
  27. sed -e 's|^/sbin/adjtimex |/usr/sbin/adjtimex |' \
  28. -i.orig ${i}
  29. done
  30. epatch "${FILESDIR}"/${PN}-1.29-r1-gentoo-utc.patch
  31. ht_fix_file debian/adjtimexconfig
  32. sed -i \
  33. -e '/CFLAGS = -Wall -t/,/endif/d' \
  34. -e '/$(CC).* -o/s|$(CFLAGS)|& $(LDFLAGS)|g' \
  35. Makefile.in || die "sed Makefile.in"
  36. }
  37. src_configure() {
  38. tc-export CC
  39. default
  40. }
  41. src_install() {
  42. dodoc README* ChangeLog
  43. doman adjtimex.8 debian/adjtimexconfig.8
  44. dosbin adjtimex debian/adjtimexconfig
  45. newinitd "${FILESDIR}"/adjtimex.init adjtimex
  46. }
  47. pkg_postinst() {
  48. einfo "Please run adjtimexconfig to create the configuration file"
  49. }