42c430132801db8e0aa1c611ba28ec429c6f0fb9
[openwrt/svn-archive/archive.git] / net / nfs-kernel-server / Makefile
1 # Copyright (C) 2009 OpenWrt.org
2 #
3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
5 #
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=nfs-kernel-server
10 PKG_VERSION:=1.1.5
11 PKG_RELEASE:=4
12 PKG_MD5SUM:=2848072a5e53840b9bc520fbb6782b57
13
14 PKG_SOURCE_URL:=@SF/nfs
15 PKG_SOURCE:=nfs-utils-$(PKG_VERSION).tar.bz2
16
17 PKG_BUILD_DIR:=$(BUILD_DIR)/nfs-utils-$(PKG_VERSION)
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/nfs-kernel-server/Default
22 SECTION:=net
23 CATEGORY:=Network
24 SUBMENU:=Filesystem
25 DEPENDS:=+libwrap +libblkid +libuuid
26 URL:=http://nfs.sourceforge.net/
27 endef
28
29 define Package/nfs-kernel-server
30 $(call Package/nfs-kernel-server/Default)
31 TITLE:=Kernel NFS server support
32 DEPENDS+= +kmod-fs-nfsd +kmod-fs-nfs +portmap
33 endef
34
35 define Package/nfs-kernel-server/description
36 Kernel NFS server support
37 endef
38
39 define Package/nfs-kernel-server-utils
40 $(call Package/nfs-kernel-server/Default)
41 TITLE:=NFS server utils
42 DEPENDS:=nfs-kernel-server
43 endef
44
45 define Package/nfs-kernel-server-utils/description
46 NFS server utils
47 endef
48
49 define Package/nfs-kernel-server/conffiles
50 /etc/exports
51 endef
52
53 define Package/nfs-utils
54 $(call Package/nfs-kernel-server/Default)
55 SECTION:=utils
56 CATEGORY:=Utilities
57 DEPENDS+= +libevent
58 TITLE:=updated mount utility (includes nfs4)
59 endef
60
61 define Package/nfs-utils/description
62 Updated mount.nfs command - allows mounting nfs4 volumes
63 endef
64
65 CONFIGURE_ARGS += \
66 --disable-gss \
67 --disable-nfsv4 \
68 --enable-static \
69 --enable-shared
70
71 TARGET_CFLAGS += -I$(PKG_BUILD_DIR)/lib
72 TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
73
74 define Build/Compile
75 $(call Build/Compile/Default, \
76 OPT="$(TARGET_CFLAGS)" \
77 INSTALLSUID="install -m 4755" \
78 DESTDIR="$(PKG_INSTALL_DIR)" \
79 all install \
80 )
81 endef
82
83 define Package/nfs-kernel-server/install
84 $(INSTALL_DIR) $(1)/etc/init.d $(1)/usr/sbin
85 $(INSTALL_DATA) ./files/nfsd.exports $(1)/etc/exports
86 $(INSTALL_BIN) ./files/nfsd.init $(1)/etc/init.d/nfsd
87 $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/statd/statd $(1)/usr/sbin/rpc.statd
88 $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/nfsd/nfsd $(1)/usr/sbin/rpc.nfsd
89 $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/mountd/mountd $(1)/usr/sbin/rpc.mountd
90 $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/exportfs/exportfs $(1)/usr/sbin/
91 endef
92
93 define Package/nfs-kernel-server-utils/install
94 $(INSTALL_DIR) $(1)/usr/sbin
95 $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/showmount/showmount $(1)/usr/sbin
96 $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/nfsstat/nfsstat $(1)/usr/sbin
97 endef
98
99 define Package/nfs-utils/install
100 $(INSTALL_DIR) $(1)/sbin
101 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/mount.nfs $(1)/sbin/
102 (cd $(1)/sbin; ln -sf mount.nfs mount.nfs4; ln -sf mount.nfs umount.nfs; ln -sf mount.nfs umount.nfs4)
103 endef
104
105 $(eval $(call BuildPackage,nfs-kernel-server))
106 $(eval $(call BuildPackage,nfs-kernel-server-utils))
107 $(eval $(call BuildPackage,nfs-utils))