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.

207 lines
5.9 KiB

  1. # Copyright (C) 2009-2016 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:=2
  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
  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. endef
  37. define Package/nfs-kernel-server/description
  38. Kernel NFS server support
  39. endef
  40. define Package/nfs-kernel-server/config
  41. source "$(SOURCE)/Config.in"
  42. endef
  43. define Package/nfs-kernel-server-utils
  44. $(call Package/nfs-kernel-server/Default)
  45. TITLE:=NFS server utils
  46. DEPENDS:=nfs-kernel-server
  47. endef
  48. define Package/nfs-kernel-server-utils/description
  49. NFS server utils
  50. endef
  51. define Package/nfs-kernel-server/conffiles
  52. /etc/exports
  53. endef
  54. define Package/nfs-utils/Default
  55. $(call Package/nfs-kernel-server/Default)
  56. SECTION:=utils
  57. CATEGORY:=Utilities
  58. DEPENDS+= +libevent2 +NFS_KERNEL_SERVER_V4:libkeyutils +NFS_KERNEL_SERVER_V4:libdevmapper
  59. URL:=http://nfs.sourceforge.net/
  60. MAINTAINER:=Peter Wagner <tripolar@gmx.at>
  61. endef
  62. define Package/nfs-utils
  63. $(call Package/nfs-utils/Default)
  64. TITLE:=updated mount utility (includes nfs4)
  65. endef
  66. define Package/nfs-utils/description
  67. Updated mount.nfs command - allows mounting nfs4 volumes
  68. endef
  69. define Package/nfs-utils-libs
  70. $(call Package/nfs-utils/Default)
  71. TITLE:=libraries provided by nfs-utils
  72. endef
  73. define Package/nfs-utils-libs/description
  74. Libraries provided by nfs-utils
  75. endef
  76. TARGET_CFLAGS += -Wno-error=implicit-function-declaration \
  77. -Wno-error=strict-prototypes \
  78. -Wno-error=incompatible-pointer-types \
  79. -Wno-error=format-security \
  80. -Wno-error=undef \
  81. -Wno-error=missing-include-dirs
  82. TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
  83. -L$(STAGING_DIR)/usr/lib/libevent
  84. CONFIGURE_ARGS += \
  85. --disable-caps \
  86. --disable-gss \
  87. --disable-nfsdcld \
  88. --disable-nfsdcltrack \
  89. --enable-shared \
  90. --enable-static \
  91. $(if $(CONFIG_NFS_KERNEL_SERVER_V4),--enable,--disable)-nfsv4 \
  92. $(if $(CONFIG_NFS_KERNEL_SERVER_V4),--enable,--disable)-nfsv41
  93. ifeq ($(CONFIG_IPV6),n)
  94. CONFIGURE_ARGS += --disable-ipv6
  95. endif
  96. CONFIGURE_VARS += \
  97. libblkid_cv_is_recent=yes \
  98. ac_cv_lib_resolv___res_querydomain=yes \
  99. ac_cv_lib_bsd_daemon=no \
  100. CONFIG_SQLITE3_TRUE="\#" \
  101. CONFIG_NFSDCLD_TRUE="\#"
  102. MAKE_FLAGS += \
  103. OPT="$(TARGET_CFLAGS)" \
  104. INSTALLSUID="install -m 4755" \
  105. DESTDIR="$(PKG_INSTALL_DIR)" \
  106. RPCGEN_PATH=$(STAGING_DIR_HOSTPKG)/bin/rpcgen \
  107. RPCGEN=$(STAGING_DIR_HOSTPKG)/bin/rpcgen
  108. HOST_CFLAGS += -Dlinux \
  109. -Wno-error=missing-include-dirs
  110. HOST_CONFIGURE_ARGS += \
  111. --disable-gss \
  112. --disable-nfsv4 \
  113. --disable-nfsv41 \
  114. --without-tcp-wrappers
  115. HOST_CONFIGURE_VARS += \
  116. ac_cv_lib_event_event_dispatch=yes \
  117. ac_cv_lib_nfsidmap_nfs4_init_name_mapping=yes \
  118. ac_cv_lib_blkid_blkid_get_library_version=yes \
  119. ac_cv_header_event_h=yes \
  120. ac_cv_header_nfsidmap_h=yes \
  121. ac_cv_header_blkid_blkid_h=yes \
  122. ac_cv_lib_resolv___res_querydomain=yes \
  123. GSSGLUE_CFLAGS=" " \
  124. GSSGLUE_LIBS=" " \
  125. RPCSECGSS_CFLAGS=" " \
  126. RPCSECGSS_LIBS=" " \
  127. CONFIG_SQLITE3_TRUE="\#" \
  128. CONFIG_NFSDCLD_TRUE="\#"
  129. define Host/Compile
  130. $(MAKE) -C $(HOST_BUILD_DIR)/tools/rpcgen all
  131. endef
  132. define Host/Install
  133. $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
  134. $(INSTALL_BIN) $(HOST_BUILD_DIR)/tools/rpcgen/rpcgen $(STAGING_DIR_HOSTPKG)/bin/rpcgen
  135. endef
  136. define Package/nfs-kernel-server/install
  137. $(INSTALL_DIR) $(1)/etc/init.d $(1)/usr/sbin
  138. $(INSTALL_DATA) ./files/nfsd.exports $(1)/etc/exports
  139. $(INSTALL_BIN) ./files/nfsd.init $(1)/etc/init.d/nfsd
  140. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/statd/sm-notify $(1)/usr/sbin/
  141. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/statd/statd $(1)/usr/sbin/rpc.statd
  142. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/nfsd/nfsd $(1)/usr/sbin/rpc.nfsd
  143. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/mountd/mountd $(1)/usr/sbin/rpc.mountd
  144. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/exportfs/exportfs $(1)/usr/sbin/
  145. endef
  146. define Package/nfs-kernel-server-utils/install
  147. $(INSTALL_DIR) $(1)/usr/sbin
  148. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/showmount/showmount $(1)/usr/sbin
  149. $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/nfsstat/nfsstat $(1)/usr/sbin
  150. endef
  151. define Package/nfs-utils/InstallDev
  152. $(INSTALL_DIR) $(1)/usr/include
  153. $(CP) $(PKG_INSTALL_DIR)/usr/include/nfsidmap.h $(1)/usr/include/
  154. $(INSTALL_DIR) $(1)/usr/lib
  155. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfsidmap.{a,la,so*} $(1)/usr/lib/
  156. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  157. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnfsidmap.pc $(1)/usr/lib/pkgconfig/
  158. endef
  159. define Package/nfs-utils/install
  160. $(INSTALL_DIR) $(1)/sbin
  161. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/mount.nfs $(1)/sbin/
  162. (cd $(1)/sbin; ln -sf mount.nfs mount.nfs4; ln -sf mount.nfs umount.nfs; ln -sf mount.nfs umount.nfs4)
  163. endef
  164. define Package/nfs-utils-libs/install
  165. $(INSTALL_DIR) $(1)/usr/lib
  166. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfsidmap.so* $(1)/usr/lib/
  167. endef
  168. $(eval $(call HostBuild))
  169. $(eval $(call BuildPackage,nfs-utils))
  170. $(eval $(call BuildPackage,nfs-utils-libs))
  171. $(eval $(call BuildPackage,nfs-kernel-server))
  172. $(eval $(call BuildPackage,nfs-kernel-server-utils))