summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rules/samba.in120
-rw-r--r--rules/samba.make87
2 files changed, 191 insertions, 16 deletions
diff --git a/rules/samba.in b/rules/samba.in
index 628570b04..8ad63c137 100644
--- a/rules/samba.in
+++ b/rules/samba.in
@@ -3,6 +3,9 @@
menuconfig SAMBA
bool
prompt "samba "
+ select GLIBC
+ select GLIBC_NSL
+ select GLIBC_RESOLV
help
Samba is an Open Source/Free Software suite that has, since
1992, provided file and print services to all manner of
@@ -22,13 +25,6 @@ menuconfig SAMBA
# --enable-krb5developer Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)
# --enable-dmalloc Enable heap debugging default=no
- config SAMBA_CUPS
- bool
- depends on SAMBA
- prompt "cups support"
- depends on BROKEN
- help
- Turn on CUPS support
# --enable-iprint Turn on iPrint support (default=yes if cups is yes)
#
@@ -86,16 +82,116 @@ menuconfig SAMBA
# --with-static-modules=MODULES Comma-seperated list of names of modules to statically link in
# --with-shared-modules=MODULES Comma-seperated list of names of modules to build shared
- config SAMBA_SMBD
+ config SAMBA_COMMON
bool
depends on SAMBA
- prompt "install smbd"
+ default y
+ prompt "Samba common files"
help
Install smbd daemon on target.
- config SAMBA_NMBD
+ config ROOTFS_ETC_SAMBA_CONFIG
+ bool
+ depends on SAMBA
+ depends on SAMBA_SERVER
+ choice
+ prompt "Kind of samba config file"
+ depends on SAMBA
+ depends on SAMBA_COMMON
+ default ROOTFS_ETC_SAMBA_CONFIG_DEFAULT
+
+ config ROOTFS_ETC_SAMBA_CONFIG_DEFAULT
+ bool
+ prompt "Use generic"
+ help
+ Installs a generic /etc/samba/smb.conf file.
+
+ config ROOTFS_ETC_SAMBA_CONFIG_USER
+ bool
+ prompt "User defined"
+ help
+ This uses a user defined config file. Will use
+ the file out of projectroot/etc/samba/smb.conf
+ endchoice
+
+ config SAMBA_SERVER
+ bool
+ depends on SAMBA
+ select SAMBA_COMMON
+ prompt "Samba server"
+ help
+ Installs samba server. ATTENTION: You need rw access to your
+ rootfs before starting the samba server!
+
+ config ROOTFS_ETC_SAMBA_SECRETS_USER
+ bool
+ depends on SAMBA
+ depends on SAMBA_SERVER
+ prompt "User defined smb password Database"
+ help
+ This will install the /etc/samba/secrets.tdb from
+ projectroot/etc/samba/secrets.tdb. If you wish to run samba
+ in user security level and use you own userdatabase. You will
+ have to enable this. If you say n here. The samba server will
+ generates his own secrets.tdb after initialisation.
+
+ config ROOTFS_ETC_INITD_SAMBA
bool
depends on SAMBA
- prompt "install nmbd"
+ depends on SAMBA_SERVER
+ select BB_CONFIG_START_STOP_DAEMON if BUSYBOX
+ default y
+ choice
+ prompt "Kind of samba start script"
+ depends on SAMBA
+ depends on SAMBA_SERVER
+ default ROOTFS_ETC_INITD_SAMBA_DEFAULT
+
+ config ROOTFS_ETC_INITD_SAMBA_DEFAULT
+ bool
+ prompt "Use generic"
+ help
+ Installs a generic /etc/init.d/samba file.
+
+ config ROOTFS_ETC_INITD_SAMBA_USER
+ bool
+ prompt "User defined"
+ help
+ This uses a user defined init file. Will use
+ the file out of projectroot/etc/init.d/samba
+ endchoice
+
+ config SAMBA_CLIENT
+ bool
+ depends on SAMBA
+ select SAMBA_COMMON
+ prompt "Samba client"
help
- Install nmbd daemon on target.
+ Installs some client components of the Samba suite.
+
+ config SAMBA_LIBCLIENT
+ bool
+ depends on SAMBA
+ select SAMBA_COMMON
+ prompt "Samba client library"
+ help
+ Installs the libsmbclient shared library.
+
+ config SAMBA_SMBFS
+ bool
+ depends on SAMBA
+ select SAMBA_COMMON
+ prompt "Samba file system"
+ help
+ Enables the sytem to mount windows share via SMB protocol
+
+ config SAMBA_CUPS
+ bool
+ depends on SAMBA
+ depends on BROKEN
+ prompt "cups support"
+ help
+ Turn on CUPS support
+
+# TODO: We might want to provide alternative smb.conf file for i.E. other security
+# level
diff --git a/rules/samba.make b/rules/samba.make
index 224718443..fbe44863e 100644
--- a/rules/samba.make
+++ b/rules/samba.make
@@ -61,19 +61,34 @@ SAMBA_PATH := PATH=$(CROSS_PATH)
SAMBA_ENV := \
$(CROSS_ENV) \
- samba_cv_HAVE_GETTIMEOFDAY_TZ=yes
+ SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=no \
+ samba_cv_HAVE_GETTIMEOFDAY_TZ=yes \
+ samba_cv_USE_SETRESUID=yes \
+ samba_cv_HAVE_IFACE_IFCONF=yes
#
# autoconf
#
SAMBA_AUTOCONF := $(CROSS_AUTOCONF_USR)
+SAMBA_AUTOCONF += --sysconfdir=/etc/samba \
+ --libdir=/etc/samba \
+ --with-lockdir=/var/lock \
+ --with-piddir=/var/lock \
+ --with-configdir=/etc/samba \
+ --with-logfilebase=/var/log \
+ --with-libdir=/etc/samba \
+ --with-privatedir=/etc/samba
+
ifdef PTXCONF_SAMBA_CUPS
SAMBA_AUTOCONF += --enable-cups
else
SAMBA_AUTOCONF += --disable-cups
endif
+ifdef PTXCONF_SAMBA_SMBFS
+SAMBA_AUTOCONF += --with-smbmount
+endif
$(STATEDIR)/samba.prepare: $(samba_prepare_deps_default)
@$(call targetinfo, $@)
@$(call clean, $(SAMBA_DIR)/config.cache)
@@ -121,11 +136,75 @@ $(STATEDIR)/samba.targetinstall: $(samba_targetinstall_deps_default)
@$(call install_fixup, samba,DEPENDS,)
@$(call install_fixup, samba,DESCRIPTION,missing)
-ifdef PTXCONF_SAMBA_SMBD
- @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/smbd, /usr/sbin/smbd)
+ @$(call install_copy, samba, 0, 0, 0755, /etc/samba)
+
+ifdef PTXCONF_SAMBA_COMMON
+ @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/nmblookup, /usr/bin/nmblookup)
+ @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/net, /usr/bin/net)
+ @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/smbpasswd, /usr/bin/smbpasswd)
+ @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/testparm, /usr/bin/testparm)
+ @$(call install_copy, samba, 0, 0, 0644, $(SAMBA_DIR)/source/codepages/lowcase.dat, /etc/samba/lowcase.dat,n)
+ @$(call install_copy, samba, 0, 0, 0644, $(SAMBA_DIR)/source/codepages/upcase.dat, /etc/samba/upcase.dat,n)
+ @$(call install_copy, samba, 0, 0, 0644, $(SAMBA_DIR)/source/codepages/valid.dat, /etc/samba/valid.dat,n)
+endif
+
+ifdef PTXCONF_ROOTFS_ETC_SAMBA_CONFIG_DEFAULT
+ @$(call install_copy, rootfs, 0, 0, 0644, \
+ $(PTXDIST_TOPDIR)/generic/etc/samba/smb.conf, \
+ /etc/samba/smb.conf, n)
+endif
+ifdef PTXCONF_ROOTFS_ETC_SAMBA_CONFIG_USER
+ @$(call install_copy, rootfs, 0, 0, 0644, \
+ $(PTXDIST_WORKSPACE)/projectroot/etc/samba/smb.conf,\
+ /etc/samba/smb.conf, n)
endif
-ifdef PTXCONF_SAMBA_NMBD
+
+ifdef PTXCONF_SAMBA_SERVER
+ @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/smbd, /usr/sbin/smbd)
@$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/nmbd, /usr/sbin/nmbd)
+ @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/pdbedit, /usr/sbin/pdbedit)
+ @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/smbcontrol, /usr/sbin/smbcontrol)
+ @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/smbstatus, /usr/sbin/smbstatus)
+ @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/tdbbackup, /usr/sbin/tdbbackup)
+endif
+ifdef PTXCONF_ROOTFS_ETC_SAMBA_SECRETS_USER
+ @$(call install_copy, rootfs, 0, 0, 0600, \
+ $(PTXDIST_WORKSPACE)/projectroot/etc/samba/secrets.tdb,\
+ /etc/samba/secrets.tdb, n)
+endif
+ifdef PTXCONF_ROOTFS_ETC_INITD_SAMBA_DEFAULT
+ @$(call install_copy, rootfs, 0, 0, 0755, \
+ $(PTXDIST_TOPDIR)/generic/etc/init.d/samba, \
+ /etc/init.d/samba, n)
+endif
+ifdef PTXCONF_ROOTFS_ETC_INITD_SAMBA_USER
+ @$(call install_copy, rootfs, 0, 0, 0644, \
+ $(PTXDIST_WORKSPACE)/projectroot/etc/init.d/samba,\
+ /etc/init.d/samba, n)
+endif
+
+ifneq ($(PTXCONF_ROOTFS_ETC_INITD_SAMBA_LINK),"")
+ @$(call install_copy, samba, 0, 0, 0755, /etc/rc.d)
+ @$(call install_link, samba, ../init.d/samba, \
+ /etc/rc.d/$(PTXCONF_ROOTFS_ETC_INITD_SAMBA_LINK))
+endif
+
+ifdef PTXCONF_SAMBA_CLIENT
+ @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/smbcacls, /usr/bin/smbcacls)
+ @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/smbcquotas, /usr/bin/smbcquotas)
+ @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/smbtree, /usr/bin/smbtree)
+ @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/smbclient, /usr/bin/smbclient)
+ @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/rpcclient, /usr/bin/rpcclient)
+endif
+
+ifdef PTXCONF_SAMBA_LIBCLIENT
+ @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/libsmbclient.so, /usr/lib/libsmbclient.so.0)
+ @$(call install_link, samba, libsmbclient.so.0.1, /usr/lib/libsmbclient.so.0)
+endif
+
+ifdef PTXCONF_SAMBA_SMBFS
+ @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/smbmount, /usr/bin/smbmount)
+ @$(call install_copy, samba, 0, 0, 0755, $(SAMBA_DIR)/source/bin/smbumount, /usr/bin/smbumount)
endif
@$(call install_finish, samba)