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.

208 lines
5.9 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.3.3
  9. PKG_RELEASE:=7
  10. PKG_HASH:=3c8c63611c7e78b7a3b2f8a28b9928a5b5e66d5e9ad09a1e54681508884320a4
  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. $(if $(CONFIG_NFS_KERNEL_SERVER_V4),--enable,--disable)-nfsv4 \
  93. $(if $(CONFIG_NFS_KERNEL_SERVER_V4),--enable,--disable)-nfsv41
  94. ifeq ($(CONFIG_IPV6),n)
  95. CONFIGURE_ARGS += --disable-ipv6
  96. endif
  97. CONFIGURE_VARS += \
  98. libblkid_cv_is_recent=yes \
  99. ac_cv_lib_resolv___res_querydomain=yes \
  100. ac_cv_lib_bsd_daemon=no \
  101. CONFIG_SQLITE3_TRUE="\#" \
  102. CONFIG_NFSDCLD_TRUE="\#"
  103. MAKE_FLAGS += \
  104. OPT="$(TARGET_CFLAGS)" \
  105. INSTALLSUID="install -m 4755" \
  106. DESTDIR="$(PKG_INSTALL_DIR)" \
  107. RPCGEN_PATH=$(STAGING_DIR_HOSTPKG)/bin/rpcgen \
  108. RPCGEN=$(STAGING_DIR_HOSTPKG)/bin/rpcgen
  109. HOST_CFLAGS += -Dlinux \
  110. -Wno-error=missing-include-dirs
  111. HOST_CONFIGURE_ARGS += \
  112. --disable-gss \
  113. --disable-nfsv4 \
  114. --disable-nfsv41 \
  115. --without-tcp-wrappers
  116. HOST_CONFIGURE_VARS += \
  117. ac_cv_lib_event_event_dispatch=yes \
  118. ac_cv_lib_nfsidmap_nfs4_init_name_mapping=yes \
  119. ac_cv_lib_blkid_blkid_get_library_version=yes \
  120. ac_cv_header_event_h=yes \
  121. ac_cv_header_nfsidmap_h=yes \
  122. ac_cv_header_blkid_blkid_h=yes \
  123. ac_cv_lib_resolv___res_querydomain=yes \
  124. GSSGLUE_CFLAGS=" " \
  125. GSSGLUE_LIBS=" " \
  126. RPCSECGSS_CFLAGS=" " \
  127. RPCSECGSS_LIBS=" " \
  128. CONFIG_SQLITE3_TRUE="\#" \
  129. CONFIG_NFSDCLD_TRUE="\#"
  130. define Host/Compile
  131. $(MAKE) -C $(HOST_BUILD_DIR)/tools/rpcgen all
  132. endef
  133. define Host/Install
  134. $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
  135. $(INSTALL_BIN) $(HOST_BUILD_DIR)/tools/rpcgen/rpcgen $(STAGING_DIR_HOSTPKG)/bin/rpcgen
  136. endef
  137. define Package/nfs-kernel-server/install
  138. $(INSTALL_DIR) $(1)/etc/init.d $(1)/usr/sbin
  139. $(INSTALL_DATA) ./files/nfsd.exports $(1)/etc/exports
  140. $(INSTALL_BIN) ./files/nfsd.init $(1)/etc/init.d/nfsd
  141. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/statd/sm-notify $(1)/usr/sbin/
  142. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/statd/statd $(1)/usr/sbin/rpc.statd
  143. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/nfsd/nfsd $(1)/usr/sbin/rpc.nfsd
  144. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/mountd/mountd $(1)/usr/sbin/rpc.mountd
  145. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/exportfs/exportfs $(1)/usr/sbin/
  146. endef
  147. define Package/nfs-kernel-server-utils/install
  148. $(INSTALL_DIR) $(1)/usr/sbin
  149. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/showmount/showmount $(1)/usr/sbin
  150. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/nfsstat/nfsstat $(1)/usr/sbin
  151. endef
  152. define Package/nfs-utils/InstallDev
  153. $(INSTALL_DIR) $(1)/usr/include
  154. $(CP) $(PKG_INSTALL_DIR)/usr/include/nfsidmap.h $(1)/usr/include/
  155. $(INSTALL_DIR) $(1)/usr/lib
  156. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfsidmap.{a,la,so*} $(1)/usr/lib/
  157. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  158. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnfsidmap.pc $(1)/usr/lib/pkgconfig/
  159. endef
  160. define Package/nfs-utils/install
  161. $(INSTALL_DIR) $(1)/sbin
  162. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/mount.nfs $(1)/sbin/
  163. (cd $(1)/sbin; ln -sf mount.nfs mount.nfs4; ln -sf mount.nfs umount.nfs; ln -sf mount.nfs umount.nfs4)
  164. endef
  165. define Package/nfs-utils-libs/install
  166. $(INSTALL_DIR) $(1)/usr/lib
  167. $(if $(CONFIG_NFS_KERNEL_SERVER_V4),$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfsidmap.so* $(1)/usr/lib/,)
  168. endef
  169. $(eval $(call HostBuild))
  170. $(eval $(call BuildPackage,nfs-utils))
  171. $(eval $(call BuildPackage,nfs-utils-libs))
  172. $(eval $(call BuildPackage,nfs-kernel-server))
  173. $(eval $(call BuildPackage,nfs-kernel-server-utils))