You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

211 lines
6.0 KiB

  1. # Copyright (C) 2009-2019 OpenWrt.org
  2. #
  3. # This is free software, licensed under the GNU General Public License v2.
  4. # See /LICENSE for more information.
  5. #
  6. include $(TOPDIR)/rules.mk
  7. PKG_NAME:=nfs-kernel-server
  8. PKG_VERSION:=2.5.4
  9. PKG_RELEASE:=4
  10. PKG_HASH:=546ce4b51eeebc66e354b6cc6ca0ce509437efbdef0caaf99389534eef0e598b
  11. PKG_SOURCE_URL:=@SF/nfs
  12. PKG_SOURCE:=nfs-utils-$(PKG_VERSION).tar.xz
  13. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/nfs-utils-$(PKG_VERSION)
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/nfs-utils-$(PKG_VERSION)
  15. PKG_INSTALL:=1
  16. PKG_BUILD_PARALLEL:=1
  17. PKG_BUILD_DEPENDS:=$(PKG_NAME)/host libevent2
  18. HOST_BUILD_DEPENDS:=libtirpc/host
  19. PKG_CONFIG_DEPENDS:= \
  20. CONFIG_IPV6 \
  21. CONFIG_NFS_KERNEL_SERVER_V4
  22. include $(INCLUDE_DIR)/host-build.mk
  23. include $(INCLUDE_DIR)/package.mk
  24. define Package/nfs-kernel-server/Default
  25. SECTION:=net
  26. CATEGORY:=Network
  27. SUBMENU:=Filesystem
  28. DEPENDS:=+libwrap +libblkid +libuuid +libtirpc
  29. URL:=http://nfs.sourceforge.net/
  30. MAINTAINER:=Peter Wagner <tripolar@gmx.at>
  31. endef
  32. define Package/nfs-kernel-server
  33. $(call Package/nfs-kernel-server/Default)
  34. TITLE:=Kernel NFS server support
  35. DEPENDS+= +kmod-fs-nfsd +kmod-fs-nfs +NFS_KERNEL_SERVER_V4:kmod-fs-nfs-v4 +rpcbind +NFS_KERNEL_SERVER_V4:nfs-utils-libs +NFS_KERNEL_SERVER_V4:libkeyutils +NFS_KERNEL_SERVER_V4:libdevmapper
  36. USERID:=nfs:nfs
  37. endef
  38. define Package/nfs-kernel-server/description
  39. Kernel NFS server support
  40. endef
  41. define Package/nfs-kernel-server/config
  42. source "$(SOURCE)/Config.in"
  43. endef
  44. define Package/nfs-kernel-server-utils
  45. $(call Package/nfs-kernel-server/Default)
  46. TITLE:=NFS server utils
  47. DEPENDS:=nfs-kernel-server
  48. endef
  49. define Package/nfs-kernel-server-utils/description
  50. NFS server utils
  51. endef
  52. define Package/nfs-kernel-server/conffiles
  53. /etc/exports
  54. endef
  55. define Package/nfs-utils/Default
  56. $(call Package/nfs-kernel-server/Default)
  57. SECTION:=utils
  58. CATEGORY:=Utilities
  59. DEPENDS+= +NFS_KERNEL_SERVER_V4:libkeyutils +NFS_KERNEL_SERVER_V4:libdevmapper
  60. URL:=http://nfs.sourceforge.net/
  61. MAINTAINER:=Peter Wagner <tripolar@gmx.at>
  62. endef
  63. define Package/nfs-utils
  64. $(call Package/nfs-utils/Default)
  65. TITLE:=updated mount utility (includes nfs4)
  66. endef
  67. define Package/nfs-utils/description
  68. Updated mount.nfs command - allows mounting nfs4 volumes
  69. endef
  70. define Package/nfs-utils-libs
  71. $(call Package/nfs-utils/Default)
  72. TITLE:=libraries provided by nfs-utils
  73. endef
  74. define Package/nfs-utils-libs/description
  75. Libraries provided by nfs-utils
  76. endef
  77. TARGET_CFLAGS += -Wno-error=implicit-function-declaration \
  78. -Wno-error=strict-prototypes \
  79. -Wno-error=incompatible-pointer-types \
  80. -Wno-error=format-security \
  81. -Wno-error=undef \
  82. -Wno-error=missing-include-dirs
  83. TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
  84. -L$(STAGING_DIR)/usr/lib/libevent
  85. CONFIGURE_ARGS += \
  86. --disable-caps \
  87. --disable-gss \
  88. --disable-nfsdcld \
  89. --disable-nfsdcltrack \
  90. --enable-shared \
  91. --enable-static \
  92. --with-rpcgen=internal \
  93. $(if $(CONFIG_NFS_KERNEL_SERVER_V4),--enable,--disable)-nfsv4 \
  94. $(if $(CONFIG_NFS_KERNEL_SERVER_V4),--enable,--disable)-nfsv41
  95. ifeq ($(CONFIG_IPV6),n)
  96. CONFIGURE_ARGS += --disable-ipv6
  97. endif
  98. CONFIGURE_VARS += \
  99. libblkid_cv_is_recent=yes \
  100. ac_cv_lib_resolv___res_querydomain=yes \
  101. ac_cv_lib_bsd_daemon=no \
  102. CONFIG_SQLITE3_TRUE="\#" \
  103. CONFIG_NFSDCLD_TRUE="\#"
  104. MAKE_FLAGS += \
  105. OPT="$(TARGET_CFLAGS)" \
  106. INSTALLSUID="install -m 4755" \
  107. DESTDIR="$(PKG_INSTALL_DIR)" \
  108. RPCGEN_PATH=$(STAGING_DIR_HOSTPKG)/bin/rpcgen \
  109. RPCGEN=$(STAGING_DIR_HOSTPKG)/bin/rpcgen
  110. HOST_CFLAGS += -Dlinux \
  111. -Wno-error=missing-include-dirs
  112. HOST_CONFIGURE_ARGS += \
  113. --disable-gss \
  114. --disable-nfsv4 \
  115. --disable-nfsv41 \
  116. --without-tcp-wrappers \
  117. --with-rpcgen=internal
  118. HOST_CONFIGURE_VARS += \
  119. ac_cv_lib_event_event_dispatch=yes \
  120. ac_cv_lib_nfsidmap_nfs4_init_name_mapping=yes \
  121. ac_cv_lib_blkid_blkid_get_library_version=yes \
  122. ac_cv_header_event_h=yes \
  123. ac_cv_header_nfsidmap_h=yes \
  124. ac_cv_header_blkid_blkid_h=yes \
  125. ac_cv_lib_resolv___res_querydomain=yes \
  126. ac_cv_func_prctl=yes \
  127. GSSGLUE_CFLAGS=" " \
  128. GSSGLUE_LIBS=" " \
  129. RPCSECGSS_CFLAGS=" " \
  130. RPCSECGSS_LIBS=" " \
  131. CONFIG_SQLITE3_TRUE="\#" \
  132. CONFIG_NFSDCLD_TRUE="\#"
  133. define Host/Compile
  134. $(MAKE) -C $(HOST_BUILD_DIR)/tools/rpcgen all
  135. endef
  136. define Host/Install
  137. $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
  138. $(INSTALL_BIN) $(HOST_BUILD_DIR)/tools/rpcgen/rpcgen $(STAGING_DIR_HOSTPKG)/bin/rpcgen
  139. endef
  140. define Package/nfs-kernel-server/install
  141. $(INSTALL_DIR) $(1)/etc/init.d $(1)/usr/sbin
  142. $(INSTALL_DATA) ./files/nfsd.exports $(1)/etc/exports
  143. $(INSTALL_BIN) ./files/nfsd.init $(1)/etc/init.d/nfsd
  144. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/statd/sm-notify $(1)/usr/sbin/
  145. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/statd/statd $(1)/usr/sbin/rpc.statd
  146. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/nfsd/nfsd $(1)/usr/sbin/rpc.nfsd
  147. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/mountd/mountd $(1)/usr/sbin/rpc.mountd
  148. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/exportfs/exportfs $(1)/usr/sbin/
  149. endef
  150. define Package/nfs-kernel-server-utils/install
  151. $(INSTALL_DIR) $(1)/usr/sbin
  152. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/showmount/showmount $(1)/usr/sbin
  153. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/nfsstat/nfsstat $(1)/usr/sbin
  154. endef
  155. define Package/nfs-utils/InstallDev
  156. $(INSTALL_DIR) $(1)/usr/include
  157. $(CP) $(PKG_INSTALL_DIR)/usr/include/nfsidmap.h $(1)/usr/include/
  158. $(INSTALL_DIR) $(1)/usr/lib
  159. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfsidmap.{a,la,so*} $(1)/usr/lib/
  160. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  161. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnfsidmap.pc $(1)/usr/lib/pkgconfig/
  162. endef
  163. define Package/nfs-utils/install
  164. $(INSTALL_DIR) $(1)/sbin
  165. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/mount.nfs $(1)/sbin/
  166. (cd $(1)/sbin; ln -sf mount.nfs mount.nfs4; ln -sf mount.nfs umount.nfs; ln -sf mount.nfs umount.nfs4)
  167. endef
  168. define Package/nfs-utils-libs/install
  169. $(INSTALL_DIR) $(1)/usr/lib
  170. $(if $(CONFIG_NFS_KERNEL_SERVER_V4),$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfsidmap.so* $(1)/usr/lib/,)
  171. endef
  172. $(eval $(call HostBuild))
  173. $(eval $(call BuildPackage,nfs-utils))
  174. $(eval $(call BuildPackage,nfs-utils-libs))
  175. $(eval $(call BuildPackage,nfs-kernel-server))
  176. $(eval $(call BuildPackage,nfs-kernel-server-utils))