summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2017-11-10 18:19:09 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2017-12-04 16:44:15 +0000
commit952eb2aea572ba7b7b83485facb81dddc1019fc2 (patch)
treeff554e92d639adefe5116ebaaaaee73488090ae8
parentd6b73ad1464ca6df4e3439a8d2999bc9baba73f6 (diff)
downloaddefinitions-952eb2aea572ba7b7b83485facb81dddc1019fc2.tar.gz
Update Samba
To hopefully fix a build issue that has randomly reared its head: [3104/3492] Linking default/lib/tdb/tdbrestore /usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/7.1.0/../../../libcom_err.a(error_message.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-pc-linux-gnu/7.1.0/../../../libcom_err.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status
-rw-r--r--elements/samba/samba.bst134
1 files changed, 134 insertions, 0 deletions
diff --git a/elements/samba/samba.bst b/elements/samba/samba.bst
new file mode 100644
index 00000000..3c695e0f
--- /dev/null
+++ b/elements/samba/samba.bst
@@ -0,0 +1,134 @@
+kind: manual
+depends:
+- core.bst
+- foundation.bst
+- python2-core.bst
+sources:
+- kind: git
+ url: upstream:samba
+ track: v4-7-stable
+ ref: b174cb515385afc81e591a4b42d2bef1a2244c03
+config:
+ configure-commands:
+ - |
+ # Here are really really ugly hacks:
+ #
+ # This fixes a problem with ./configure and recent compilers
+ # which implement c9x by default.
+ sed -i "s/#define bool int//" source3/lib/util_sec.c
+ #
+ # This fixes the problem with Baserock build environments running
+ # as root but sandboxed, and preventing certain privileged operations
+ # from taking effect. eg. seteuid()
+ # Instead, convince it that we're not running as root so that it
+ # doesn't run these tests.
+ sed -i "s/getuid() != 0/1/" source3/lib/util_sec.c
+ #
+ #
+ ./configure \
+ --without-ldap \
+ --disable-gnutls \
+ --without-ad-dc \
+ --without-acl-support \
+ --without-ads \
+ --prefix="%{prefix}" --sysconfdir=/etc --localstatedir=/var --enable-fhs
+ build-commands:
+ - make
+ install-commands:
+ - make install DESTDIR="%{install-root}"
+ - mkdir -p "%{install-root}/etc/tmpfiles.d"
+ - install -m 644 ./packaging/systemd/samba.conf.tmp "%{install-root}/etc/tmpfiles.d/samba.conf"
+ - mkdir -p "%{install-root}/lib/systemd/system/multi-user.target.wants"
+ - |
+ cat <<EOF >"%{install-root}/lib/systemd/system/nmb.service"
+ [Unit]
+ Description=Samba NMB Daemon
+ After=syslog.target network-online.target
+
+ [Service]
+ Type=forking
+ PIDFile=/var/run/samba/nmbd.pid
+ EnvironmentFile=-/etc/sysconfig/samba
+ ExecStart=%{prefix}/sbin/nmbd \$NMBDOPTIONS
+ ExecReload=%{prefix}/bin/kill -HUP \$MAINPID
+
+ [Install]
+ WantedBy=multi-user.target
+ EOF
+ - |
+ cat <<EOF >"%{install-root}/lib/systemd/system/smb.service"
+ [Unit]
+ Description=Samba SMB Daemon
+ After=syslog.target network-online.target nmb.service winbind.service
+
+ [Service]
+ Type=forking
+ PIDFile=/var/run/samba/smbd.pid
+ EnvironmentFile=-/etc/sysconfig/samba
+ ExecStart=%{prefix}/sbin/smbd \$NMBDOPTIONS
+ ExecReload=%{prefix}/bin/kill -HUP \$MAINPID
+
+ [Install]
+ WantedBy=multi-user.target
+ EOF
+ - |
+ cat <<EOF >"%{install-root}/lib/systemd/system/winbind.service"
+ [Unit]
+ Description=Samba winbind Daemon
+ After=syslog.target network-online.target nmb.service
+
+ [Service]
+ Type=forking
+ PIDFile=/var/run/samba/winbindd.pid
+ EnvironmentFile=-/etc/sysconfig/samba
+ ExecStart=%{prefix}/sbin/winbindd \$NMBDOPTIONS
+ ExecReload=%{prefix}/bin/kill -HUP \$MAINPID
+
+ [Install]
+ WantedBy=multi-user.target
+ EOF
+ - |
+ for i in nmb smb winbind
+ do
+ ln -s ../$i.service "%{install-root}/lib/systemd/system/multi-user.target.wants/$i.service"
+ done
+ - mkdir -p "%{install-root}/var/log/samba"
+ - mkdir -p "%{install-root}/etc/samba"
+ - |
+ cat <<EOF >"%{install-root}/etc/samba/smb.conf"
+ [global]
+ workgroup = WORKGROUP
+ dns proxy = no
+ local master = yes
+ preferred master = yes
+ os level = 2
+ log file = /var/log/samba/log.%m
+ max log size = 1000
+ syslog = 0
+ server role = standalone server
+ passdb backend = tdbsam
+ obey pam restrictions = yes
+ unix password sync = yes
+ pam password change = yes
+ map to guest = bad user
+ usershare allow guests = yes
+ [homes]
+ comment = Home Directories
+ browseable = no
+ read only = yes
+ create mask = 0700
+ valid users = %S
+ ;[printers]
+ ;comment = All Printers
+ ;browseable = no
+ ;path = /var/spool/samba
+ ;printable = yes
+ ;guest ok = no
+ ;read only = yes
+ ;create mask = 0700
+ ;[src]
+ ;comment = Source code
+ ;path = /src
+ ;read only = yes
+ ;guest ok = yes
+ EOF