nfs-utils_2.3.1.bb 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. SUMMARY = "userspace utilities for kernel nfs"
  2. DESCRIPTION = "The nfs-utils package provides a daemon for the kernel \
  3. NFS server and related tools."
  4. HOMEPAGE = "http://nfs.sourceforge.net/"
  5. SECTION = "console/network"
  6. LICENSE = "MIT & GPLv2+ & BSD"
  7. LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84"
  8. # util-linux for libblkid
  9. DEPENDS = "libcap libevent util-linux sqlite3 libtirpc"
  10. RDEPENDS_${PN} = "${PN}-client bash"
  11. RRECOMMENDS_${PN} = "kernel-module-nfsd"
  12. inherit useradd
  13. USERADD_PACKAGES = "${PN}-client"
  14. USERADD_PARAM_${PN}-client = "--system --home-dir /var/lib/nfs \
  15. --shell /bin/false --user-group rpcuser"
  16. SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \
  17. file://nfsserver \
  18. file://nfscommon \
  19. file://nfs-utils.conf \
  20. file://nfs-server.service \
  21. file://nfs-mountd.service \
  22. file://nfs-statd.service \
  23. file://proc-fs-nfsd.mount \
  24. file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \
  25. file://nfs-utils-debianize-start-statd.patch \
  26. file://bugfix-adjust-statd-service-name.patch \
  27. file://nfs-utils-musl-limits.patch \
  28. "
  29. SRC_URI_append_libc-musl = " file://nfs-utils-musl-res_querydomain.patch"
  30. SRC_URI[md5sum] = "d77b182a9ee396aa6221ac2401ad7046"
  31. SRC_URI[sha256sum] = "96d06b5a86b185815760d8f04c34fdface8fa8b9949ff256ac05c3ebc08335a5"
  32. # Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will
  33. # pull in the remainder of the dependencies.
  34. INITSCRIPT_PACKAGES = "${PN} ${PN}-client"
  35. INITSCRIPT_NAME = "nfsserver"
  36. INITSCRIPT_PARAMS = "defaults"
  37. INITSCRIPT_NAME_${PN}-client = "nfscommon"
  38. INITSCRIPT_PARAMS_${PN}-client = "defaults 19 21"
  39. inherit autotools-brokensep update-rc.d systemd pkgconfig
  40. SYSTEMD_PACKAGES = "${PN} ${PN}-client"
  41. SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service"
  42. SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service"
  43. # --enable-uuid is need for cross-compiling
  44. EXTRA_OECONF = "--with-statduser=rpcuser \
  45. --enable-mountconfig \
  46. --enable-libmount-mount \
  47. --enable-uuid \
  48. --disable-gss \
  49. --disable-nfsdcltrack \
  50. --with-statdpath=/var/lib/nfs/statd \
  51. "
  52. PACKAGECONFIG ??= "tcp-wrappers \
  53. ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
  54. "
  55. PACKAGECONFIG_remove_libc-musl = "tcp-wrappers"
  56. PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
  57. PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
  58. # libdevmapper is available in meta-oe
  59. PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper"
  60. # keyutils is available in meta-security
  61. PACKAGECONFIG[nfsv4] = "--enable-nfsv4,--disable-nfsv4,keyutils"
  62. PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats"
  63. CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \
  64. ${localstatedir}/lib/nfs/rmtab \
  65. ${localstatedir}/lib/nfs/xtab \
  66. ${localstatedir}/lib/nfs/statd/state \
  67. ${sysconfdir}/nfsmount.conf"
  68. FILES_${PN}-client = "${sbindir}/*statd \
  69. ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \
  70. ${sbindir}/showmount ${sbindir}/nfsstat \
  71. ${localstatedir}/lib/nfs \
  72. ${sysconfdir}/nfs-utils.conf \
  73. ${sysconfdir}/nfsmount.conf \
  74. ${sysconfdir}/init.d/nfscommon \
  75. ${systemd_unitdir}/system/nfs-statd.service"
  76. RDEPENDS_${PN}-client = "${PN}-mount rpcbind"
  77. FILES_${PN}-mount = "${base_sbindir}/*mount.nfs*"
  78. FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat"
  79. RDEPENDS_${PN}-stats = "python3-core"
  80. FILES_${PN} += "${systemd_unitdir}"
  81. do_configure_prepend() {
  82. sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
  83. ${S}/utils/mount/Makefile.am
  84. sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
  85. ${S}/utils/osd_login/Makefile.am
  86. }
  87. # Make clean needed because the package comes with
  88. # precompiled 64-bit objects that break the build
  89. do_compile_prepend() {
  90. make clean
  91. }
  92. do_install_append () {
  93. install -d ${D}${sysconfdir}/init.d
  94. install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
  95. install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon
  96. install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir}
  97. install -m 0755 ${S}/utils/mount/nfsmount.conf ${D}${sysconfdir}
  98. install -d ${D}${systemd_unitdir}/system
  99. install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_unitdir}/system/
  100. install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_unitdir}/system/
  101. install -m 0644 ${WORKDIR}/nfs-statd.service ${D}${systemd_unitdir}/system/
  102. sed -i -e 's,@SBINDIR@,${sbindir},g' \
  103. -e 's,@SYSCONFDIR@,${sysconfdir},g' \
  104. ${D}${systemd_unitdir}/system/*.service
  105. if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
  106. install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/
  107. install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
  108. ln -sf ../proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/sysinit.target.wants/proc-fs-nfsd.mount
  109. fi
  110. # kernel code as of 3.8 hard-codes this path as a default
  111. install -d ${D}/var/lib/nfs/v4recovery
  112. # chown the directories and files
  113. chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd
  114. chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state
  115. # the following are built by CC_FOR_BUILD
  116. rm -f ${D}${sbindir}/rpcdebug
  117. rm -f ${D}${sbindir}/rpcgen
  118. rm -f ${D}${sbindir}/locktest
  119. # Make python tools use python 3
  120. sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat
  121. }