]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
samba: Fix-up the build 587/head
authorBoris Ranto <branto@redhat.com>
Fri, 9 Dec 2016 14:22:41 +0000 (15:22 +0100)
committerBoris Ranto <branto@redhat.com>
Fri, 9 Dec 2016 14:22:44 +0000 (15:22 +0100)
I was able to perform a centos7 build with these changes. The ubuntu
builds fail because the libgnutls-dev version is too knew -- this should
be fixable in samba sources.

Signed-off-by: Boris Ranto <branto@redhat.com>
samba/build/build_deb
samba/build/build_rpm

index 0dae412656da2a18ff5aa2813838ac854735edbb..61fea4c0a73b81e6f22ca928c808cabe61347bf4 100644 (file)
@@ -8,77 +8,48 @@ fi
 
 
 ## Install any setup-time deps
-# TODO -- upload install-deps.sh script that installs the setup time deps
-# to upstream repo or update this section to install these packages
+# We need these for the build
+sudo apt-get install -y build-essential equivs libgnutls-dev libacl1-dev libldap2-dev ruby ruby-dev
 
-# We need this for mk-build-deps
-sudo apt-get install -y equivs
+# We use fpm to create the deb package
+sudo gem install fpm
 
-# Run the install-deps.sh upstream script if it exists
-if [ -x install-deps.sh ]; then
-    echo "Ensuring dependencies are installed"
-    sudo ./install-deps.sh
-fi
 
+## Do the actual build
+# Prepare the build
+DESTDIR="install.tmp"
+install -d -m0755 -- "$DESTDIR"
+./configure
 
-## Setup the pbuilder
-# TODO remove if you do not want to use pbuilders
-setup_pbuilder
+# Perform the build and install the files to DESTDIR
+NCPU=$(grep -c processor /proc/cpuinfo)
+make -j$NCPU
+make -j$NCPU install DESTDIR=${DESTDIR}
 
 
 ## Get some basic information about the system and the repository
-# TODO -- update this to get the proper VERSION/REVISION
+# Get version
+export LD_LIBRARY_PATH=${DESTDIR}/usr/local/samba/lib/:${DESTDIR}/usr/local/samba/lib/private/
 DEB_ARCH=$(dpkg-architecture -qDEB_BUILD_ARCH)
-VERSION="$(./get-version.sh)"
-REVISION="$(./get-revision.sh)"
-
-
-## Build the source tarball
-# TODO -- upload make-dist script that stores the tarball in dist/ to upstream repo or update this section
-echo "Building source distribution"
-if [ -x make-dist ]; then
-    echo "Ensuring dependencies are installed"
-    ./make-dist
-fi
-
-
-## Prepare the debian files
-# TODO -- Make sure the debian folder is tracked upstream
-# Bump the changelog
-dch -v "$VERSION" "New release ($VERSION)"
-
-# Install debian build-time dependencies
-yes | sudo mk-build-deps --install debian/control
-
-# Create .dsc and source tarball
-sudo dpkg-buildpackage -S -us -uc
-
-
-## Build with pbuilder
-echo "Building debs"
-
-PBUILDDIR="/srv/debian-base"
+VERSION=$(${DESTDIR}/usr/local/samba/sbin/smbd --version | sed -e "s|Version ||")
+REVISION="$(git rev-parse HEAD)"
 
-sudo pbuilder --clean
 
-mkdir -p dist/deb
+## Create the deb package
+# Make sure there are no other deb packages, first
+rm -f *.deb
 
-echo "Building debs for $DIST"
-sudo pbuilder build \
-    --distribution $DIST \
-    --basetgz $PBUILDDIR/$DIST.tgz \
-    --buildresult dist/deb/ \
-    --debbuildopts "-j`grep -c processor /proc/cpuinfo`" \
-    dist/samba_$VERSION.dsc
+# Create the deb package
+fpm -s dir -t deb -n samba -v ${VERSION} -C ${DESTDIR} -d krb5-user usr
 
 
-## Upload the created RPMs to chacra
+## Upload the created DEB to chacra
 chacra_endpoint="samba/${BRANCH}/${GIT_COMMIT}/${DISTRO}/${DIST}"
 
 [ "$FORCE" = true ] && chacra_flags="--force" || chacra_flags=""
 
 # push binaries to chacra
-find ../*.deb | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${DEB_ARCH}/
+find *.deb | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${DEB_ARCH}/
 
 # start repo creation
 $VENV/chacractl repo update ${chacra_endpoint}
index 1ccbd8f17222e800db654278a0c17b3947a59a29..f19b803195c9704bce10401b26199d9873855884 100644 (file)
@@ -7,62 +7,41 @@ if test "$DISTRO" != "fedora" -a "$DISTRO" != "centos" -a "$DISTRO" != "rhel"; t
 fi
 
 
-## Install any setup-time deps (to make dist package)
-# TODO -- upload install-deps.sh script that installs the setup time deps
-# to upstream repo or update this section to install these packages
+## Install any setup-time deps
+# We need these for the build
+sudo yum remove -y lttng-ust-devel # HACK: This package fails the build if installed :-/
+sudo yum install -y gnutls-devel libacl-devel openldap-devel rubygems ruby-devel docbook-xsl lttng-ust-devel
 
-# We need this to get the major version from lsb_release
-sudo yum install -y redhat-lsb-core mock
+# We use fpm to create the deb package
+sudo gem install fpm
 
-# Run the install-deps.sh upstream script if it exists
-if [ -x install-deps.sh ]; then
-    echo "Ensuring dependencies are installed"
-    sudo ./install-deps.sh
-fi
 
+## Do the actual build
+# Prepare the build
+DESTDIR="install.tmp"
+install -d -m0755 -- "$DESTDIR"
+./configure
 
-## Get some basic information about the system and the repository
-# TODO -- update this to get the proper VERSION/REVISION
-RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # sytem release
-VERSION="$(./get-version.sh)"
-REVISION="$(./get-revision.sh)"
-RPM_RELEASE=$(echo $REVISION | tr '-' '_') # the '-' has a special meaning
-
-
-## Build the source tarball
-# TODO -- upload make-dist script that stores the tarball in dist/ to upstream repo or update this section
-echo "Building source distribution"
-if [ -x make-dist ]; then
-    echo "Ensuring dependencies are installed"
-    ./make-dist
-fi
+# Perform the build and install the files to DESTDIR
+NCPU=$(grep -c processor /proc/cpuinfo)
+make -j$NCPU
+make -j$NCPU install DESTDIR=${DESTDIR}
 
 
-## Prepare the spec file for build
-# TODO -- Make sure the spec(.in) file is tracked upstream
-sed -e "s/@VERSION@/${VERSION}/g" -e "s/@RELEASE@/${RPM_RELEASE}/g" < samba.spec.in > dist/samba.spec
-
+## Get some basic information about the system and the repository
+# Get version
+export LD_LIBRARY_PATH=${DESTDIR}/usr/local/samba/lib/:${DESTDIR}/usr/local/samba/lib/private/
+RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # system release
+VERSION=$(${DESTDIR}/usr/local/samba/sbin/smbd --version | sed -e "s|Version ||")
+REVISION="$(git rev-parse HEAD)"
 
-## Create the source rpm
-# TODO -- update the paths to match the location of source package (dist/ by
-# default) and the spec file (PWD by default)
-echo "Building SRPM"
-rpmbuild \
-    --define "_sourcedir ./dist" \
-    --define "_specdir ." \
-    --define "_builddir ." \
-    --define "_srcrpmdir ." \
-    --define "_rpmdir ." \
-    --define "dist .any" \
-    --define "fedora 21" \
-    --define "rhel 7" \
-    --nodeps -bs dist/samba.spec
-SRPM=$(readlink -f *.src.rpm)
 
+## Create the deb package
+# Make sure there are no other deb packages, first
+rm -f *.rpm
 
-## Build the binaries with mock
-echo "Building RPMs"
-sudo mock -r ${MOCK_TARGET}-${RELEASE}-${ARCH} --resultdir=./dist/rpm/ ${SRPM}
+# Create the deb package
+fpm -s dir -t rpm -n samba -v ${VERSION} -C ${DESTDIR} -d krb5-user usr
 
 
 ## Upload the created RPMs to chacra
@@ -71,7 +50,7 @@ chacra_endpoint="samba/${BRANCH}/${GIT_COMMIT}/${DISTRO}/${RELEASE}"
 [ "$FORCE" = true ] && chacra_flags="--force" || chacra_flags=""
 
 # push binaries to chacra
-find ./dist/rpm/ | egrep '\.rpm$' | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/$ARCH/
+find *.rpm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/$ARCH/
 
 # start repo creation
 $VENV/chacractl repo update ${chacra_endpoint}