bootstrap: add the result of bootstrap/template.py --render
authorStefan Metzmacher <metze@samba.org>
Fri, 12 Apr 2019 11:33:12 +0000 (13:33 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 18 Apr 2019 12:09:34 +0000 (12:09 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
56 files changed:
bootstrap/dists/centos6/Dockerfile [deleted file]
bootstrap/dists/centos7/Dockerfile [deleted file]
bootstrap/dists/debian7/Dockerfile [deleted file]
bootstrap/dists/debian8/Dockerfile [deleted file]
bootstrap/dists/debian9/Dockerfile [deleted file]
bootstrap/dists/fedora28/Dockerfile [deleted file]
bootstrap/dists/fedora29/Dockerfile [deleted file]
bootstrap/dists/ubuntu1404/Dockerfile [deleted file]
bootstrap/dists/ubuntu1604/Dockerfile [deleted file]
bootstrap/dists/ubuntu1804/Dockerfile [deleted file]
bootstrap/generated-dists/Vagrantfile [moved from bootstrap/dists/Vagrantfile with 66% similarity]
bootstrap/generated-dists/centos6/Dockerfile [new file with mode: 0644]
bootstrap/generated-dists/centos6/bootstrap.sh [moved from bootstrap/dists/centos6/bootstrap.sh with 70% similarity, mode: 0755]
bootstrap/generated-dists/centos6/locale.sh [new file with mode: 0755]
bootstrap/generated-dists/centos6/packages.yml [moved from bootstrap/dists/centos6/packages.yml with 72% similarity]
bootstrap/generated-dists/centos7/Dockerfile [new file with mode: 0644]
bootstrap/generated-dists/centos7/bootstrap.sh [moved from bootstrap/dists/centos7/bootstrap.sh with 70% similarity, mode: 0755]
bootstrap/generated-dists/centos7/locale.sh [new file with mode: 0755]
bootstrap/generated-dists/centos7/packages.yml [moved from bootstrap/dists/centos7/packages.yml with 72% similarity]
bootstrap/generated-dists/debian7/Dockerfile [new file with mode: 0644]
bootstrap/generated-dists/debian7/bootstrap.sh [moved from bootstrap/dists/debian7/bootstrap.sh with 64% similarity, mode: 0755]
bootstrap/generated-dists/debian7/locale.sh [new file with mode: 0755]
bootstrap/generated-dists/debian7/packages.yml [moved from bootstrap/dists/debian7/packages.yml with 65% similarity]
bootstrap/generated-dists/debian8/Dockerfile [new file with mode: 0644]
bootstrap/generated-dists/debian8/bootstrap.sh [moved from bootstrap/dists/debian8/bootstrap.sh with 66% similarity, mode: 0755]
bootstrap/generated-dists/debian8/locale.sh [new file with mode: 0755]
bootstrap/generated-dists/debian8/packages.yml [moved from bootstrap/dists/debian8/packages.yml with 66% similarity]
bootstrap/generated-dists/debian9/Dockerfile [new file with mode: 0644]
bootstrap/generated-dists/debian9/bootstrap.sh [moved from bootstrap/dists/debian9/bootstrap.sh with 66% similarity, mode: 0755]
bootstrap/generated-dists/debian9/locale.sh [new file with mode: 0755]
bootstrap/generated-dists/debian9/packages.yml [moved from bootstrap/dists/debian9/packages.yml with 66% similarity]
bootstrap/generated-dists/fedora28/Dockerfile [new file with mode: 0644]
bootstrap/generated-dists/fedora28/bootstrap.sh [moved from bootstrap/dists/fedora29/bootstrap.sh with 70% similarity, mode: 0755]
bootstrap/generated-dists/fedora28/locale.sh [new file with mode: 0755]
bootstrap/generated-dists/fedora28/packages.yml [moved from bootstrap/dists/fedora29/packages.yml with 73% similarity]
bootstrap/generated-dists/fedora29/Dockerfile [new file with mode: 0644]
bootstrap/generated-dists/fedora29/bootstrap.sh [moved from bootstrap/dists/fedora28/bootstrap.sh with 70% similarity, mode: 0755]
bootstrap/generated-dists/fedora29/locale.sh [new file with mode: 0755]
bootstrap/generated-dists/fedora29/packages.yml [moved from bootstrap/dists/fedora28/packages.yml with 73% similarity]
bootstrap/generated-dists/opensuse150/Dockerfile [new file with mode: 0644]
bootstrap/generated-dists/opensuse150/bootstrap.sh [new file with mode: 0755]
bootstrap/generated-dists/opensuse150/locale.sh [new file with mode: 0755]
bootstrap/generated-dists/opensuse150/packages.yml [new file with mode: 0644]
bootstrap/generated-dists/ubuntu1404/Dockerfile [new file with mode: 0644]
bootstrap/generated-dists/ubuntu1404/bootstrap.sh [moved from bootstrap/dists/ubuntu1404/bootstrap.sh with 66% similarity, mode: 0755]
bootstrap/generated-dists/ubuntu1404/locale.sh [new file with mode: 0755]
bootstrap/generated-dists/ubuntu1404/packages.yml [moved from bootstrap/dists/ubuntu1404/packages.yml with 67% similarity]
bootstrap/generated-dists/ubuntu1604/Dockerfile [new file with mode: 0644]
bootstrap/generated-dists/ubuntu1604/bootstrap.sh [moved from bootstrap/dists/ubuntu1604/bootstrap.sh with 66% similarity, mode: 0755]
bootstrap/generated-dists/ubuntu1604/locale.sh [new file with mode: 0755]
bootstrap/generated-dists/ubuntu1604/packages.yml [moved from bootstrap/dists/ubuntu1604/packages.yml with 67% similarity]
bootstrap/generated-dists/ubuntu1804/Dockerfile [new file with mode: 0644]
bootstrap/generated-dists/ubuntu1804/bootstrap.sh [moved from bootstrap/dists/ubuntu1804/bootstrap.sh with 66% similarity, mode: 0755]
bootstrap/generated-dists/ubuntu1804/locale.sh [new file with mode: 0755]
bootstrap/generated-dists/ubuntu1804/packages.yml [moved from bootstrap/dists/ubuntu1804/packages.yml with 67% similarity]
bootstrap/sha1sum.txt [new file with mode: 0644]

diff --git a/bootstrap/dists/centos6/Dockerfile b/bootstrap/dists/centos6/Dockerfile
deleted file mode 100644 (file)
index bbd2443..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-FROM centos:6
-
-# we will use this image to run ci, these ENV vars are important
-ENV CC="ccache gcc"
-
-ADD bootstrap.sh /tmp/bootstrap.sh
-# need root permission, do it before USER samba
-RUN bash /tmp/bootstrap.sh
-
-# make test can not work with root, so we have to create a new user
-RUN useradd -m -s /bin/bash samba && \
-    mkdir -p /etc/sudoers.d && \
-    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
-
-USER samba
-WORKDIR /home/samba
-# samba tests rely on this
-ENV USER=samba LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
\ No newline at end of file
diff --git a/bootstrap/dists/centos7/Dockerfile b/bootstrap/dists/centos7/Dockerfile
deleted file mode 100644 (file)
index 004d1b9..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-FROM centos:7
-
-# we will use this image to run ci, these ENV vars are important
-ENV CC="ccache gcc"
-
-ADD bootstrap.sh /tmp/bootstrap.sh
-# need root permission, do it before USER samba
-RUN bash /tmp/bootstrap.sh
-
-# make test can not work with root, so we have to create a new user
-RUN useradd -m -s /bin/bash samba && \
-    mkdir -p /etc/sudoers.d && \
-    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
-
-USER samba
-WORKDIR /home/samba
-# samba tests rely on this
-ENV USER=samba LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
\ No newline at end of file
diff --git a/bootstrap/dists/debian7/Dockerfile b/bootstrap/dists/debian7/Dockerfile
deleted file mode 100644 (file)
index f369ada..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-FROM debian:7
-
-# we will use this image to run ci, these ENV vars are important
-ENV CC="ccache gcc"
-
-ADD bootstrap.sh /tmp/bootstrap.sh
-# need root permission, do it before USER samba
-RUN bash /tmp/bootstrap.sh
-
-# make test can not work with root, so we have to create a new user
-RUN useradd -m -s /bin/bash samba && \
-    mkdir -p /etc/sudoers.d && \
-    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
-
-USER samba
-WORKDIR /home/samba
-# samba tests rely on this
-ENV USER=samba LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
\ No newline at end of file
diff --git a/bootstrap/dists/debian8/Dockerfile b/bootstrap/dists/debian8/Dockerfile
deleted file mode 100644 (file)
index 3194811..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-FROM debian:8
-
-# we will use this image to run ci, these ENV vars are important
-ENV CC="ccache gcc"
-
-ADD bootstrap.sh /tmp/bootstrap.sh
-# need root permission, do it before USER samba
-RUN bash /tmp/bootstrap.sh
-
-# make test can not work with root, so we have to create a new user
-RUN useradd -m -s /bin/bash samba && \
-    mkdir -p /etc/sudoers.d && \
-    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
-
-USER samba
-WORKDIR /home/samba
-# samba tests rely on this
-ENV USER=samba LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
\ No newline at end of file
diff --git a/bootstrap/dists/debian9/Dockerfile b/bootstrap/dists/debian9/Dockerfile
deleted file mode 100644 (file)
index 0615b30..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-FROM debian:9
-
-# we will use this image to run ci, these ENV vars are important
-ENV CC="ccache gcc"
-
-ADD bootstrap.sh /tmp/bootstrap.sh
-# need root permission, do it before USER samba
-RUN bash /tmp/bootstrap.sh
-
-# make test can not work with root, so we have to create a new user
-RUN useradd -m -s /bin/bash samba && \
-    mkdir -p /etc/sudoers.d && \
-    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
-
-USER samba
-WORKDIR /home/samba
-# samba tests rely on this
-ENV USER=samba LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
\ No newline at end of file
diff --git a/bootstrap/dists/fedora28/Dockerfile b/bootstrap/dists/fedora28/Dockerfile
deleted file mode 100644 (file)
index fe7f228..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-FROM fedora:28
-
-# we will use this image to run ci, these ENV vars are important
-ENV CC="ccache gcc"
-
-ADD bootstrap.sh /tmp/bootstrap.sh
-# need root permission, do it before USER samba
-RUN bash /tmp/bootstrap.sh
-
-# make test can not work with root, so we have to create a new user
-RUN useradd -m -s /bin/bash samba && \
-    mkdir -p /etc/sudoers.d && \
-    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
-
-USER samba
-WORKDIR /home/samba
-# samba tests rely on this
-ENV USER=samba LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
\ No newline at end of file
diff --git a/bootstrap/dists/fedora29/Dockerfile b/bootstrap/dists/fedora29/Dockerfile
deleted file mode 100644 (file)
index 55db771..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-FROM fedora:29
-
-# we will use this image to run ci, these ENV vars are important
-ENV CC="ccache gcc"
-
-ADD bootstrap.sh /tmp/bootstrap.sh
-# need root permission, do it before USER samba
-RUN bash /tmp/bootstrap.sh
-
-# make test can not work with root, so we have to create a new user
-RUN useradd -m -s /bin/bash samba && \
-    mkdir -p /etc/sudoers.d && \
-    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
-
-USER samba
-WORKDIR /home/samba
-# samba tests rely on this
-ENV USER=samba LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
\ No newline at end of file
diff --git a/bootstrap/dists/ubuntu1404/Dockerfile b/bootstrap/dists/ubuntu1404/Dockerfile
deleted file mode 100644 (file)
index 40e59b1..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-FROM ubuntu:14.04
-
-# we will use this image to run ci, these ENV vars are important
-ENV CC="ccache gcc"
-
-ADD bootstrap.sh /tmp/bootstrap.sh
-# need root permission, do it before USER samba
-RUN bash /tmp/bootstrap.sh
-
-# make test can not work with root, so we have to create a new user
-RUN useradd -m -s /bin/bash samba && \
-    mkdir -p /etc/sudoers.d && \
-    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
-
-USER samba
-WORKDIR /home/samba
-# samba tests rely on this
-ENV USER=samba LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
\ No newline at end of file
diff --git a/bootstrap/dists/ubuntu1604/Dockerfile b/bootstrap/dists/ubuntu1604/Dockerfile
deleted file mode 100644 (file)
index 772b630..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-FROM ubuntu:16.04
-
-# we will use this image to run ci, these ENV vars are important
-ENV CC="ccache gcc"
-
-ADD bootstrap.sh /tmp/bootstrap.sh
-# need root permission, do it before USER samba
-RUN bash /tmp/bootstrap.sh
-
-# make test can not work with root, so we have to create a new user
-RUN useradd -m -s /bin/bash samba && \
-    mkdir -p /etc/sudoers.d && \
-    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
-
-USER samba
-WORKDIR /home/samba
-# samba tests rely on this
-ENV USER=samba LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
\ No newline at end of file
diff --git a/bootstrap/dists/ubuntu1804/Dockerfile b/bootstrap/dists/ubuntu1804/Dockerfile
deleted file mode 100644 (file)
index db517e1..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-FROM ubuntu:18.04
-
-# we will use this image to run ci, these ENV vars are important
-ENV CC="ccache gcc"
-
-ADD bootstrap.sh /tmp/bootstrap.sh
-# need root permission, do it before USER samba
-RUN bash /tmp/bootstrap.sh
-
-# make test can not work with root, so we have to create a new user
-RUN useradd -m -s /bin/bash samba && \
-    mkdir -p /etc/sudoers.d && \
-    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
-
-USER samba
-WORKDIR /home/samba
-# samba tests rely on this
-ENV USER=samba LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
\ No newline at end of file
similarity index 66%
rename from bootstrap/dists/Vagrantfile
rename to bootstrap/generated-dists/Vagrantfile
index 9281efa9a0ef5f73b7205a9d2383ae12b255508d..8dbac2c73c168c21579160e5543c22a2883584a0 100644 (file)
@@ -1,4 +1,11 @@
 
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+
 Vagrant.configure("2") do |config|
     config.ssh.insert_key = false
 
@@ -7,60 +14,77 @@ Vagrant.configure("2") do |config|
         v.vm.box = "centos/6"
         v.vm.hostname = "centos6"
         v.vm.provision :shell, path: "centos6/bootstrap.sh"
+        v.vm.provision :shell, path: "centos6/locale.sh"
     end
 
     config.vm.define "centos7" do |v|
         v.vm.box = "centos/7"
         v.vm.hostname = "centos7"
         v.vm.provision :shell, path: "centos7/bootstrap.sh"
+        v.vm.provision :shell, path: "centos7/locale.sh"
     end
 
     config.vm.define "debian7" do |v|
         v.vm.box = "debian/wheezy64"
         v.vm.hostname = "debian7"
         v.vm.provision :shell, path: "debian7/bootstrap.sh"
+        v.vm.provision :shell, path: "debian7/locale.sh"
     end
 
     config.vm.define "debian8" do |v|
         v.vm.box = "debian/jessie64"
         v.vm.hostname = "debian8"
         v.vm.provision :shell, path: "debian8/bootstrap.sh"
+        v.vm.provision :shell, path: "debian8/locale.sh"
     end
 
     config.vm.define "debian9" do |v|
         v.vm.box = "debian/stretch64"
         v.vm.hostname = "debian9"
         v.vm.provision :shell, path: "debian9/bootstrap.sh"
+        v.vm.provision :shell, path: "debian9/locale.sh"
     end
 
     config.vm.define "fedora28" do |v|
         v.vm.box = "fedora/28-cloud-base"
         v.vm.hostname = "fedora28"
         v.vm.provision :shell, path: "fedora28/bootstrap.sh"
+        v.vm.provision :shell, path: "fedora28/locale.sh"
     end
 
     config.vm.define "fedora29" do |v|
         v.vm.box = "fedora/29-cloud-base"
         v.vm.hostname = "fedora29"
         v.vm.provision :shell, path: "fedora29/bootstrap.sh"
+        v.vm.provision :shell, path: "fedora29/locale.sh"
+    end
+
+    config.vm.define "opensuse150" do |v|
+        v.vm.box = "opensuse/openSUSE-15.0-x86_64"
+        v.vm.hostname = "opensuse150"
+        v.vm.provision :shell, path: "opensuse150/bootstrap.sh"
+        v.vm.provision :shell, path: "opensuse150/locale.sh"
     end
 
     config.vm.define "ubuntu1404" do |v|
         v.vm.box = "ubuntu/trusty64"
         v.vm.hostname = "ubuntu1404"
         v.vm.provision :shell, path: "ubuntu1404/bootstrap.sh"
+        v.vm.provision :shell, path: "ubuntu1404/locale.sh"
     end
 
     config.vm.define "ubuntu1604" do |v|
         v.vm.box = "ubuntu/xenial64"
         v.vm.hostname = "ubuntu1604"
         v.vm.provision :shell, path: "ubuntu1604/bootstrap.sh"
+        v.vm.provision :shell, path: "ubuntu1604/locale.sh"
     end
 
     config.vm.define "ubuntu1804" do |v|
         v.vm.box = "ubuntu/bionic64"
         v.vm.hostname = "ubuntu1804"
         v.vm.provision :shell, path: "ubuntu1804/bootstrap.sh"
+        v.vm.provision :shell, path: "ubuntu1804/locale.sh"
     end
 
 
diff --git a/bootstrap/generated-dists/centos6/Dockerfile b/bootstrap/generated-dists/centos6/Dockerfile
new file mode 100644 (file)
index 0000000..2716eeb
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+FROM centos:6
+
+# pass in with --build-arg while build
+ARG SHA1SUM
+RUN [ -n $SHA1SUM ] && echo $SHA1SUM > /sha1sum.txt
+
+ADD *.sh /tmp/
+# need root permission, do it before USER samba
+RUN /tmp/bootstrap.sh && /tmp/locale.sh
+
+# if ld.gold exists, force link it to ld
+RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD"
+
+# make test can not work with root, so we have to create a new user
+RUN useradd -m -U -s /bin/bash samba && \
+    mkdir -p /etc/sudoers.d && \
+    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
+
+USER samba
+WORKDIR /home/samba
+# samba tests rely on this
+ENV USER=samba LC_ALL=en_US.utf8 LANG=en_US.utf8
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
similarity index 70%
rename from bootstrap/dists/centos6/bootstrap.sh
rename to bootstrap/generated-dists/centos6/bootstrap.sh
index 8e46b41..2ac905d
@@ -1,4 +1,10 @@
 #!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
 set -xueo pipefail
 
 yum -y -q update
@@ -7,52 +13,65 @@ yum -y -q update
 
 yum -y -q --verbose install \
     "@Development Tools" \
+    acl \
     attr \
     autoconf \
-    bind \
+    avahi-devel \
     bind-utils \
     binutils \
     bison \
-    ccache \
     cups-devel \
     curl \
     dbus-devel \
     docbook-dtds \
     docbook-style-xsl \
+    gawk \
     gcc \
     gdb \
     git \
+    glib2-devel \
     glibc-common \
     gnutls-devel \
     gpgme-devel \
+    gzip \
+    hostname \
+    htop \
     jansson-devel \
     keyutils-libs-devel \
     krb5-devel \
-    krb5-workstation \
+    krb5-server \
     libacl-devel \
     libaio-devel \
     libarchive-devel \
     libattr-devel \
     libblkid-devel \
     libbsd-devel \
+    libcap-devel \
+    libicu-devel \
     libnsl2-devel \
     libpcap-devel \
     libsemanage-python \
+    libtasn1-devel \
     libtirpc-devel \
-    libxml2-devel \
+    libunwind-devel \
+    libuuid-devel \
     libxslt \
-    lmdb-devel \
+    lmdb \
     lmdb-devel \
     make \
-    mlocate \
     ncurses-devel \
     nettle-devel \
     openldap-devel \
     pam-devel \
+    patch \
+    perl-Archive-Tar \
     perl-ExtUtils-MakeMaker \
+    perl-JSON-Parse \
     perl-Parse-Yapp \
     perl-Test-Base \
     perl-core \
+    perl-generators \
+    perl-interpreter \
     pkgconfig \
     policycoreutils-python \
     popt-devel \
@@ -67,25 +86,19 @@ yum -y -q --verbose install \
     python3-dns \
     python3-markdown \
     python34-devel \
+    quota-devel \
     readline-devel \
     redhat-lsb \
+    rng-tools \
     rpcgen \
+    rsync \
+    sed \
     sudo \
     systemd-devel \
-    vim \
-    wget \
+    tar \
+    tree \
+    which \
     yum-utils \
     zlib-devel
 
-yum clean all
-
-# gen locale
-localedef -c -i en_US -f UTF-8 en_US.UTF-8
-
-# no update-locale, diy
-# LC_ALL is not valid in this file
-echo LANG="en_US.UTF-8" > /etc/locale.conf
-
-# set both for safe
-echo LC_ALL="en_US.UTF-8" >> /etc/environment
-echo LANG="en_US.UTF-8" >> /etc/environment
\ No newline at end of file
+yum clean all
\ No newline at end of file
diff --git a/bootstrap/generated-dists/centos6/locale.sh b/bootstrap/generated-dists/centos6/locale.sh
new file mode 100755 (executable)
index 0000000..cc64e18
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+set -xueo pipefail
+
+# refer to /usr/share/i18n/locales
+INPUTFILE=en_US
+# refer to /usr/share/i18n/charmaps
+CHARMAP=UTF-8
+# locale to generate in /usr/lib/locale
+# glibc/localedef will normalize UTF-8 to utf8, follow the naming style
+LOCALE=$INPUTFILE.utf8
+
+# if locale is already correct, exit
+( locale | grep LC_ALL | grep -i $LOCALE ) && exit 0
+
+# if locale not available, generate locale into /usr/lib/locale
+if ! ( locale --all-locales | grep -i $LOCALE )
+then
+    # no-archive means create its own dir
+    localedef --inputfile $INPUTFILE --charmap $CHARMAP --no-archive $LOCALE
+fi
+
+# update locale conf and global env file
+# set both LC_ALL and LANG for safe
+
+# update conf for Debian family
+FILE=/etc/default/locale
+if [ -f $FILE ]
+then
+    echo LC_ALL="$LOCALE" > $FILE
+    echo LANG="$LOCALE" >> $FILE
+fi
+
+# update conf for RedHat family
+FILE=/etc/locale.conf
+if [ -f $FILE ]
+then
+    # LC_ALL is not valid in this file, set LANG only
+    echo LANG="$LOCALE" > $FILE
+fi
+
+# update global env file
+FILE=/etc/environment
+if [ -f $FILE ]
+then
+    # append LC_ALL if not exist
+    grep LC_ALL $FILE || echo LC_ALL="$LOCALE" >> $FILE
+    # append LANG if not exist
+    grep LANG $FILE || echo LANG="$LOCALE" >> $FILE
+fi
\ No newline at end of file
similarity index 72%
rename from bootstrap/dists/centos6/packages.yml
rename to bootstrap/generated-dists/centos6/packages.yml
index bd62d1d5fead942a3a122f0b1ba7fd8807027793..344d88a5d2a243db1dac73b6421413ad5b31166f 100644 (file)
@@ -1,52 +1,65 @@
 ---
 packages:
   - "@Development Tools"
+  - acl
   - attr
   - autoconf
-  - bind
+  - avahi-devel
   - bind-utils
   - binutils
   - bison
-  - ccache
   - cups-devel
   - curl
   - dbus-devel
   - docbook-dtds
   - docbook-style-xsl
+  - gawk
   - gcc
   - gdb
   - git
+  - glib2-devel
   - glibc-common
   - gnutls-devel
   - gpgme-devel
+  - gzip
+  - hostname
+  - htop
   - jansson-devel
   - keyutils-libs-devel
   - krb5-devel
-  - krb5-workstation
+  - krb5-server
   - libacl-devel
   - libaio-devel
   - libarchive-devel
   - libattr-devel
   - libblkid-devel
   - libbsd-devel
+  - libcap-devel
+  - libicu-devel
   - libnsl2-devel
   - libpcap-devel
   - libsemanage-python
+  - libtasn1-devel
   - libtirpc-devel
-  - libxml2-devel
+  - libunwind-devel
+  - libuuid-devel
   - libxslt
-  - lmdb-devel
+  - lmdb
   - lmdb-devel
   - make
-  - mlocate
   - ncurses-devel
   - nettle-devel
   - openldap-devel
   - pam-devel
+  - patch
+  - perl-Archive-Tar
   - perl-ExtUtils-MakeMaker
+  - perl-JSON-Parse
   - perl-Parse-Yapp
   - perl-Test-Base
   - perl-core
+  - perl-generators
+  - perl-interpreter
   - pkgconfig
   - policycoreutils-python
   - popt-devel
@@ -61,12 +74,17 @@ packages:
   - python3-dns
   - python3-markdown
   - python34-devel
+  - quota-devel
   - readline-devel
   - redhat-lsb
+  - rng-tools
   - rpcgen
+  - rsync
+  - sed
   - sudo
   - systemd-devel
-  - vim
-  - wget
+  - tar
+  - tree
+  - which
   - yum-utils
   - zlib-devel
\ No newline at end of file
diff --git a/bootstrap/generated-dists/centos7/Dockerfile b/bootstrap/generated-dists/centos7/Dockerfile
new file mode 100644 (file)
index 0000000..2f171ad
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+FROM centos:7
+
+# pass in with --build-arg while build
+ARG SHA1SUM
+RUN [ -n $SHA1SUM ] && echo $SHA1SUM > /sha1sum.txt
+
+ADD *.sh /tmp/
+# need root permission, do it before USER samba
+RUN /tmp/bootstrap.sh && /tmp/locale.sh
+
+# if ld.gold exists, force link it to ld
+RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD"
+
+# make test can not work with root, so we have to create a new user
+RUN useradd -m -U -s /bin/bash samba && \
+    mkdir -p /etc/sudoers.d && \
+    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
+
+USER samba
+WORKDIR /home/samba
+# samba tests rely on this
+ENV USER=samba LC_ALL=en_US.utf8 LANG=en_US.utf8
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
similarity index 70%
rename from bootstrap/dists/centos7/bootstrap.sh
rename to bootstrap/generated-dists/centos7/bootstrap.sh
index f9af0bd..90dcbd1
@@ -1,4 +1,10 @@
 #!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
 set -xueo pipefail
 
 yum -y -q update
@@ -7,52 +13,65 @@ yum -y -q update
 
 yum -y -q --verbose install \
     "@Development Tools" \
+    acl \
     attr \
     autoconf \
-    bind \
+    avahi-devel \
     bind-utils \
     binutils \
     bison \
-    ccache \
     cups-devel \
     curl \
     dbus-devel \
     docbook-dtds \
     docbook-style-xsl \
+    gawk \
     gcc \
     gdb \
     git \
+    glib2-devel \
     glibc-common \
     gnutls-devel \
     gpgme-devel \
+    gzip \
+    hostname \
+    htop \
     jansson-devel \
     keyutils-libs-devel \
     krb5-devel \
-    krb5-workstation \
+    krb5-server \
     libacl-devel \
     libaio-devel \
     libarchive-devel \
     libattr-devel \
     libblkid-devel \
     libbsd-devel \
+    libcap-devel \
+    libicu-devel \
     libnsl2-devel \
     libpcap-devel \
     libsemanage-python \
+    libtasn1-devel \
     libtirpc-devel \
-    libxml2-devel \
+    libunwind-devel \
+    libuuid-devel \
     libxslt \
-    lmdb-devel \
+    lmdb \
     lmdb-devel \
     make \
-    mlocate \
     ncurses-devel \
     nettle-devel \
     openldap-devel \
     pam-devel \
+    patch \
+    perl-Archive-Tar \
     perl-ExtUtils-MakeMaker \
+    perl-JSON-Parse \
     perl-Parse-Yapp \
     perl-Test-Base \
     perl-core \
+    perl-generators \
+    perl-interpreter \
     pkgconfig \
     policycoreutils-python \
     popt-devel \
@@ -67,25 +86,19 @@ yum -y -q --verbose install \
     python3-dns \
     python3-markdown \
     python34-devel \
+    quota-devel \
     readline-devel \
     redhat-lsb \
+    rng-tools \
     rpcgen \
+    rsync \
+    sed \
     sudo \
     systemd-devel \
-    vim \
-    wget \
+    tar \
+    tree \
+    which \
     yum-utils \
     zlib-devel
 
-yum clean all
-
-# gen locale
-localedef -c -i en_US -f UTF-8 en_US.UTF-8
-
-# no update-locale, diy
-# LC_ALL is not valid in this file
-echo LANG="en_US.UTF-8" > /etc/locale.conf
-
-# set both for safe
-echo LC_ALL="en_US.UTF-8" >> /etc/environment
-echo LANG="en_US.UTF-8" >> /etc/environment
\ No newline at end of file
+yum clean all
\ No newline at end of file
diff --git a/bootstrap/generated-dists/centos7/locale.sh b/bootstrap/generated-dists/centos7/locale.sh
new file mode 100755 (executable)
index 0000000..cc64e18
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+set -xueo pipefail
+
+# refer to /usr/share/i18n/locales
+INPUTFILE=en_US
+# refer to /usr/share/i18n/charmaps
+CHARMAP=UTF-8
+# locale to generate in /usr/lib/locale
+# glibc/localedef will normalize UTF-8 to utf8, follow the naming style
+LOCALE=$INPUTFILE.utf8
+
+# if locale is already correct, exit
+( locale | grep LC_ALL | grep -i $LOCALE ) && exit 0
+
+# if locale not available, generate locale into /usr/lib/locale
+if ! ( locale --all-locales | grep -i $LOCALE )
+then
+    # no-archive means create its own dir
+    localedef --inputfile $INPUTFILE --charmap $CHARMAP --no-archive $LOCALE
+fi
+
+# update locale conf and global env file
+# set both LC_ALL and LANG for safe
+
+# update conf for Debian family
+FILE=/etc/default/locale
+if [ -f $FILE ]
+then
+    echo LC_ALL="$LOCALE" > $FILE
+    echo LANG="$LOCALE" >> $FILE
+fi
+
+# update conf for RedHat family
+FILE=/etc/locale.conf
+if [ -f $FILE ]
+then
+    # LC_ALL is not valid in this file, set LANG only
+    echo LANG="$LOCALE" > $FILE
+fi
+
+# update global env file
+FILE=/etc/environment
+if [ -f $FILE ]
+then
+    # append LC_ALL if not exist
+    grep LC_ALL $FILE || echo LC_ALL="$LOCALE" >> $FILE
+    # append LANG if not exist
+    grep LANG $FILE || echo LANG="$LOCALE" >> $FILE
+fi
\ No newline at end of file
similarity index 72%
rename from bootstrap/dists/centos7/packages.yml
rename to bootstrap/generated-dists/centos7/packages.yml
index a0c5d8ea3ffba06d709b6d5a0917e5eac756232a..d5048a71d776842c3c906c71f58ddf134771701c 100644 (file)
@@ -1,52 +1,65 @@
 ---
 packages:
   - "@Development Tools"
+  - acl
   - attr
   - autoconf
-  - bind
+  - avahi-devel
   - bind-utils
   - binutils
   - bison
-  - ccache
   - cups-devel
   - curl
   - dbus-devel
   - docbook-dtds
   - docbook-style-xsl
+  - gawk
   - gcc
   - gdb
   - git
+  - glib2-devel
   - glibc-common
   - gnutls-devel
   - gpgme-devel
+  - gzip
+  - hostname
+  - htop
   - jansson-devel
   - keyutils-libs-devel
   - krb5-devel
-  - krb5-workstation
+  - krb5-server
   - libacl-devel
   - libaio-devel
   - libarchive-devel
   - libattr-devel
   - libblkid-devel
   - libbsd-devel
+  - libcap-devel
+  - libicu-devel
   - libnsl2-devel
   - libpcap-devel
   - libsemanage-python
+  - libtasn1-devel
   - libtirpc-devel
-  - libxml2-devel
+  - libunwind-devel
+  - libuuid-devel
   - libxslt
-  - lmdb-devel
+  - lmdb
   - lmdb-devel
   - make
-  - mlocate
   - ncurses-devel
   - nettle-devel
   - openldap-devel
   - pam-devel
+  - patch
+  - perl-Archive-Tar
   - perl-ExtUtils-MakeMaker
+  - perl-JSON-Parse
   - perl-Parse-Yapp
   - perl-Test-Base
   - perl-core
+  - perl-generators
+  - perl-interpreter
   - pkgconfig
   - policycoreutils-python
   - popt-devel
@@ -61,12 +74,17 @@ packages:
   - python3-dns
   - python3-markdown
   - python34-devel
+  - quota-devel
   - readline-devel
   - redhat-lsb
+  - rng-tools
   - rpcgen
+  - rsync
+  - sed
   - sudo
   - systemd-devel
-  - vim
-  - wget
+  - tar
+  - tree
+  - which
   - yum-utils
   - zlib-devel
\ No newline at end of file
diff --git a/bootstrap/generated-dists/debian7/Dockerfile b/bootstrap/generated-dists/debian7/Dockerfile
new file mode 100644 (file)
index 0000000..dfe0e38
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+FROM debian:7
+
+# pass in with --build-arg while build
+ARG SHA1SUM
+RUN [ -n $SHA1SUM ] && echo $SHA1SUM > /sha1sum.txt
+
+ADD *.sh /tmp/
+# need root permission, do it before USER samba
+RUN /tmp/bootstrap.sh && /tmp/locale.sh
+
+# if ld.gold exists, force link it to ld
+RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD"
+
+# make test can not work with root, so we have to create a new user
+RUN useradd -m -U -s /bin/bash samba && \
+    mkdir -p /etc/sudoers.d && \
+    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
+
+USER samba
+WORKDIR /home/samba
+# samba tests rely on this
+ENV USER=samba LC_ALL=en_US.utf8 LANG=en_US.utf8
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
similarity index 64%
rename from bootstrap/dists/debian7/bootstrap.sh
rename to bootstrap/generated-dists/debian7/bootstrap.sh
index 88c076e..a860caf
@@ -1,19 +1,24 @@
 #!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
 set -xueo pipefail
 
 export DEBIAN_FRONTEND=noninteractive
 apt-get -y update
 
 apt-get -y install \
+    acl \
     apt-utils \
     attr \
     autoconf \
-    bind9 \
     bind9utils \
     binutils \
     bison \
     build-essential \
-    ccache \
     curl \
     debhelper \
     dnsutils \
@@ -23,68 +28,76 @@ apt-get -y install \
     gcc \
     gdb \
     git \
-    krb5-kdc \
+    gzip \
+    hostname \
+    htop \
+    krb5-config \
+    krb5-user \
     libacl1-dev \
     libaio-dev \
     libarchive-dev \
     libattr1-dev \
+    libavahi-common-dev \
     libblkid-dev \
     libbsd-dev \
     libcap-dev \
     libcups2-dev \
     libdbus-1-dev \
+    libglib2.0-dev \
     libgnutls-dev \
     libgpgme11-dev \
+    libicu-dev \
     libjansson-dev \
+    libjs-jquery \
     libjson-perl \
     libkrb5-dev \
     libldap2-dev \
     libncurses5-dev \
     libpam0g-dev \
     libparse-yapp-perl \
+    libpcap-dev \
     libpopt-dev \
     libreadline-dev \
-    libxml2-dev \
+    libtasn1-bin \
+    libtasn1-dev \
+    libunwind-dev \
     locales \
-    locate \
-    lsb-core \
+    lsb-release \
     make \
+    mawk \
     nettle-dev \
+    patch \
     perl \
     perl-modules \
     pkg-config \
     procps \
     psmisc \
     python-crypto \
+    python-dbg \
     python-dev \
     python-dnspython \
     python-gpgme \
+    python-iso8601 \
     python-markdown \
+    python-pexpect \
     python3-crypto \
+    python3-dbg \
     python3-dev \
     python3-dnspython \
+    python3-iso8601 \
     python3-markdown \
+    python3-matplotlib \
+    python3-pexpect \
+    rng-tools \
+    rsync \
+    sed \
     sudo \
-    vim \
-    wget \
+    tar \
+    tree \
+    uuid-dev \
     xsltproc \
     zlib1g-dev
 
 apt-get -y autoremove
 apt-get -y autoclean
-apt-get -y clean
-
-# uncomment locale
-# this file doesn't exist on ubuntu1404 even locales installed
-if [ -f /etc/locale.gen ]; then
-    sed -i '/^#\s*en_US.UTF-8 UTF-8/s/^#\s*//' /etc/locale.gen
-fi
-
-locale-gen
-
-# update /etc/default/locale
-update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
-
-# set both for safe
-echo LC_ALL="en_US.UTF-8" >> /etc/environment
-echo LANG="en_US.UTF-8" >> /etc/environment
\ No newline at end of file
+apt-get -y clean
\ No newline at end of file
diff --git a/bootstrap/generated-dists/debian7/locale.sh b/bootstrap/generated-dists/debian7/locale.sh
new file mode 100755 (executable)
index 0000000..cc64e18
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+set -xueo pipefail
+
+# refer to /usr/share/i18n/locales
+INPUTFILE=en_US
+# refer to /usr/share/i18n/charmaps
+CHARMAP=UTF-8
+# locale to generate in /usr/lib/locale
+# glibc/localedef will normalize UTF-8 to utf8, follow the naming style
+LOCALE=$INPUTFILE.utf8
+
+# if locale is already correct, exit
+( locale | grep LC_ALL | grep -i $LOCALE ) && exit 0
+
+# if locale not available, generate locale into /usr/lib/locale
+if ! ( locale --all-locales | grep -i $LOCALE )
+then
+    # no-archive means create its own dir
+    localedef --inputfile $INPUTFILE --charmap $CHARMAP --no-archive $LOCALE
+fi
+
+# update locale conf and global env file
+# set both LC_ALL and LANG for safe
+
+# update conf for Debian family
+FILE=/etc/default/locale
+if [ -f $FILE ]
+then
+    echo LC_ALL="$LOCALE" > $FILE
+    echo LANG="$LOCALE" >> $FILE
+fi
+
+# update conf for RedHat family
+FILE=/etc/locale.conf
+if [ -f $FILE ]
+then
+    # LC_ALL is not valid in this file, set LANG only
+    echo LANG="$LOCALE" > $FILE
+fi
+
+# update global env file
+FILE=/etc/environment
+if [ -f $FILE ]
+then
+    # append LC_ALL if not exist
+    grep LC_ALL $FILE || echo LC_ALL="$LOCALE" >> $FILE
+    # append LANG if not exist
+    grep LANG $FILE || echo LANG="$LOCALE" >> $FILE
+fi
\ No newline at end of file
similarity index 65%
rename from bootstrap/dists/debian7/packages.yml
rename to bootstrap/generated-dists/debian7/packages.yml
index 6a025c79931a2e8d8f23ee5a1a479c452a453ffa..80ddb1d2dbd5559b49bd2edbcb7b278ef28ebf8a 100644 (file)
@@ -1,14 +1,13 @@
 ---
 packages:
+  - acl
   - apt-utils
   - attr
   - autoconf
-  - bind9
   - bind9utils
   - binutils
   - bison
   - build-essential
-  - ccache
   - curl
   - debhelper
   - dnsutils
@@ -18,49 +17,72 @@ packages:
   - gcc
   - gdb
   - git
-  - krb5-kdc
+  - gzip
+  - hostname
+  - htop
+  - krb5-config
+  - krb5-user
   - libacl1-dev
   - libaio-dev
   - libarchive-dev
   - libattr1-dev
+  - libavahi-common-dev
   - libblkid-dev
   - libbsd-dev
   - libcap-dev
   - libcups2-dev
   - libdbus-1-dev
+  - libglib2.0-dev
   - libgnutls-dev
   - libgpgme11-dev
+  - libicu-dev
   - libjansson-dev
+  - libjs-jquery
   - libjson-perl
   - libkrb5-dev
   - libldap2-dev
   - libncurses5-dev
   - libpam0g-dev
   - libparse-yapp-perl
+  - libpcap-dev
   - libpopt-dev
   - libreadline-dev
-  - libxml2-dev
+  - libtasn1-bin
+  - libtasn1-dev
+  - libunwind-dev
   - locales
-  - locate
-  - lsb-core
+  - lsb-release
   - make
+  - mawk
   - nettle-dev
+  - patch
   - perl
   - perl-modules
   - pkg-config
   - procps
   - psmisc
   - python-crypto
+  - python-dbg
   - python-dev
   - python-dnspython
   - python-gpgme
+  - python-iso8601
   - python-markdown
+  - python-pexpect
   - python3-crypto
+  - python3-dbg
   - python3-dev
   - python3-dnspython
+  - python3-iso8601
   - python3-markdown
+  - python3-matplotlib
+  - python3-pexpect
+  - rng-tools
+  - rsync
+  - sed
   - sudo
-  - vim
-  - wget
+  - tar
+  - tree
+  - uuid-dev
   - xsltproc
   - zlib1g-dev
\ No newline at end of file
diff --git a/bootstrap/generated-dists/debian8/Dockerfile b/bootstrap/generated-dists/debian8/Dockerfile
new file mode 100644 (file)
index 0000000..a5a3565
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+FROM debian:8
+
+# pass in with --build-arg while build
+ARG SHA1SUM
+RUN [ -n $SHA1SUM ] && echo $SHA1SUM > /sha1sum.txt
+
+ADD *.sh /tmp/
+# need root permission, do it before USER samba
+RUN /tmp/bootstrap.sh && /tmp/locale.sh
+
+# if ld.gold exists, force link it to ld
+RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD"
+
+# make test can not work with root, so we have to create a new user
+RUN useradd -m -U -s /bin/bash samba && \
+    mkdir -p /etc/sudoers.d && \
+    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
+
+USER samba
+WORKDIR /home/samba
+# samba tests rely on this
+ENV USER=samba LC_ALL=en_US.utf8 LANG=en_US.utf8
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
similarity index 66%
rename from bootstrap/dists/debian8/bootstrap.sh
rename to bootstrap/generated-dists/debian8/bootstrap.sh
index 3bf9a6b..5194507
@@ -1,19 +1,24 @@
 #!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
 set -xueo pipefail
 
 export DEBIAN_FRONTEND=noninteractive
 apt-get -y update
 
 apt-get -y install \
+    acl \
     apt-utils \
     attr \
     autoconf \
-    bind9 \
     bind9utils \
     binutils \
     bison \
     build-essential \
-    ccache \
     curl \
     debhelper \
     dnsutils \
@@ -23,19 +28,27 @@ apt-get -y install \
     gcc \
     gdb \
     git \
-    krb5-kdc \
+    gzip \
+    hostname \
+    htop \
+    krb5-config \
+    krb5-user \
     libacl1-dev \
     libaio-dev \
     libarchive-dev \
     libattr1-dev \
+    libavahi-common-dev \
     libblkid-dev \
     libbsd-dev \
     libcap-dev \
     libcups2-dev \
     libdbus-1-dev \
+    libglib2.0-dev \
     libgnutls28-dev \
     libgpgme11-dev \
+    libicu-dev \
     libjansson-dev \
+    libjs-jquery \
     libjson-perl \
     libkrb5-dev \
     libldap2-dev \
@@ -43,52 +56,52 @@ apt-get -y install \
     libncurses5-dev \
     libpam0g-dev \
     libparse-yapp-perl \
+    libpcap-dev \
     libpopt-dev \
     libreadline-dev \
     libsystemd-dev \
-    libxml2-dev \
+    libtasn1-bin \
+    libtasn1-dev \
+    libunwind-dev \
     lmdb-utils \
     locales \
-    locate \
-    lsb-core \
+    lsb-release \
     make \
+    mawk \
     nettle-dev \
+    patch \
     perl \
     perl-modules \
     pkg-config \
     procps \
     psmisc \
     python-crypto \
+    python-dbg \
     python-dev \
     python-dnspython \
     python-gpgme \
+    python-iso8601 \
     python-markdown \
+    python-pexpect \
     python3-crypto \
+    python3-dbg \
     python3-dev \
     python3-dnspython \
     python3-gpgme \
+    python3-iso8601 \
     python3-markdown \
+    python3-matplotlib \
+    python3-pexpect \
+    rng-tools \
+    rsync \
+    sed \
     sudo \
-    vim \
-    wget \
+    tar \
+    tree \
+    uuid-dev \
     xsltproc \
     zlib1g-dev
 
 apt-get -y autoremove
 apt-get -y autoclean
-apt-get -y clean
-
-# uncomment locale
-# this file doesn't exist on ubuntu1404 even locales installed
-if [ -f /etc/locale.gen ]; then
-    sed -i '/^#\s*en_US.UTF-8 UTF-8/s/^#\s*//' /etc/locale.gen
-fi
-
-locale-gen
-
-# update /etc/default/locale
-update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
-
-# set both for safe
-echo LC_ALL="en_US.UTF-8" >> /etc/environment
-echo LANG="en_US.UTF-8" >> /etc/environment
\ No newline at end of file
+apt-get -y clean
\ No newline at end of file
diff --git a/bootstrap/generated-dists/debian8/locale.sh b/bootstrap/generated-dists/debian8/locale.sh
new file mode 100755 (executable)
index 0000000..cc64e18
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+set -xueo pipefail
+
+# refer to /usr/share/i18n/locales
+INPUTFILE=en_US
+# refer to /usr/share/i18n/charmaps
+CHARMAP=UTF-8
+# locale to generate in /usr/lib/locale
+# glibc/localedef will normalize UTF-8 to utf8, follow the naming style
+LOCALE=$INPUTFILE.utf8
+
+# if locale is already correct, exit
+( locale | grep LC_ALL | grep -i $LOCALE ) && exit 0
+
+# if locale not available, generate locale into /usr/lib/locale
+if ! ( locale --all-locales | grep -i $LOCALE )
+then
+    # no-archive means create its own dir
+    localedef --inputfile $INPUTFILE --charmap $CHARMAP --no-archive $LOCALE
+fi
+
+# update locale conf and global env file
+# set both LC_ALL and LANG for safe
+
+# update conf for Debian family
+FILE=/etc/default/locale
+if [ -f $FILE ]
+then
+    echo LC_ALL="$LOCALE" > $FILE
+    echo LANG="$LOCALE" >> $FILE
+fi
+
+# update conf for RedHat family
+FILE=/etc/locale.conf
+if [ -f $FILE ]
+then
+    # LC_ALL is not valid in this file, set LANG only
+    echo LANG="$LOCALE" > $FILE
+fi
+
+# update global env file
+FILE=/etc/environment
+if [ -f $FILE ]
+then
+    # append LC_ALL if not exist
+    grep LC_ALL $FILE || echo LC_ALL="$LOCALE" >> $FILE
+    # append LANG if not exist
+    grep LANG $FILE || echo LANG="$LOCALE" >> $FILE
+fi
\ No newline at end of file
similarity index 66%
rename from bootstrap/dists/debian8/packages.yml
rename to bootstrap/generated-dists/debian8/packages.yml
index 7158835d45e30db0471276dec36f3291bb7f80b5..5655fb57d7c02ae034c29dc85930debef7e809ed 100644 (file)
@@ -1,14 +1,13 @@
 ---
 packages:
+  - acl
   - apt-utils
   - attr
   - autoconf
-  - bind9
   - bind9utils
   - binutils
   - bison
   - build-essential
-  - ccache
   - curl
   - debhelper
   - dnsutils
@@ -18,19 +17,27 @@ packages:
   - gcc
   - gdb
   - git
-  - krb5-kdc
+  - gzip
+  - hostname
+  - htop
+  - krb5-config
+  - krb5-user
   - libacl1-dev
   - libaio-dev
   - libarchive-dev
   - libattr1-dev
+  - libavahi-common-dev
   - libblkid-dev
   - libbsd-dev
   - libcap-dev
   - libcups2-dev
   - libdbus-1-dev
+  - libglib2.0-dev
   - libgnutls28-dev
   - libgpgme11-dev
+  - libicu-dev
   - libjansson-dev
+  - libjs-jquery
   - libjson-perl
   - libkrb5-dev
   - libldap2-dev
@@ -38,33 +45,48 @@ packages:
   - libncurses5-dev
   - libpam0g-dev
   - libparse-yapp-perl
+  - libpcap-dev
   - libpopt-dev
   - libreadline-dev
   - libsystemd-dev
-  - libxml2-dev
+  - libtasn1-bin
+  - libtasn1-dev
+  - libunwind-dev
   - lmdb-utils
   - locales
-  - locate
-  - lsb-core
+  - lsb-release
   - make
+  - mawk
   - nettle-dev
+  - patch
   - perl
   - perl-modules
   - pkg-config
   - procps
   - psmisc
   - python-crypto
+  - python-dbg
   - python-dev
   - python-dnspython
   - python-gpgme
+  - python-iso8601
   - python-markdown
+  - python-pexpect
   - python3-crypto
+  - python3-dbg
   - python3-dev
   - python3-dnspython
   - python3-gpgme
+  - python3-iso8601
   - python3-markdown
+  - python3-matplotlib
+  - python3-pexpect
+  - rng-tools
+  - rsync
+  - sed
   - sudo
-  - vim
-  - wget
+  - tar
+  - tree
+  - uuid-dev
   - xsltproc
   - zlib1g-dev
\ No newline at end of file
diff --git a/bootstrap/generated-dists/debian9/Dockerfile b/bootstrap/generated-dists/debian9/Dockerfile
new file mode 100644 (file)
index 0000000..5019529
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+FROM debian:9
+
+# pass in with --build-arg while build
+ARG SHA1SUM
+RUN [ -n $SHA1SUM ] && echo $SHA1SUM > /sha1sum.txt
+
+ADD *.sh /tmp/
+# need root permission, do it before USER samba
+RUN /tmp/bootstrap.sh && /tmp/locale.sh
+
+# if ld.gold exists, force link it to ld
+RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD"
+
+# make test can not work with root, so we have to create a new user
+RUN useradd -m -U -s /bin/bash samba && \
+    mkdir -p /etc/sudoers.d && \
+    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
+
+USER samba
+WORKDIR /home/samba
+# samba tests rely on this
+ENV USER=samba LC_ALL=en_US.utf8 LANG=en_US.utf8
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
similarity index 66%
rename from bootstrap/dists/debian9/bootstrap.sh
rename to bootstrap/generated-dists/debian9/bootstrap.sh
index 4ecad38..a765307
@@ -1,19 +1,24 @@
 #!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
 set -xueo pipefail
 
 export DEBIAN_FRONTEND=noninteractive
 apt-get -y update
 
 apt-get -y install \
+    acl \
     apt-utils \
     attr \
     autoconf \
-    bind9 \
     bind9utils \
     binutils \
     bison \
     build-essential \
-    ccache \
     curl \
     debhelper \
     dnsutils \
@@ -23,19 +28,27 @@ apt-get -y install \
     gcc \
     gdb \
     git \
-    krb5-kdc \
+    gzip \
+    hostname \
+    htop \
+    krb5-config \
+    krb5-user \
     libacl1-dev \
     libaio-dev \
     libarchive-dev \
     libattr1-dev \
+    libavahi-common-dev \
     libblkid-dev \
     libbsd-dev \
     libcap-dev \
     libcups2-dev \
     libdbus-1-dev \
+    libglib2.0-dev \
     libgnutls28-dev \
     libgpgme11-dev \
+    libicu-dev \
     libjansson-dev \
+    libjs-jquery \
     libjson-perl \
     libkrb5-dev \
     libldap2-dev \
@@ -43,52 +56,52 @@ apt-get -y install \
     libncurses5-dev \
     libpam0g-dev \
     libparse-yapp-perl \
+    libpcap-dev \
     libpopt-dev \
     libreadline-dev \
     libsystemd-dev \
-    libxml2-dev \
+    libtasn1-bin \
+    libtasn1-dev \
+    libunwind-dev \
     lmdb-utils \
     locales \
-    locate \
-    lsb-core \
+    lsb-release \
     make \
+    mawk \
     nettle-dev \
+    patch \
     perl \
     perl-modules \
     pkg-config \
     procps \
     psmisc \
     python-crypto \
+    python-dbg \
     python-dev \
     python-dnspython \
     python-gpg \
+    python-iso8601 \
     python-markdown \
+    python-pexpect \
     python3-crypto \
+    python3-dbg \
     python3-dev \
     python3-dnspython \
     python3-gpg \
+    python3-iso8601 \
     python3-markdown \
+    python3-matplotlib \
+    python3-pexpect \
+    rng-tools \
+    rsync \
+    sed \
     sudo \
-    vim \
-    wget \
+    tar \
+    tree \
+    uuid-dev \
     xsltproc \
     zlib1g-dev
 
 apt-get -y autoremove
 apt-get -y autoclean
-apt-get -y clean
-
-# uncomment locale
-# this file doesn't exist on ubuntu1404 even locales installed
-if [ -f /etc/locale.gen ]; then
-    sed -i '/^#\s*en_US.UTF-8 UTF-8/s/^#\s*//' /etc/locale.gen
-fi
-
-locale-gen
-
-# update /etc/default/locale
-update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
-
-# set both for safe
-echo LC_ALL="en_US.UTF-8" >> /etc/environment
-echo LANG="en_US.UTF-8" >> /etc/environment
\ No newline at end of file
+apt-get -y clean
\ No newline at end of file
diff --git a/bootstrap/generated-dists/debian9/locale.sh b/bootstrap/generated-dists/debian9/locale.sh
new file mode 100755 (executable)
index 0000000..cc64e18
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+set -xueo pipefail
+
+# refer to /usr/share/i18n/locales
+INPUTFILE=en_US
+# refer to /usr/share/i18n/charmaps
+CHARMAP=UTF-8
+# locale to generate in /usr/lib/locale
+# glibc/localedef will normalize UTF-8 to utf8, follow the naming style
+LOCALE=$INPUTFILE.utf8
+
+# if locale is already correct, exit
+( locale | grep LC_ALL | grep -i $LOCALE ) && exit 0
+
+# if locale not available, generate locale into /usr/lib/locale
+if ! ( locale --all-locales | grep -i $LOCALE )
+then
+    # no-archive means create its own dir
+    localedef --inputfile $INPUTFILE --charmap $CHARMAP --no-archive $LOCALE
+fi
+
+# update locale conf and global env file
+# set both LC_ALL and LANG for safe
+
+# update conf for Debian family
+FILE=/etc/default/locale
+if [ -f $FILE ]
+then
+    echo LC_ALL="$LOCALE" > $FILE
+    echo LANG="$LOCALE" >> $FILE
+fi
+
+# update conf for RedHat family
+FILE=/etc/locale.conf
+if [ -f $FILE ]
+then
+    # LC_ALL is not valid in this file, set LANG only
+    echo LANG="$LOCALE" > $FILE
+fi
+
+# update global env file
+FILE=/etc/environment
+if [ -f $FILE ]
+then
+    # append LC_ALL if not exist
+    grep LC_ALL $FILE || echo LC_ALL="$LOCALE" >> $FILE
+    # append LANG if not exist
+    grep LANG $FILE || echo LANG="$LOCALE" >> $FILE
+fi
\ No newline at end of file
similarity index 66%
rename from bootstrap/dists/debian9/packages.yml
rename to bootstrap/generated-dists/debian9/packages.yml
index 8ef21ba81b221c82940a311be4fd685be3eeef4e..b4e2013eb47ab8373ebecf337520e7a665bae29f 100644 (file)
@@ -1,14 +1,13 @@
 ---
 packages:
+  - acl
   - apt-utils
   - attr
   - autoconf
-  - bind9
   - bind9utils
   - binutils
   - bison
   - build-essential
-  - ccache
   - curl
   - debhelper
   - dnsutils
@@ -18,19 +17,27 @@ packages:
   - gcc
   - gdb
   - git
-  - krb5-kdc
+  - gzip
+  - hostname
+  - htop
+  - krb5-config
+  - krb5-user
   - libacl1-dev
   - libaio-dev
   - libarchive-dev
   - libattr1-dev
+  - libavahi-common-dev
   - libblkid-dev
   - libbsd-dev
   - libcap-dev
   - libcups2-dev
   - libdbus-1-dev
+  - libglib2.0-dev
   - libgnutls28-dev
   - libgpgme11-dev
+  - libicu-dev
   - libjansson-dev
+  - libjs-jquery
   - libjson-perl
   - libkrb5-dev
   - libldap2-dev
@@ -38,33 +45,48 @@ packages:
   - libncurses5-dev
   - libpam0g-dev
   - libparse-yapp-perl
+  - libpcap-dev
   - libpopt-dev
   - libreadline-dev
   - libsystemd-dev
-  - libxml2-dev
+  - libtasn1-bin
+  - libtasn1-dev
+  - libunwind-dev
   - lmdb-utils
   - locales
-  - locate
-  - lsb-core
+  - lsb-release
   - make
+  - mawk
   - nettle-dev
+  - patch
   - perl
   - perl-modules
   - pkg-config
   - procps
   - psmisc
   - python-crypto
+  - python-dbg
   - python-dev
   - python-dnspython
   - python-gpg
+  - python-iso8601
   - python-markdown
+  - python-pexpect
   - python3-crypto
+  - python3-dbg
   - python3-dev
   - python3-dnspython
   - python3-gpg
+  - python3-iso8601
   - python3-markdown
+  - python3-matplotlib
+  - python3-pexpect
+  - rng-tools
+  - rsync
+  - sed
   - sudo
-  - vim
-  - wget
+  - tar
+  - tree
+  - uuid-dev
   - xsltproc
   - zlib1g-dev
\ No newline at end of file
diff --git a/bootstrap/generated-dists/fedora28/Dockerfile b/bootstrap/generated-dists/fedora28/Dockerfile
new file mode 100644 (file)
index 0000000..4d25691
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+FROM fedora:28
+
+# pass in with --build-arg while build
+ARG SHA1SUM
+RUN [ -n $SHA1SUM ] && echo $SHA1SUM > /sha1sum.txt
+
+ADD *.sh /tmp/
+# need root permission, do it before USER samba
+RUN /tmp/bootstrap.sh && /tmp/locale.sh
+
+# if ld.gold exists, force link it to ld
+RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD"
+
+# make test can not work with root, so we have to create a new user
+RUN useradd -m -U -s /bin/bash samba && \
+    mkdir -p /etc/sudoers.d && \
+    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
+
+USER samba
+WORKDIR /home/samba
+# samba tests rely on this
+ENV USER=samba LC_ALL=en_US.utf8 LANG=en_US.utf8
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
similarity index 70%
rename from bootstrap/dists/fedora29/bootstrap.sh
rename to bootstrap/generated-dists/fedora28/bootstrap.sh
index 8500cb5..ec1fdff
@@ -1,58 +1,76 @@
 #!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
 set -xueo pipefail
 
 dnf -y -q update
 
 dnf -y -q --verbose install \
     @development-tools \
+    acl \
     attr \
     autoconf \
-    bind \
+    avahi-devel \
     bind-utils \
     binutils \
     bison \
-    ccache \
     cups-devel \
     curl \
     dbus-devel \
     docbook-dtds \
     docbook-style-xsl \
+    gawk \
     gcc \
     gdb \
     git \
+    glib2-devel \
     glibc-common \
     glibc-langpack-en \
-    glibc-locale-source \
     gnutls-devel \
     gpgme-devel \
+    gzip \
+    hostname \
+    htop \
     jansson-devel \
     keyutils-libs-devel \
     krb5-devel \
-    krb5-workstation \
+    krb5-server \
     libacl-devel \
     libaio-devel \
     libarchive-devel \
     libattr-devel \
     libblkid-devel \
     libbsd-devel \
+    libcap-devel \
+    libicu-devel \
     libnsl2-devel \
     libpcap-devel \
     libsemanage-python \
+    libtasn1-devel \
     libtirpc-devel \
-    libxml2-devel \
+    libunwind-devel \
+    libuuid-devel \
     libxslt \
-    lmdb-devel \
+    lmdb \
     lmdb-devel \
     make \
-    mlocate \
     ncurses-devel \
     nettle-devel \
     openldap-devel \
     pam-devel \
+    patch \
     perl \
+    perl-Archive-Tar \
     perl-ExtUtils-MakeMaker \
+    perl-JSON-Parse \
     perl-Parse-Yapp \
     perl-Test-Base \
+    perl-generators \
+    perl-interpreter \
     pkgconfig \
     policycoreutils-python \
     popt-devel \
@@ -68,25 +86,19 @@ dnf -y -q --verbose install \
     python3-dns \
     python3-gpg \
     python3-markdown \
+    quota-devel \
     readline-devel \
     redhat-lsb \
+    rng-tools \
     rpcgen \
+    rsync \
+    sed \
     sudo \
     systemd-devel \
-    vim \
-    wget \
+    tar \
+    tree \
+    which \
     yum-utils \
     zlib-devel
 
-dnf clean all
-
-# gen locale
-localedef -c -i en_US -f UTF-8 en_US.UTF-8
-
-# no update-locale, diy
-# LC_ALL is not valid in this file
-echo LANG="en_US.UTF-8" > /etc/locale.conf
-
-# set both for safe
-echo LC_ALL="en_US.UTF-8" >> /etc/environment
-echo LANG="en_US.UTF-8" >> /etc/environment
\ No newline at end of file
+dnf clean all
\ No newline at end of file
diff --git a/bootstrap/generated-dists/fedora28/locale.sh b/bootstrap/generated-dists/fedora28/locale.sh
new file mode 100755 (executable)
index 0000000..cc64e18
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+set -xueo pipefail
+
+# refer to /usr/share/i18n/locales
+INPUTFILE=en_US
+# refer to /usr/share/i18n/charmaps
+CHARMAP=UTF-8
+# locale to generate in /usr/lib/locale
+# glibc/localedef will normalize UTF-8 to utf8, follow the naming style
+LOCALE=$INPUTFILE.utf8
+
+# if locale is already correct, exit
+( locale | grep LC_ALL | grep -i $LOCALE ) && exit 0
+
+# if locale not available, generate locale into /usr/lib/locale
+if ! ( locale --all-locales | grep -i $LOCALE )
+then
+    # no-archive means create its own dir
+    localedef --inputfile $INPUTFILE --charmap $CHARMAP --no-archive $LOCALE
+fi
+
+# update locale conf and global env file
+# set both LC_ALL and LANG for safe
+
+# update conf for Debian family
+FILE=/etc/default/locale
+if [ -f $FILE ]
+then
+    echo LC_ALL="$LOCALE" > $FILE
+    echo LANG="$LOCALE" >> $FILE
+fi
+
+# update conf for RedHat family
+FILE=/etc/locale.conf
+if [ -f $FILE ]
+then
+    # LC_ALL is not valid in this file, set LANG only
+    echo LANG="$LOCALE" > $FILE
+fi
+
+# update global env file
+FILE=/etc/environment
+if [ -f $FILE ]
+then
+    # append LC_ALL if not exist
+    grep LC_ALL $FILE || echo LC_ALL="$LOCALE" >> $FILE
+    # append LANG if not exist
+    grep LANG $FILE || echo LANG="$LOCALE" >> $FILE
+fi
\ No newline at end of file
similarity index 73%
rename from bootstrap/dists/fedora29/packages.yml
rename to bootstrap/generated-dists/fedora28/packages.yml
index 241d1991d572c671a85a7c0d8dd36491affe879a..40cc9e74abb4fab91a455a2a3b79ae09aefef774 100644 (file)
@@ -1,54 +1,66 @@
 ---
 packages:
   - @development-tools
+  - acl
   - attr
   - autoconf
-  - bind
+  - avahi-devel
   - bind-utils
   - binutils
   - bison
-  - ccache
   - cups-devel
   - curl
   - dbus-devel
   - docbook-dtds
   - docbook-style-xsl
+  - gawk
   - gcc
   - gdb
   - git
+  - glib2-devel
   - glibc-common
   - glibc-langpack-en
-  - glibc-locale-source
   - gnutls-devel
   - gpgme-devel
+  - gzip
+  - hostname
+  - htop
   - jansson-devel
   - keyutils-libs-devel
   - krb5-devel
-  - krb5-workstation
+  - krb5-server
   - libacl-devel
   - libaio-devel
   - libarchive-devel
   - libattr-devel
   - libblkid-devel
   - libbsd-devel
+  - libcap-devel
+  - libicu-devel
   - libnsl2-devel
   - libpcap-devel
   - libsemanage-python
+  - libtasn1-devel
   - libtirpc-devel
-  - libxml2-devel
+  - libunwind-devel
+  - libuuid-devel
   - libxslt
-  - lmdb-devel
+  - lmdb
   - lmdb-devel
   - make
-  - mlocate
   - ncurses-devel
   - nettle-devel
   - openldap-devel
   - pam-devel
+  - patch
   - perl
+  - perl-Archive-Tar
   - perl-ExtUtils-MakeMaker
+  - perl-JSON-Parse
   - perl-Parse-Yapp
   - perl-Test-Base
+  - perl-generators
+  - perl-interpreter
   - pkgconfig
   - policycoreutils-python
   - popt-devel
@@ -64,12 +76,17 @@ packages:
   - python3-dns
   - python3-gpg
   - python3-markdown
+  - quota-devel
   - readline-devel
   - redhat-lsb
+  - rng-tools
   - rpcgen
+  - rsync
+  - sed
   - sudo
   - systemd-devel
-  - vim
-  - wget
+  - tar
+  - tree
+  - which
   - yum-utils
   - zlib-devel
\ No newline at end of file
diff --git a/bootstrap/generated-dists/fedora29/Dockerfile b/bootstrap/generated-dists/fedora29/Dockerfile
new file mode 100644 (file)
index 0000000..268c79d
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+FROM fedora:29
+
+# pass in with --build-arg while build
+ARG SHA1SUM
+RUN [ -n $SHA1SUM ] && echo $SHA1SUM > /sha1sum.txt
+
+ADD *.sh /tmp/
+# need root permission, do it before USER samba
+RUN /tmp/bootstrap.sh && /tmp/locale.sh
+
+# if ld.gold exists, force link it to ld
+RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD"
+
+# make test can not work with root, so we have to create a new user
+RUN useradd -m -U -s /bin/bash samba && \
+    mkdir -p /etc/sudoers.d && \
+    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
+
+USER samba
+WORKDIR /home/samba
+# samba tests rely on this
+ENV USER=samba LC_ALL=en_US.utf8 LANG=en_US.utf8
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
similarity index 70%
rename from bootstrap/dists/fedora28/bootstrap.sh
rename to bootstrap/generated-dists/fedora29/bootstrap.sh
index 8500cb5..ec1fdff
@@ -1,58 +1,76 @@
 #!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
 set -xueo pipefail
 
 dnf -y -q update
 
 dnf -y -q --verbose install \
     @development-tools \
+    acl \
     attr \
     autoconf \
-    bind \
+    avahi-devel \
     bind-utils \
     binutils \
     bison \
-    ccache \
     cups-devel \
     curl \
     dbus-devel \
     docbook-dtds \
     docbook-style-xsl \
+    gawk \
     gcc \
     gdb \
     git \
+    glib2-devel \
     glibc-common \
     glibc-langpack-en \
-    glibc-locale-source \
     gnutls-devel \
     gpgme-devel \
+    gzip \
+    hostname \
+    htop \
     jansson-devel \
     keyutils-libs-devel \
     krb5-devel \
-    krb5-workstation \
+    krb5-server \
     libacl-devel \
     libaio-devel \
     libarchive-devel \
     libattr-devel \
     libblkid-devel \
     libbsd-devel \
+    libcap-devel \
+    libicu-devel \
     libnsl2-devel \
     libpcap-devel \
     libsemanage-python \
+    libtasn1-devel \
     libtirpc-devel \
-    libxml2-devel \
+    libunwind-devel \
+    libuuid-devel \
     libxslt \
-    lmdb-devel \
+    lmdb \
     lmdb-devel \
     make \
-    mlocate \
     ncurses-devel \
     nettle-devel \
     openldap-devel \
     pam-devel \
+    patch \
     perl \
+    perl-Archive-Tar \
     perl-ExtUtils-MakeMaker \
+    perl-JSON-Parse \
     perl-Parse-Yapp \
     perl-Test-Base \
+    perl-generators \
+    perl-interpreter \
     pkgconfig \
     policycoreutils-python \
     popt-devel \
@@ -68,25 +86,19 @@ dnf -y -q --verbose install \
     python3-dns \
     python3-gpg \
     python3-markdown \
+    quota-devel \
     readline-devel \
     redhat-lsb \
+    rng-tools \
     rpcgen \
+    rsync \
+    sed \
     sudo \
     systemd-devel \
-    vim \
-    wget \
+    tar \
+    tree \
+    which \
     yum-utils \
     zlib-devel
 
-dnf clean all
-
-# gen locale
-localedef -c -i en_US -f UTF-8 en_US.UTF-8
-
-# no update-locale, diy
-# LC_ALL is not valid in this file
-echo LANG="en_US.UTF-8" > /etc/locale.conf
-
-# set both for safe
-echo LC_ALL="en_US.UTF-8" >> /etc/environment
-echo LANG="en_US.UTF-8" >> /etc/environment
\ No newline at end of file
+dnf clean all
\ No newline at end of file
diff --git a/bootstrap/generated-dists/fedora29/locale.sh b/bootstrap/generated-dists/fedora29/locale.sh
new file mode 100755 (executable)
index 0000000..cc64e18
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+set -xueo pipefail
+
+# refer to /usr/share/i18n/locales
+INPUTFILE=en_US
+# refer to /usr/share/i18n/charmaps
+CHARMAP=UTF-8
+# locale to generate in /usr/lib/locale
+# glibc/localedef will normalize UTF-8 to utf8, follow the naming style
+LOCALE=$INPUTFILE.utf8
+
+# if locale is already correct, exit
+( locale | grep LC_ALL | grep -i $LOCALE ) && exit 0
+
+# if locale not available, generate locale into /usr/lib/locale
+if ! ( locale --all-locales | grep -i $LOCALE )
+then
+    # no-archive means create its own dir
+    localedef --inputfile $INPUTFILE --charmap $CHARMAP --no-archive $LOCALE
+fi
+
+# update locale conf and global env file
+# set both LC_ALL and LANG for safe
+
+# update conf for Debian family
+FILE=/etc/default/locale
+if [ -f $FILE ]
+then
+    echo LC_ALL="$LOCALE" > $FILE
+    echo LANG="$LOCALE" >> $FILE
+fi
+
+# update conf for RedHat family
+FILE=/etc/locale.conf
+if [ -f $FILE ]
+then
+    # LC_ALL is not valid in this file, set LANG only
+    echo LANG="$LOCALE" > $FILE
+fi
+
+# update global env file
+FILE=/etc/environment
+if [ -f $FILE ]
+then
+    # append LC_ALL if not exist
+    grep LC_ALL $FILE || echo LC_ALL="$LOCALE" >> $FILE
+    # append LANG if not exist
+    grep LANG $FILE || echo LANG="$LOCALE" >> $FILE
+fi
\ No newline at end of file
similarity index 73%
rename from bootstrap/dists/fedora28/packages.yml
rename to bootstrap/generated-dists/fedora29/packages.yml
index 241d1991d572c671a85a7c0d8dd36491affe879a..40cc9e74abb4fab91a455a2a3b79ae09aefef774 100644 (file)
@@ -1,54 +1,66 @@
 ---
 packages:
   - @development-tools
+  - acl
   - attr
   - autoconf
-  - bind
+  - avahi-devel
   - bind-utils
   - binutils
   - bison
-  - ccache
   - cups-devel
   - curl
   - dbus-devel
   - docbook-dtds
   - docbook-style-xsl
+  - gawk
   - gcc
   - gdb
   - git
+  - glib2-devel
   - glibc-common
   - glibc-langpack-en
-  - glibc-locale-source
   - gnutls-devel
   - gpgme-devel
+  - gzip
+  - hostname
+  - htop
   - jansson-devel
   - keyutils-libs-devel
   - krb5-devel
-  - krb5-workstation
+  - krb5-server
   - libacl-devel
   - libaio-devel
   - libarchive-devel
   - libattr-devel
   - libblkid-devel
   - libbsd-devel
+  - libcap-devel
+  - libicu-devel
   - libnsl2-devel
   - libpcap-devel
   - libsemanage-python
+  - libtasn1-devel
   - libtirpc-devel
-  - libxml2-devel
+  - libunwind-devel
+  - libuuid-devel
   - libxslt
-  - lmdb-devel
+  - lmdb
   - lmdb-devel
   - make
-  - mlocate
   - ncurses-devel
   - nettle-devel
   - openldap-devel
   - pam-devel
+  - patch
   - perl
+  - perl-Archive-Tar
   - perl-ExtUtils-MakeMaker
+  - perl-JSON-Parse
   - perl-Parse-Yapp
   - perl-Test-Base
+  - perl-generators
+  - perl-interpreter
   - pkgconfig
   - policycoreutils-python
   - popt-devel
@@ -64,12 +76,17 @@ packages:
   - python3-dns
   - python3-gpg
   - python3-markdown
+  - quota-devel
   - readline-devel
   - redhat-lsb
+  - rng-tools
   - rpcgen
+  - rsync
+  - sed
   - sudo
   - systemd-devel
-  - vim
-  - wget
+  - tar
+  - tree
+  - which
   - yum-utils
   - zlib-devel
\ No newline at end of file
diff --git a/bootstrap/generated-dists/opensuse150/Dockerfile b/bootstrap/generated-dists/opensuse150/Dockerfile
new file mode 100644 (file)
index 0000000..fc8740b
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+FROM opensuse/leap:15.0
+
+# pass in with --build-arg while build
+ARG SHA1SUM
+RUN [ -n $SHA1SUM ] && echo $SHA1SUM > /sha1sum.txt
+
+ADD *.sh /tmp/
+# need root permission, do it before USER samba
+RUN /tmp/bootstrap.sh && /tmp/locale.sh
+
+# if ld.gold exists, force link it to ld
+RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD"
+
+# make test can not work with root, so we have to create a new user
+RUN useradd -m -U -s /bin/bash samba && \
+    mkdir -p /etc/sudoers.d && \
+    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
+
+USER samba
+WORKDIR /home/samba
+# samba tests rely on this
+ENV USER=samba LC_ALL=en_US.utf8 LANG=en_US.utf8
\ No newline at end of file
diff --git a/bootstrap/generated-dists/opensuse150/bootstrap.sh b/bootstrap/generated-dists/opensuse150/bootstrap.sh
new file mode 100755 (executable)
index 0000000..06f3ca6
--- /dev/null
@@ -0,0 +1,104 @@
+#!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+set -xueo pipefail
+
+zypper --non-interactive refresh
+zypper --non-interactive update
+zypper --non-interactive install \
+    acl \
+    attr \
+    autoconf \
+    avahi-devel \
+    bind-utils \
+    binutils \
+    bison \
+    cups-devel \
+    curl \
+    dbus-1-devel \
+    docbook-dtds \
+    docbook-xsl-stylesheets \
+    gawk \
+    gcc \
+    gdb \
+    git \
+    glib2-devel \
+    glibc-locale \
+    gnutls-devel \
+    gpgme-devel \
+    gzip \
+    hostname \
+    htop \
+    keyutils-devel \
+    krb5-devel \
+    krb5-server \
+    libacl-devel \
+    libaio-devel \
+    libarchive-devel \
+    libattr-devel \
+    libblkid-devel \
+    libbsd-devel \
+    libcap-devel \
+    libicu-devel \
+    libjansson-devel \
+    libnettle-devel \
+    libnsl-devel \
+    libpcap-devel \
+    libtasn1-devel \
+    libtirpc-devel \
+    libunwind-devel \
+    libuuid-devel \
+    libxslt \
+    lmdb \
+    lmdb-devel \
+    lsb-release \
+    make \
+    ncurses-devel \
+    openldap2-devel \
+    pam-devel \
+    patch \
+    perl \
+    perl-Archive-Tar-Wrapper \
+    perl-ExtUtils-MakeMaker \
+    perl-JSON-XS \
+    perl-Parse-Yapp \
+    perl-Test-Base \
+    pkgconfig \
+    policycoreutils-python \
+    popt-devel \
+    procps \
+    psmisc \
+    python-crypto \
+    python-devel \
+    python-markdown \
+    python2-dnspython \
+    python2-gpg \
+    python2-semanage \
+    python3-Markdown \
+    python3-devel \
+    python3-dnspython \
+    python3-gpg \
+    python3-pycrypto \
+    readline-devel \
+    rng-tools \
+    rpcgen \
+    rsync \
+    sed \
+    sudo \
+    systemd-devel \
+    tar \
+    tree \
+    which \
+    yum-utils \
+    zlib-devel \
+    system-user-nobody
+
+zypper --non-interactive clean
+
+if [ -f /usr/lib/mit/bin/krb5-config ]; then
+    ln -sf /usr/lib/mit/bin/krb5-config /usr/bin/krb5-config
+fi
\ No newline at end of file
diff --git a/bootstrap/generated-dists/opensuse150/locale.sh b/bootstrap/generated-dists/opensuse150/locale.sh
new file mode 100755 (executable)
index 0000000..cc64e18
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+set -xueo pipefail
+
+# refer to /usr/share/i18n/locales
+INPUTFILE=en_US
+# refer to /usr/share/i18n/charmaps
+CHARMAP=UTF-8
+# locale to generate in /usr/lib/locale
+# glibc/localedef will normalize UTF-8 to utf8, follow the naming style
+LOCALE=$INPUTFILE.utf8
+
+# if locale is already correct, exit
+( locale | grep LC_ALL | grep -i $LOCALE ) && exit 0
+
+# if locale not available, generate locale into /usr/lib/locale
+if ! ( locale --all-locales | grep -i $LOCALE )
+then
+    # no-archive means create its own dir
+    localedef --inputfile $INPUTFILE --charmap $CHARMAP --no-archive $LOCALE
+fi
+
+# update locale conf and global env file
+# set both LC_ALL and LANG for safe
+
+# update conf for Debian family
+FILE=/etc/default/locale
+if [ -f $FILE ]
+then
+    echo LC_ALL="$LOCALE" > $FILE
+    echo LANG="$LOCALE" >> $FILE
+fi
+
+# update conf for RedHat family
+FILE=/etc/locale.conf
+if [ -f $FILE ]
+then
+    # LC_ALL is not valid in this file, set LANG only
+    echo LANG="$LOCALE" > $FILE
+fi
+
+# update global env file
+FILE=/etc/environment
+if [ -f $FILE ]
+then
+    # append LC_ALL if not exist
+    grep LC_ALL $FILE || echo LC_ALL="$LOCALE" >> $FILE
+    # append LANG if not exist
+    grep LANG $FILE || echo LANG="$LOCALE" >> $FILE
+fi
\ No newline at end of file
diff --git a/bootstrap/generated-dists/opensuse150/packages.yml b/bootstrap/generated-dists/opensuse150/packages.yml
new file mode 100644 (file)
index 0000000..4153847
--- /dev/null
@@ -0,0 +1,87 @@
+---
+packages:
+  - acl
+  - attr
+  - autoconf
+  - avahi-devel
+  - bind-utils
+  - binutils
+  - bison
+  - cups-devel
+  - curl
+  - dbus-1-devel
+  - docbook-dtds
+  - docbook-xsl-stylesheets
+  - gawk
+  - gcc
+  - gdb
+  - git
+  - glib2-devel
+  - glibc-locale
+  - gnutls-devel
+  - gpgme-devel
+  - gzip
+  - hostname
+  - htop
+  - keyutils-devel
+  - krb5-devel
+  - krb5-server
+  - libacl-devel
+  - libaio-devel
+  - libarchive-devel
+  - libattr-devel
+  - libblkid-devel
+  - libbsd-devel
+  - libcap-devel
+  - libicu-devel
+  - libjansson-devel
+  - libnettle-devel
+  - libnsl-devel
+  - libpcap-devel
+  - libtasn1-devel
+  - libtirpc-devel
+  - libunwind-devel
+  - libuuid-devel
+  - libxslt
+  - lmdb
+  - lmdb-devel
+  - lsb-release
+  - make
+  - ncurses-devel
+  - openldap2-devel
+  - pam-devel
+  - patch
+  - perl
+  - perl-Archive-Tar-Wrapper
+  - perl-ExtUtils-MakeMaker
+  - perl-JSON-XS
+  - perl-Parse-Yapp
+  - perl-Test-Base
+  - pkgconfig
+  - policycoreutils-python
+  - popt-devel
+  - procps
+  - psmisc
+  - python-crypto
+  - python-devel
+  - python-markdown
+  - python2-dnspython
+  - python2-gpg
+  - python2-semanage
+  - python3-Markdown
+  - python3-devel
+  - python3-dnspython
+  - python3-gpg
+  - python3-pycrypto
+  - readline-devel
+  - rng-tools
+  - rpcgen
+  - rsync
+  - sed
+  - sudo
+  - systemd-devel
+  - tar
+  - tree
+  - which
+  - yum-utils
+  - zlib-devel
\ No newline at end of file
diff --git a/bootstrap/generated-dists/ubuntu1404/Dockerfile b/bootstrap/generated-dists/ubuntu1404/Dockerfile
new file mode 100644 (file)
index 0000000..4cbb2d3
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+FROM ubuntu:14.04
+
+# pass in with --build-arg while build
+ARG SHA1SUM
+RUN [ -n $SHA1SUM ] && echo $SHA1SUM > /sha1sum.txt
+
+ADD *.sh /tmp/
+# need root permission, do it before USER samba
+RUN /tmp/bootstrap.sh && /tmp/locale.sh
+
+# if ld.gold exists, force link it to ld
+RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD"
+
+# make test can not work with root, so we have to create a new user
+RUN useradd -m -U -s /bin/bash samba && \
+    mkdir -p /etc/sudoers.d && \
+    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
+
+USER samba
+WORKDIR /home/samba
+# samba tests rely on this
+ENV USER=samba LC_ALL=en_US.utf8 LANG=en_US.utf8
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
similarity index 66%
rename from bootstrap/dists/ubuntu1404/bootstrap.sh
rename to bootstrap/generated-dists/ubuntu1404/bootstrap.sh
index b80055e..2c2b854
@@ -1,19 +1,24 @@
 #!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
 set -xueo pipefail
 
 export DEBIAN_FRONTEND=noninteractive
 apt-get -y update
 
 apt-get -y install \
+    acl \
     apt-utils \
     attr \
     autoconf \
-    bind9 \
     bind9utils \
     binutils \
     bison \
     build-essential \
-    ccache \
     curl \
     debhelper \
     dnsutils \
@@ -23,20 +28,28 @@ apt-get -y install \
     gcc \
     gdb \
     git \
-    krb5-kdc \
+    gzip \
+    hostname \
+    htop \
+    krb5-config \
+    krb5-user \
     language-pack-en \
     libacl1-dev \
     libaio-dev \
     libarchive-dev \
     libattr1-dev \
+    libavahi-common-dev \
     libblkid-dev \
     libbsd-dev \
     libcap-dev \
     libcups2-dev \
     libdbus-1-dev \
+    libglib2.0-dev \
     libgnutls-dev \
     libgpgme11-dev \
+    libicu-dev \
     libjansson-dev \
+    libjs-jquery \
     libjson-perl \
     libkrb5-dev \
     libldap2-dev \
@@ -44,51 +57,51 @@ apt-get -y install \
     libncurses5-dev \
     libpam0g-dev \
     libparse-yapp-perl \
+    libpcap-dev \
     libpopt-dev \
     libreadline-dev \
-    libxml2-dev \
+    libtasn1-bin \
+    libtasn1-dev \
+    libunwind8-dev \
     lmdb-utils/trusty-backports \
     locales \
-    locate \
-    lsb-core \
+    lsb-release \
     make \
+    mawk \
     nettle-dev \
+    patch \
     perl \
     perl-modules \
     pkg-config \
     procps \
     psmisc \
     python-crypto \
+    python-dbg \
     python-dev \
     python-dnspython \
     python-gpgme \
+    python-iso8601 \
     python-markdown \
+    python-pexpect \
     python3-crypto \
+    python3-dbg \
     python3-dev \
     python3-dnspython \
     python3-gpgme \
+    python3-iso8601 \
     python3-markdown \
+    python3-matplotlib \
+    python3-pexpect \
+    rng-tools \
+    rsync \
+    sed \
     sudo \
-    vim \
-    wget \
+    tar \
+    tree \
+    uuid-dev \
     xsltproc \
     zlib1g-dev
 
 apt-get -y autoremove
 apt-get -y autoclean
-apt-get -y clean
-
-# uncomment locale
-# this file doesn't exist on ubuntu1404 even locales installed
-if [ -f /etc/locale.gen ]; then
-    sed -i '/^#\s*en_US.UTF-8 UTF-8/s/^#\s*//' /etc/locale.gen
-fi
-
-locale-gen
-
-# update /etc/default/locale
-update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
-
-# set both for safe
-echo LC_ALL="en_US.UTF-8" >> /etc/environment
-echo LANG="en_US.UTF-8" >> /etc/environment
\ No newline at end of file
+apt-get -y clean
\ No newline at end of file
diff --git a/bootstrap/generated-dists/ubuntu1404/locale.sh b/bootstrap/generated-dists/ubuntu1404/locale.sh
new file mode 100755 (executable)
index 0000000..cc64e18
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+set -xueo pipefail
+
+# refer to /usr/share/i18n/locales
+INPUTFILE=en_US
+# refer to /usr/share/i18n/charmaps
+CHARMAP=UTF-8
+# locale to generate in /usr/lib/locale
+# glibc/localedef will normalize UTF-8 to utf8, follow the naming style
+LOCALE=$INPUTFILE.utf8
+
+# if locale is already correct, exit
+( locale | grep LC_ALL | grep -i $LOCALE ) && exit 0
+
+# if locale not available, generate locale into /usr/lib/locale
+if ! ( locale --all-locales | grep -i $LOCALE )
+then
+    # no-archive means create its own dir
+    localedef --inputfile $INPUTFILE --charmap $CHARMAP --no-archive $LOCALE
+fi
+
+# update locale conf and global env file
+# set both LC_ALL and LANG for safe
+
+# update conf for Debian family
+FILE=/etc/default/locale
+if [ -f $FILE ]
+then
+    echo LC_ALL="$LOCALE" > $FILE
+    echo LANG="$LOCALE" >> $FILE
+fi
+
+# update conf for RedHat family
+FILE=/etc/locale.conf
+if [ -f $FILE ]
+then
+    # LC_ALL is not valid in this file, set LANG only
+    echo LANG="$LOCALE" > $FILE
+fi
+
+# update global env file
+FILE=/etc/environment
+if [ -f $FILE ]
+then
+    # append LC_ALL if not exist
+    grep LC_ALL $FILE || echo LC_ALL="$LOCALE" >> $FILE
+    # append LANG if not exist
+    grep LANG $FILE || echo LANG="$LOCALE" >> $FILE
+fi
\ No newline at end of file
similarity index 67%
rename from bootstrap/dists/ubuntu1404/packages.yml
rename to bootstrap/generated-dists/ubuntu1404/packages.yml
index b5a042ce0e3b6af546ae22f3437d824fcc0c60b0..c526596bd47bb8a39441951626bc7830437006f6 100644 (file)
@@ -1,14 +1,13 @@
 ---
 packages:
+  - acl
   - apt-utils
   - attr
   - autoconf
-  - bind9
   - bind9utils
   - binutils
   - bison
   - build-essential
-  - ccache
   - curl
   - debhelper
   - dnsutils
@@ -18,20 +17,28 @@ packages:
   - gcc
   - gdb
   - git
-  - krb5-kdc
+  - gzip
+  - hostname
+  - htop
+  - krb5-config
+  - krb5-user
   - language-pack-en
   - libacl1-dev
   - libaio-dev
   - libarchive-dev
   - libattr1-dev
+  - libavahi-common-dev
   - libblkid-dev
   - libbsd-dev
   - libcap-dev
   - libcups2-dev
   - libdbus-1-dev
+  - libglib2.0-dev
   - libgnutls-dev
   - libgpgme11-dev
+  - libicu-dev
   - libjansson-dev
+  - libjs-jquery
   - libjson-perl
   - libkrb5-dev
   - libldap2-dev
@@ -39,32 +46,47 @@ packages:
   - libncurses5-dev
   - libpam0g-dev
   - libparse-yapp-perl
+  - libpcap-dev
   - libpopt-dev
   - libreadline-dev
-  - libxml2-dev
+  - libtasn1-bin
+  - libtasn1-dev
+  - libunwind8-dev
   - lmdb-utils/trusty-backports
   - locales
-  - locate
-  - lsb-core
+  - lsb-release
   - make
+  - mawk
   - nettle-dev
+  - patch
   - perl
   - perl-modules
   - pkg-config
   - procps
   - psmisc
   - python-crypto
+  - python-dbg
   - python-dev
   - python-dnspython
   - python-gpgme
+  - python-iso8601
   - python-markdown
+  - python-pexpect
   - python3-crypto
+  - python3-dbg
   - python3-dev
   - python3-dnspython
   - python3-gpgme
+  - python3-iso8601
   - python3-markdown
+  - python3-matplotlib
+  - python3-pexpect
+  - rng-tools
+  - rsync
+  - sed
   - sudo
-  - vim
-  - wget
+  - tar
+  - tree
+  - uuid-dev
   - xsltproc
   - zlib1g-dev
\ No newline at end of file
diff --git a/bootstrap/generated-dists/ubuntu1604/Dockerfile b/bootstrap/generated-dists/ubuntu1604/Dockerfile
new file mode 100644 (file)
index 0000000..93001fc
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+FROM ubuntu:16.04
+
+# pass in with --build-arg while build
+ARG SHA1SUM
+RUN [ -n $SHA1SUM ] && echo $SHA1SUM > /sha1sum.txt
+
+ADD *.sh /tmp/
+# need root permission, do it before USER samba
+RUN /tmp/bootstrap.sh && /tmp/locale.sh
+
+# if ld.gold exists, force link it to ld
+RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD"
+
+# make test can not work with root, so we have to create a new user
+RUN useradd -m -U -s /bin/bash samba && \
+    mkdir -p /etc/sudoers.d && \
+    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
+
+USER samba
+WORKDIR /home/samba
+# samba tests rely on this
+ENV USER=samba LC_ALL=en_US.utf8 LANG=en_US.utf8
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
similarity index 66%
rename from bootstrap/dists/ubuntu1604/bootstrap.sh
rename to bootstrap/generated-dists/ubuntu1604/bootstrap.sh
index 5e3a4b8..441c78c
@@ -1,19 +1,24 @@
 #!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
 set -xueo pipefail
 
 export DEBIAN_FRONTEND=noninteractive
 apt-get -y update
 
 apt-get -y install \
+    acl \
     apt-utils \
     attr \
     autoconf \
-    bind9 \
     bind9utils \
     binutils \
     bison \
     build-essential \
-    ccache \
     curl \
     debhelper \
     dnsutils \
@@ -23,20 +28,28 @@ apt-get -y install \
     gcc \
     gdb \
     git \
-    krb5-kdc \
+    gzip \
+    hostname \
+    htop \
+    krb5-config \
+    krb5-user \
     language-pack-en \
     libacl1-dev \
     libaio-dev \
     libarchive-dev \
     libattr1-dev \
+    libavahi-common-dev \
     libblkid-dev \
     libbsd-dev \
     libcap-dev \
     libcups2-dev \
     libdbus-1-dev \
+    libglib2.0-dev \
     libgnutls28-dev \
     libgpgme11-dev \
+    libicu-dev \
     libjansson-dev \
+    libjs-jquery \
     libjson-perl \
     libkrb5-dev \
     libldap2-dev \
@@ -44,52 +57,52 @@ apt-get -y install \
     libncurses5-dev \
     libpam0g-dev \
     libparse-yapp-perl \
+    libpcap-dev \
     libpopt-dev \
     libreadline-dev \
     libsystemd-dev \
-    libxml2-dev \
+    libtasn1-bin \
+    libtasn1-dev \
+    libunwind-dev \
     lmdb-utils \
     locales \
-    locate \
-    lsb-core \
+    lsb-release \
     make \
+    mawk \
     nettle-dev \
+    patch \
     perl \
     perl-modules \
     pkg-config \
     procps \
     psmisc \
     python-crypto \
+    python-dbg \
     python-dev \
     python-dnspython \
     python-gpgme \
+    python-iso8601 \
     python-markdown \
+    python-pexpect \
     python3-crypto \
+    python3-dbg \
     python3-dev \
     python3-dnspython \
     python3-gpgme \
+    python3-iso8601 \
     python3-markdown \
+    python3-matplotlib \
+    python3-pexpect \
+    rng-tools \
+    rsync \
+    sed \
     sudo \
-    vim \
-    wget \
+    tar \
+    tree \
+    uuid-dev \
     xsltproc \
     zlib1g-dev
 
 apt-get -y autoremove
 apt-get -y autoclean
-apt-get -y clean
-
-# uncomment locale
-# this file doesn't exist on ubuntu1404 even locales installed
-if [ -f /etc/locale.gen ]; then
-    sed -i '/^#\s*en_US.UTF-8 UTF-8/s/^#\s*//' /etc/locale.gen
-fi
-
-locale-gen
-
-# update /etc/default/locale
-update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
-
-# set both for safe
-echo LC_ALL="en_US.UTF-8" >> /etc/environment
-echo LANG="en_US.UTF-8" >> /etc/environment
\ No newline at end of file
+apt-get -y clean
\ No newline at end of file
diff --git a/bootstrap/generated-dists/ubuntu1604/locale.sh b/bootstrap/generated-dists/ubuntu1604/locale.sh
new file mode 100755 (executable)
index 0000000..cc64e18
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+set -xueo pipefail
+
+# refer to /usr/share/i18n/locales
+INPUTFILE=en_US
+# refer to /usr/share/i18n/charmaps
+CHARMAP=UTF-8
+# locale to generate in /usr/lib/locale
+# glibc/localedef will normalize UTF-8 to utf8, follow the naming style
+LOCALE=$INPUTFILE.utf8
+
+# if locale is already correct, exit
+( locale | grep LC_ALL | grep -i $LOCALE ) && exit 0
+
+# if locale not available, generate locale into /usr/lib/locale
+if ! ( locale --all-locales | grep -i $LOCALE )
+then
+    # no-archive means create its own dir
+    localedef --inputfile $INPUTFILE --charmap $CHARMAP --no-archive $LOCALE
+fi
+
+# update locale conf and global env file
+# set both LC_ALL and LANG for safe
+
+# update conf for Debian family
+FILE=/etc/default/locale
+if [ -f $FILE ]
+then
+    echo LC_ALL="$LOCALE" > $FILE
+    echo LANG="$LOCALE" >> $FILE
+fi
+
+# update conf for RedHat family
+FILE=/etc/locale.conf
+if [ -f $FILE ]
+then
+    # LC_ALL is not valid in this file, set LANG only
+    echo LANG="$LOCALE" > $FILE
+fi
+
+# update global env file
+FILE=/etc/environment
+if [ -f $FILE ]
+then
+    # append LC_ALL if not exist
+    grep LC_ALL $FILE || echo LC_ALL="$LOCALE" >> $FILE
+    # append LANG if not exist
+    grep LANG $FILE || echo LANG="$LOCALE" >> $FILE
+fi
\ No newline at end of file
similarity index 67%
rename from bootstrap/dists/ubuntu1604/packages.yml
rename to bootstrap/generated-dists/ubuntu1604/packages.yml
index c1f707563ac97392b3d4e62ae4678e6a8129a5d9..eedc0a01e2bf6421adaf248f4223f9ee6cef4e3f 100644 (file)
@@ -1,14 +1,13 @@
 ---
 packages:
+  - acl
   - apt-utils
   - attr
   - autoconf
-  - bind9
   - bind9utils
   - binutils
   - bison
   - build-essential
-  - ccache
   - curl
   - debhelper
   - dnsutils
@@ -18,20 +17,28 @@ packages:
   - gcc
   - gdb
   - git
-  - krb5-kdc
+  - gzip
+  - hostname
+  - htop
+  - krb5-config
+  - krb5-user
   - language-pack-en
   - libacl1-dev
   - libaio-dev
   - libarchive-dev
   - libattr1-dev
+  - libavahi-common-dev
   - libblkid-dev
   - libbsd-dev
   - libcap-dev
   - libcups2-dev
   - libdbus-1-dev
+  - libglib2.0-dev
   - libgnutls28-dev
   - libgpgme11-dev
+  - libicu-dev
   - libjansson-dev
+  - libjs-jquery
   - libjson-perl
   - libkrb5-dev
   - libldap2-dev
@@ -39,33 +46,48 @@ packages:
   - libncurses5-dev
   - libpam0g-dev
   - libparse-yapp-perl
+  - libpcap-dev
   - libpopt-dev
   - libreadline-dev
   - libsystemd-dev
-  - libxml2-dev
+  - libtasn1-bin
+  - libtasn1-dev
+  - libunwind-dev
   - lmdb-utils
   - locales
-  - locate
-  - lsb-core
+  - lsb-release
   - make
+  - mawk
   - nettle-dev
+  - patch
   - perl
   - perl-modules
   - pkg-config
   - procps
   - psmisc
   - python-crypto
+  - python-dbg
   - python-dev
   - python-dnspython
   - python-gpgme
+  - python-iso8601
   - python-markdown
+  - python-pexpect
   - python3-crypto
+  - python3-dbg
   - python3-dev
   - python3-dnspython
   - python3-gpgme
+  - python3-iso8601
   - python3-markdown
+  - python3-matplotlib
+  - python3-pexpect
+  - rng-tools
+  - rsync
+  - sed
   - sudo
-  - vim
-  - wget
+  - tar
+  - tree
+  - uuid-dev
   - xsltproc
   - zlib1g-dev
\ No newline at end of file
diff --git a/bootstrap/generated-dists/ubuntu1804/Dockerfile b/bootstrap/generated-dists/ubuntu1804/Dockerfile
new file mode 100644 (file)
index 0000000..2168656
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+FROM ubuntu:18.04
+
+# pass in with --build-arg while build
+ARG SHA1SUM
+RUN [ -n $SHA1SUM ] && echo $SHA1SUM > /sha1sum.txt
+
+ADD *.sh /tmp/
+# need root permission, do it before USER samba
+RUN /tmp/bootstrap.sh && /tmp/locale.sh
+
+# if ld.gold exists, force link it to ld
+RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD"
+
+# make test can not work with root, so we have to create a new user
+RUN useradd -m -U -s /bin/bash samba && \
+    mkdir -p /etc/sudoers.d && \
+    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
+
+USER samba
+WORKDIR /home/samba
+# samba tests rely on this
+ENV USER=samba LC_ALL=en_US.utf8 LANG=en_US.utf8
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
similarity index 66%
rename from bootstrap/dists/ubuntu1804/bootstrap.sh
rename to bootstrap/generated-dists/ubuntu1804/bootstrap.sh
index c355d78..8bed534
@@ -1,19 +1,24 @@
 #!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
 set -xueo pipefail
 
 export DEBIAN_FRONTEND=noninteractive
 apt-get -y update
 
 apt-get -y install \
+    acl \
     apt-utils \
     attr \
     autoconf \
-    bind9 \
     bind9utils \
     binutils \
     bison \
     build-essential \
-    ccache \
     curl \
     debhelper \
     dnsutils \
@@ -23,20 +28,28 @@ apt-get -y install \
     gcc \
     gdb \
     git \
-    krb5-kdc \
+    gzip \
+    hostname \
+    htop \
+    krb5-config \
+    krb5-user \
     language-pack-en \
     libacl1-dev \
     libaio-dev \
     libarchive-dev \
     libattr1-dev \
+    libavahi-common-dev \
     libblkid-dev \
     libbsd-dev \
     libcap-dev \
     libcups2-dev \
     libdbus-1-dev \
+    libglib2.0-dev \
     libgnutls28-dev \
     libgpgme11-dev \
+    libicu-dev \
     libjansson-dev \
+    libjs-jquery \
     libjson-perl \
     libkrb5-dev \
     libldap2-dev \
@@ -44,52 +57,52 @@ apt-get -y install \
     libncurses5-dev \
     libpam0g-dev \
     libparse-yapp-perl \
+    libpcap-dev \
     libpopt-dev \
     libreadline-dev \
     libsystemd-dev \
-    libxml2-dev \
+    libtasn1-bin \
+    libtasn1-dev \
+    libunwind-dev \
     lmdb-utils \
     locales \
-    locate \
-    lsb-core \
+    lsb-release \
     make \
+    mawk \
     nettle-dev \
+    patch \
     perl \
     perl-modules \
     pkg-config \
     procps \
     psmisc \
     python-crypto \
+    python-dbg \
     python-dev \
     python-dnspython \
     python-gpg \
+    python-iso8601 \
     python-markdown \
+    python-pexpect \
     python3-crypto \
+    python3-dbg \
     python3-dev \
     python3-dnspython \
     python3-gpg \
+    python3-iso8601 \
     python3-markdown \
+    python3-matplotlib \
+    python3-pexpect \
+    rng-tools \
+    rsync \
+    sed \
     sudo \
-    vim \
-    wget \
+    tar \
+    tree \
+    uuid-dev \
     xsltproc \
     zlib1g-dev
 
 apt-get -y autoremove
 apt-get -y autoclean
-apt-get -y clean
-
-# uncomment locale
-# this file doesn't exist on ubuntu1404 even locales installed
-if [ -f /etc/locale.gen ]; then
-    sed -i '/^#\s*en_US.UTF-8 UTF-8/s/^#\s*//' /etc/locale.gen
-fi
-
-locale-gen
-
-# update /etc/default/locale
-update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
-
-# set both for safe
-echo LC_ALL="en_US.UTF-8" >> /etc/environment
-echo LANG="en_US.UTF-8" >> /etc/environment
\ No newline at end of file
+apt-get -y clean
\ No newline at end of file
diff --git a/bootstrap/generated-dists/ubuntu1804/locale.sh b/bootstrap/generated-dists/ubuntu1804/locale.sh
new file mode 100755 (executable)
index 0000000..cc64e18
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+set -xueo pipefail
+
+# refer to /usr/share/i18n/locales
+INPUTFILE=en_US
+# refer to /usr/share/i18n/charmaps
+CHARMAP=UTF-8
+# locale to generate in /usr/lib/locale
+# glibc/localedef will normalize UTF-8 to utf8, follow the naming style
+LOCALE=$INPUTFILE.utf8
+
+# if locale is already correct, exit
+( locale | grep LC_ALL | grep -i $LOCALE ) && exit 0
+
+# if locale not available, generate locale into /usr/lib/locale
+if ! ( locale --all-locales | grep -i $LOCALE )
+then
+    # no-archive means create its own dir
+    localedef --inputfile $INPUTFILE --charmap $CHARMAP --no-archive $LOCALE
+fi
+
+# update locale conf and global env file
+# set both LC_ALL and LANG for safe
+
+# update conf for Debian family
+FILE=/etc/default/locale
+if [ -f $FILE ]
+then
+    echo LC_ALL="$LOCALE" > $FILE
+    echo LANG="$LOCALE" >> $FILE
+fi
+
+# update conf for RedHat family
+FILE=/etc/locale.conf
+if [ -f $FILE ]
+then
+    # LC_ALL is not valid in this file, set LANG only
+    echo LANG="$LOCALE" > $FILE
+fi
+
+# update global env file
+FILE=/etc/environment
+if [ -f $FILE ]
+then
+    # append LC_ALL if not exist
+    grep LC_ALL $FILE || echo LC_ALL="$LOCALE" >> $FILE
+    # append LANG if not exist
+    grep LANG $FILE || echo LANG="$LOCALE" >> $FILE
+fi
\ No newline at end of file
similarity index 67%
rename from bootstrap/dists/ubuntu1804/packages.yml
rename to bootstrap/generated-dists/ubuntu1804/packages.yml
index 6ac4658690c7ed76be382bdebc024cfc76110d5b..0f4332688bf22e944b1d14106a6db4f501ba59bb 100644 (file)
@@ -1,14 +1,13 @@
 ---
 packages:
+  - acl
   - apt-utils
   - attr
   - autoconf
-  - bind9
   - bind9utils
   - binutils
   - bison
   - build-essential
-  - ccache
   - curl
   - debhelper
   - dnsutils
@@ -18,20 +17,28 @@ packages:
   - gcc
   - gdb
   - git
-  - krb5-kdc
+  - gzip
+  - hostname
+  - htop
+  - krb5-config
+  - krb5-user
   - language-pack-en
   - libacl1-dev
   - libaio-dev
   - libarchive-dev
   - libattr1-dev
+  - libavahi-common-dev
   - libblkid-dev
   - libbsd-dev
   - libcap-dev
   - libcups2-dev
   - libdbus-1-dev
+  - libglib2.0-dev
   - libgnutls28-dev
   - libgpgme11-dev
+  - libicu-dev
   - libjansson-dev
+  - libjs-jquery
   - libjson-perl
   - libkrb5-dev
   - libldap2-dev
@@ -39,33 +46,48 @@ packages:
   - libncurses5-dev
   - libpam0g-dev
   - libparse-yapp-perl
+  - libpcap-dev
   - libpopt-dev
   - libreadline-dev
   - libsystemd-dev
-  - libxml2-dev
+  - libtasn1-bin
+  - libtasn1-dev
+  - libunwind-dev
   - lmdb-utils
   - locales
-  - locate
-  - lsb-core
+  - lsb-release
   - make
+  - mawk
   - nettle-dev
+  - patch
   - perl
   - perl-modules
   - pkg-config
   - procps
   - psmisc
   - python-crypto
+  - python-dbg
   - python-dev
   - python-dnspython
   - python-gpg
+  - python-iso8601
   - python-markdown
+  - python-pexpect
   - python3-crypto
+  - python3-dbg
   - python3-dev
   - python3-dnspython
   - python3-gpg
+  - python3-iso8601
   - python3-markdown
+  - python3-matplotlib
+  - python3-pexpect
+  - rng-tools
+  - rsync
+  - sed
   - sudo
-  - vim
-  - wget
+  - tar
+  - tree
+  - uuid-dev
   - xsltproc
   - zlib1g-dev
\ No newline at end of file
diff --git a/bootstrap/sha1sum.txt b/bootstrap/sha1sum.txt
new file mode 100644 (file)
index 0000000..dad5a55
--- /dev/null
@@ -0,0 +1 @@
+8606e89b0ce6a916fa881549a6cebf6eed528157