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.

210 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:=1
  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. GSSGLUE_CFLAGS=" " \
  127. GSSGLUE_LIBS=" " \
  128. RPCSECGSS_CFLAGS=" " \
  129. RPCSECGSS_LIBS=" " \
  130. CONFIG_SQLITE3_TRUE="\#" \
  131. CONFIG_NFSDCLD_TRUE="\#"
  132. define Host/Compile
  133. $(MAKE) -C $(HOST_BUILD_DIR)/tools/rpcgen all
  134. endef
  135. define Host/Install
  136. $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
  137. $(INSTALL_BIN) $(HOST_BUILD_DIR)/tools/rpcgen/rpcgen $(STAGING_DIR_HOSTPKG)/bin/rpcgen
  138. endef
  139. define Package/nfs-kernel-server/install
  140. $(INSTALL_DIR) $(1)/etc/init.d $(1)/usr/sbin
  141. $(INSTALL_DATA) ./files/nfsd.exports $(1)/etc/exports
  142. $(INSTALL_BIN) ./files/nfsd.init $(1)/etc/init.d/nfsd
  143. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/statd/sm-notify $(1)/usr/sbin/
  144. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/statd/statd $(1)/usr/sbin/rpc.statd
  145. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/nfsd/nfsd $(1)/usr/sbin/rpc.nfsd
  146. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/mountd/mountd $(1)/usr/sbin/rpc.mountd
  147. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/exportfs/exportfs $(1)/usr/sbin/
  148. endef
  149. define Package/nfs-kernel-server-utils/install
  150. $(INSTALL_DIR) $(1)/usr/sbin
  151. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/showmount/showmount $(1)/usr/sbin
  152. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/nfsstat/nfsstat $(1)/usr/sbin
  153. endef
  154. define Package/nfs-utils/InstallDev
  155. $(INSTALL_DIR) $(1)/usr/include
  156. $(CP) $(PKG_INSTALL_DIR)/usr/include/nfsidmap.h $(1)/usr/include/
  157. $(INSTALL_DIR) $(1)/usr/lib
  158. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfsidmap.{a,la,so*} $(1)/usr/lib/
  159. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  160. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnfsidmap.pc $(1)/usr/lib/pkgconfig/
  161. endef
  162. define Package/nfs-utils/install
  163. $(INSTALL_DIR) $(1)/sbin
  164. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/mount.nfs $(1)/sbin/
  165. (cd $(1)/sbin; ln -sf mount.nfs mount.nfs4; ln -sf mount.nfs umount.nfs; ln -sf mount.nfs umount.nfs4)
  166. endef
  167. define Package/nfs-utils-libs/install
  168. $(INSTALL_DIR) $(1)/usr/lib
  169. $(if $(CONFIG_NFS_KERNEL_SERVER_V4),$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfsidmap.so* $(1)/usr/lib/,)
  170. endef
  171. $(eval $(call HostBuild))
  172. $(eval $(call BuildPackage,nfs-utils))
  173. $(eval $(call BuildPackage,nfs-utils-libs))
  174. $(eval $(call BuildPackage,nfs-kernel-server))
  175. $(eval $(call BuildPackage,nfs-kernel-server-utils))