9 numproc=`cat /proc/cpuinfo |grep -c processor`
10 [ -z "$numproc" ] && numproc=1
11 #numproc=$(($numproc * 2))
13 if test -f ./source3/VERSION; then
19 SAMBA_ERRORS_IGNORE="\
20 grep -v \"Unable to determine origin of type\" | \
21 grep -v \"is not a pointer or array, skip client functions\" | \
22 grep -v \"is a pointer to type 'string', skip client functions\""
25 REV="$(git rev-parse HEAD)"
26 if test x"${vers}" = x3x; then
27 # version 3 requires a different setup
30 DESTDIR_TMP="../install.tmp"
31 OUTDIR="../../out/output/sha1/$REV"
32 CONFIGOPTS="--enable-selftest --with-ldap --with-ads --with-krb5"
34 DESTDIR_TMP="install.tmp"
35 OUTDIR="../out/output/sha1/$REV"
38 OUTDIR_TMP="${OUTDIR}.tmp"
40 DIST=$(lsb_release -sc)
42 install -d -m0755 -- "$DESTDIR_TMP"
44 echo "$0: configuring..."
45 ionice -c3 nice -n20 ./configure ${CONFIGOPTS}
47 NCPU=$(( 2 * `grep -c processor /proc/cpuinfo` ))
49 echo "$0: building..."
50 echo --START-IGNORE-WARNINGS
51 # filter out idl errors "Unable to determine origin..." to avoid gitbuilder failing
52 ionice -c3 nice -n20 make -j$NCPU 2> >( eval ${SAMBA_ERRORS_IGNORE} ) || exit 4
54 echo "$0: installing..."
55 ionice -c3 nice -n20 make -j$NCPU install DESTDIR=${DESTDIR_TMP} || exit 4
56 echo --STOP-IGNORE-WARNINGS
59 if test x"${vers}" = x3x; then
60 SMBVERS=$(./bin/smbd --version | sed -e "s|Version ||")
62 export LD_LIBRARY_PATH=${DESTDIR_TMP}/usr/local/samba/lib/:${DESTDIR_TMP}/usr/local/samba/lib/private/
63 SMBVERS=$(${DESTDIR_TMP}/usr/local/samba/sbin/smbd --version | sed -e "s|Version ||")
66 fpm -s dir -t deb -n samba -v ${SMBVERS} -C ${DESTDIR_TMP} -d krb5-user usr | \
67 grep -v "already initialized constant COMPRESSION_TYPES"
69 install -d -m0755 -- "$OUTDIR_TMP"
70 printf '%s\n' "$REV" >"$OUTDIR_TMP/sha1"
71 printf '%s\n' "$SMBVERS" >"$OUTDIR_TMP/version"
72 printf '%s\n' "samba" >"$OUTDIR_TMP/name"
74 mkdir -p $OUTDIR_TMP/conf
75 /srv/ceph-build/gen_reprepro_conf.sh $OUTDIR_TMP 03C3951A
77 GNUPGHOME="/srv/gnupg" reprepro --ask-passphrase -b $OUTDIR_TMP -C main --ignore=undefinedtarget --ignore=wrongdistribution includedeb ${DIST} samba_${SMBVERS}_*.deb
79 # we're successful, the files are ok to be published; try to be as
80 # atomic as possible about replacing potentially existing OUTDIR
81 if [ -e "$OUTDIR" ]; then
82 rm -rf -- "$OUTDIR.old"
83 mv -- "$OUTDIR" "$OUTDIR.old"
85 mv -- "$OUTDIR_TMP" "$OUTDIR"
86 rm -rf -- "$OUTDIR.old"
88 # rebuild combined debian repo output
92 GNUPGHOME="/srv/gnupg" /srv/ceph-build/merge_repos.sh combined sha1/*