diff -Nru openstack-pkg-tools-21ubuntu5/build-tools/pkgos-bb openstack-pkg-tools-24ubuntu1/build-tools/pkgos-bb --- openstack-pkg-tools-21ubuntu5/build-tools/pkgos-bb 1970-01-01 01:00:00.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/build-tools/pkgos-bb 2015-04-27 09:36:15.000000000 +0200 @@ -0,0 +1,107 @@ +#!/bin/sh + +set -e +set -x + +if ! [ -r /etc/pkgos/pkgos.conf ] ; then + echo "Could not read /etc/pkgos/pkgos.conf" + exit 1 +else + . /etc/pkgos/pkgos.conf +fi + +# Manage parameters of this script +usage () { + echo "Usage: $0 [-u] [-d ]" + echo " -u: Upload to the defined Debian repository" + echo " -d : Define from which distro to backport" + exit 1 +} + +UPLOAD=no +SRC_DISTRO=sid +for i in $@ ; do + case ${1} in + "-u") + UPLOAD=yes + shift + ;; + "-d") + if [ -z "${2}" ] || [ -z "${3}" ] ; then usage ; fi + SRC_DISTRO=${2} + shift + shift + ;; + *) + ;; + esac +done + +if [ -z "${1}" ] ; then usage ; fi + +PKG_NAME=${1} + +# Double-guessing some stuffs +if [ `whoami` = "jenkins" ] ; then + BUILD_ROOT=/var/lib/jenkins/jobs/openstack-pkg-tools/builds/${BUILD_NUMBER} +else + BUILD_ROOT=~/src/os-bpo +fi + + +# Get info from packages.debian.org +PKG_INFO_FILE=`mktemp -t pkg_info_file.XXXXXX` +wget --no-check-certificate -O ${PKG_INFO_FILE} http://packages.debian.org/${SRC_DISTRO}/${PKG_NAME} +DEB_VERSION=`rmadison --suite=${SRC_DISTRO} ${PKG_NAME} | grep -E 'amd64|all' | awk '{print $3}'` +UPSTREAM_VERSION=`echo ${DEB_VERSION} | cut -d'-' -f1 | cut -d":" -f2` +DSC_URL=`cat ${PKG_INFO_FILE} | grep dsc | cut -d'"' -f2` +rm ${PKG_INFO_FILE} + +# Prepare build folder and go in it +MY_CWD=`pwd` +rm -rf ${BUILD_ROOT}/$PKG_NAME +mkdir -p ${BUILD_ROOT}/$PKG_NAME +cd ${BUILD_ROOT}/$PKG_NAME + +# Download the .dsc and extract it +dget -d -u ${DSC_URL} +PKG_SRC_NAME=`ls *.dsc | cut -d_ -f1` +PKG_NAME_FIRST_CHAR=`echo ${PKG_SRC_NAME} | awk '{print substr($0,1,1)}'` + +# Guess source package name using an ls of the downloaded .dsc file +DSC_FILE=`ls *.dsc` +DSC_FILE=`basename $DSC_FILE` +SOURCE_NAME=`echo $DSC_FILE | cut -d_ -f1` + +# Rename the build folder if the source package name is different from binary +if ! [ "${PKG_NAME}" = "${SOURCE_NAME}" ] ; then + cd .. + rm -rf $SOURCE_NAME + mv $PKG_NAME $SOURCE_NAME + cd $SOURCE_NAME +fi + +# Extract the source and make it a backport +dpkg-source -x *.dsc +cd ${SOURCE_NAME}-${UPSTREAM_VERSION} +dch --newversion ${DEB_VERSION}~${BPO_POSTFIX} -b --allow-lower-version -m "Rebuilt by zigo's BPO script." + +# Build the package +sbuild + +# Copy in the FTP repo +cd .. +rm ${SOURCE_NAME}_${DEB_VERSION}~${BPO_POSTFIX}_amd64.build +TARGET_FTP_FOLDER=${REPO_ROOT}/debian/pool/${REPO_NOCHANGE_BACKPORT_DEST}/main/${PKG_NAME_FIRST_CHAR}/$SOURCE_NAME +mkdir -p ${TARGET_FTP_FOLDER} +cp *bpo* *.orig.tar.* ${TARGET_FTP_FOLDER} + +# Update the archive and the sbuild chroot +pkgos-scan-repo ${REPO_NOCHANGE_BACKPORT_DEST} + +# Uploading to FTP +if [ "${UPLOAD}" = "yes" ] ; then + REMOTE_FOLDER=/home/ftp/debian/pool/${SCP_DEST_SUITE}/main/${PKG_NAME_FIRST_CHAR}/$SOURCE_NAME + ssh ${SCP_DEST_HOST} "mkdir -p ${REMOTE_FOLDER}" + scp *bpo* *.orig.tar.* ${SCP_DEST_HOST}:${REMOTE_FOLDER} +fi diff -Nru openstack-pkg-tools-21ubuntu5/build-tools/pkgos-bop openstack-pkg-tools-24ubuntu1/build-tools/pkgos-bop --- openstack-pkg-tools-21ubuntu5/build-tools/pkgos-bop 1970-01-01 01:00:00.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/build-tools/pkgos-bop 2015-04-27 09:36:15.000000000 +0200 @@ -0,0 +1,83 @@ +#!/bin/sh +# Build an OpenStack team's package and write it in /home/ftp + +set -e + +if ! [ -r /etc/pkgos/pkgos.conf ] ; then + echo "Could not read /etc/pkgos/pkgos.conf" + exit 1 +else + . /etc/pkgos/pkgos.conf +fi + +# Some quick calculation +BPO_DISTRO_NUM=~bpo${TARGET_DISTRO_NUM}+1 +if [ `uname -m` = "x86_64" ] ; then + BOP_BUILD_ARCH=amd64 +else + echo "Arch not supported: exiting." + exit 1 +fi + +cleanup_old_build () { + echo "===> Cleaning-up old builds" + rm -rf ../*.orig.tar.xz ../build-area +} + +# Finds the current version of the package +get_deb_version() { + PKG_NAME=`dpkg-parsechangelog | grep -E "^Source:" | cut -d" " -f2` + DEB_VERS=`dpkg-parsechangelog | grep -E "^Version: " | cut -d" " -f2` + NO_EPOC=`echo ${DEB_VERS} | cut -d":" -f2` + UPSTREAM_VERS=`echo ${NO_EPOC} | cut -d"-" -f1` + if [ "${DEB_VERS}" = "${UPSTREAM_VERS}" ] ; then IS_NATIVE="yes" ; else IS_NATIVE="no" ; fi + ORIG=${PKG_NAME}_${UPSTREAM_VERS}.orig.tar.xz + CHANGE=${PKG_NAME}_${NO_EPOC}_${ARCH}.changes + PKG_NAME_FIRST_CHAR=`echo ${PKG_NAME} | awk '{print substr($0,1,1)}'` +} + +create_orig_tar () { + if grep pristine-tar debian/gbp.conf | grep -q -i true ; then + echo "Nothing special to do with Pristine tar: not generating orig file!" + else + if [ "${IS_NATIVE}" = "no" ] ; then + ./debian/rules gen-orig-xz + fi + fi +} + +bop_it () { + echo "===> Building using git-buildpackage" + LAST_GIT_COMMIT=`git log | head -n 1 | awk '{print $2}'` + dch --newversion ${DEB_VERS}${BPO_DISTRO_NUM} -b --allow-lower-version -m "Rebuilt by bop." + git commit debian/changelog -m "Rebuilt by bop." + if ! git-buildpackage ; then + git reset --hard ${LAST_GIT_COMMIT} + echo "There was an error when bop called git-buildpackage: exiting." + exit 1 + else + git reset --hard ${LAST_GIT_COMMIT} + fi +} + +test_the_package () { + lintian -I -E --pedantic --profile debian/openstack ../build-area/*.changes +} + +copy_to_ftparchive () { + echo "===> Copying to the FTP repo" + rm ../build-area/${PKG_NAME}_${NO_EPOC}${BPO_DISTRO_NUM}_amd64.build + TARGET_FOLDER=${REPO_ROOT}/debian/pool/${TARGET_DISTRO}-${TARGET_OPENSTACK_REL}-backports/main/${PKG_NAME_FIRST_CHAR}/${PKG_NAME} + rm -rf ${TARGET_FOLDER} + mkdir -p ${TARGET_FOLDER} + cp ../build-area/* ${TARGET_FOLDER} +} + +cleanup_old_build +get_deb_version +create_orig_tar +bop_it +test_the_package +copy_to_ftparchive +# Scan the repo to add the new package +pkgos-scan-repo diff -Nru openstack-pkg-tools-21ubuntu5/build-tools/pkgos-bop-jenkins openstack-pkg-tools-24ubuntu1/build-tools/pkgos-bop-jenkins --- openstack-pkg-tools-21ubuntu5/build-tools/pkgos-bop-jenkins 1970-01-01 01:00:00.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/build-tools/pkgos-bop-jenkins 2015-04-27 09:36:15.000000000 +0200 @@ -0,0 +1,129 @@ +#!/bin/sh + +set -e +set -x + +. /etc/pkgos/pkgos.conf + +PKG_NAME=${1} + +ARCH=i386 ; if [ `uname -m` = "x86_64" ] ; then ARCH=amd64 ; fi +if ! [ `whoami` = "root" ] ; then SU=sudo ; fi + +################################# +# Define some utility functions # +################################# +# Is the package from the pkgs-js group? +is_pkg_js () { + ISPKGJS="no" + for i in $PKG_JS ; do + if [ "${i}" = "${PKG_NAME}" ] ; then + ISPKGJS="yes" + fi + done +} + +# Is the package maintained on a debian/ branch? +is_core () { + ISCORE="no" + for i in $OSTACK_PKGS ; do + if [ "${i}" = "${PKG_NAME}" ] ; then + ISCORE="yes" + return + fi + done +} + +# Is the package maintained on a debian/experimental branch? +is_experi () { + ISEXPERI="no" + for i in ${EXPERIMENTAL_BRANCH} ; do + if [ "${i}" = "${PKG_NAME}" ] ; then + ISEXPERI="yes" + return + fi + done +} + +# Get some version information out of the debian/changelog last entry +get_deb_version() { + PKG_NAME=`dpkg-parsechangelog | grep -E "^Source:" | cut -d" " -f2` + DEB_VERS=`dpkg-parsechangelog | grep -E "^Version: " | cut -d" " -f2` + NO_EPOC=`echo ${DEB_VERS} | cut -d":" -f2` + UPSTREAM_VERS=`echo ${NO_EPOC} | cut -d"-" -f1` + if [ "${DEB_VERS}" = "${UPSTREAM_VERS}" ] ; then IS_NATIVE="yes" ; else IS_NATIVE="no" ; fi + ORIG=${PKG_NAME}_${UPSTREAM_VERS}.orig.tar.xz + CHANGE=${PKG_NAME}_${NO_EPOC}_${ARCH}.changes + PKG_NAME_FIRST_CHAR=`echo ${PKG_NAME} | awk '{print substr($0,1,1)}'` +} + +############################## +# Start of the actual script # +############################## +MY_CWD=`pwd` + +# Go in the build dir and make sure it's cleaned +BUILD_ROOT=/var/lib/jenkins/jobs/${PKG_NAME}/builds/${BUILD_NUMBER} +rm -rf ${BUILD_ROOT}/$PKG_NAME +mkdir -p ${BUILD_ROOT}/$PKG_NAME +cd ${BUILD_ROOT}/$PKG_NAME + +# "git clone" the package from the correct repo (either pkg-javascript or openstack) +is_pkg_js +if [ "${ISPKGJS}" = "yes" ] ; then + git clone ${CLONE_URL_PKGJS}/${PKG_NAME}.git +else + git clone ${CLONE_URL_BASE}/${PKG_NAME}.git +fi +cd $PKG_NAME + +# Checkout the correct branch(es) before building +PRIS=$(grep pristine-tar debian/gbp.conf | awk '{print $1}') +if [ "${PRIS}" = "pristine-tar" ] ; then + PRIS_VAL=$(grep pristine-tar debian/gbp.conf | cut -d'=' -f2 | awk '{print $1}') + if [ "${PRIS_VAL}" = "False" ] ; then + PRIS="none" + fi +fi +if [ "${PRIS}" = "pristine-tar" ] ; then + # If it's a pristine-tar package, checkout the pristine-tar and upstream-unstable branches + git checkout -b pristine-tar origin/pristine-tar + git checkout -b upstream-unstable origin/upstream-unstable + is_experi + if [ "${ISEXPERI}" = "yes" ] ; then + git checkout -b debian-experimental origin/debian-experimental + else + git checkout debian-unstable + fi + get_deb_version +else + is_core + if [ "${ISCORE}" = "yes" ] ; then + # If it's a core package, listed in OSTACK_PKGS in /etc/pkgos/pkgos.conf + # then we use debian/juno, debian/kilo, etc. as packaging branch. + git checkout -b debian/${TARGET_OPENSTACK_REL} origin/debian/${TARGET_OPENSTACK_REL} || true + else + # If it's listed as EXPERIMENTAL_BRANCH in /etc/pkgos/pkgos.conf, then we + # use debian/experimental branch. + is_experi + if [ "${ISEXPERI}" = "yes" ] ; then + CURBRANCH=`git branch | grep '*' | cut -d' ' -f2` + if [ "${CURBRANCH}" = "debian/experimental" ] ; then + echo "Already on debian/experimental" + else + git checkout -b debian/experimental origin/debian/experimental + fi + else + git checkout -b ${DEBIAN_BRANCH} origin/${DEBIAN_BRANCH} || true + fi + fi + get_deb_version + # Generate the .orig.tar.xz using git archive... + if [ "${IS_NATIVE}" = "no" ] ; then + ./debian/rules gen-orig-xz + fi +fi + +# Build the package using sbuild (see that script, which can be used +# in your own laptop if you don't want to use jenkins...) +pkgos-bop diff -Nru openstack-pkg-tools-21ubuntu5/build-tools/pkgos-scan-repo openstack-pkg-tools-24ubuntu1/build-tools/pkgos-scan-repo --- openstack-pkg-tools-21ubuntu5/build-tools/pkgos-scan-repo 1970-01-01 01:00:00.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/build-tools/pkgos-scan-repo 2015-04-27 09:36:15.000000000 +0200 @@ -0,0 +1,48 @@ +#!/bin/sh + +set -e +#set -x + +if ! [ -r /etc/pkgos/pkgos.conf ] ; then + echo "Could not read /etc/pkgos/pkgos.conf" + exit 1 +else + . /etc/pkgos/pkgos.conf +fi + +# It's possible to give the repo name as parameter +if [ -n "${1}" ] ; then + REPO_DEST=${1} +fi + +# Scan the repo +scan_repo() { + echo "===> Scanning ${REPO_ROOT} for packages in ${REPO_DEST} with arch ${SCAN_ARCHES}" + local MYCUR_DIR + MYCURDIR=`pwd` + cd ${REPO_ROOT}/debian + for i in ${SCAN_ARCHES} ; do + mkdir -p dists/${REPO_DEST}/main/binary-${i} + dpkg-scanpackages -a ${i} pool/${REPO_DEST}/main /dev/null > dists/${REPO_DEST}/main/binary-${i}/Packages + gzip -c dists/${REPO_DEST}/main/binary-${i}/Packages >dists/${REPO_DEST}/main/binary-${i}/Packages.gz + bzip2 -f -k dists/${REPO_DEST}/main/binary-${i}/Packages + done + mkdir -p dists/${REPO_DEST}/main/source + dpkg-scansources pool/${REPO_DEST}/main /dev/null >dists/${REPO_DEST}/main/source/Sources + gzip -c dists/${REPO_DEST}/main/source/Sources >dists/${REPO_DEST}/main/source/Sources.gz + bzip2 -f -k dists/${REPO_DEST}/main/source/Sources + cd dists/${REPO_DEST} + rm -f Release Release.gpg + TMPFILE=`mktemp -t pkgos_scan.XXXXXX` + apt-ftparchive release . -o APT::FTPArchive::Release::Origin="Mirantis" -o APT::FTPArchive::Release::Codename="${REPO_DEST}" > ${TMPFILE} + mv ${TMPFILE} ./Release + gpg -abs -o Release.gpg Release + chmod +r Release Release.gpg + cd ${MYCURDIR} +} + +scan_repo +for i in ${SCAN_ARCHES} ; do + echo "===> Updating schroot ${TARGET_DISTRO}-${i}" + sudo sbuild-update -udcar ${TARGET_DISTRO}-${i} +done diff -Nru openstack-pkg-tools-21ubuntu5/build-tools/pkgos-setup-sbuild openstack-pkg-tools-24ubuntu1/build-tools/pkgos-setup-sbuild --- openstack-pkg-tools-21ubuntu5/build-tools/pkgos-setup-sbuild 1970-01-01 01:00:00.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/build-tools/pkgos-setup-sbuild 2015-04-27 09:36:15.000000000 +0200 @@ -0,0 +1,488 @@ +#!/bin/sh + +set -e +set -x + +################################# +# AUTOMATICALLY DETECT ENV HERE # +################################# + +if ! [ -r /etc/pkgos/pkgos.conf ] ; then + echo "Could not read /etc/pkgos/pkgos.conf" + exit 1 +else + . /etc/pkgos/pkgos.conf +fi + +detect_env () { + DEB_RELEASE=`lsb_release -a | grep Codename: | awk '{print $2}'` + DEB_RELEASE_NUM=`lsb_release -a | grep Release: | awk '{print $2}'` + APT="apt-get install -y" + echo 'APT::Install-Recommends "0";' >/etc/apt/apt.conf.d/80norecommends +} + +configure_hostname () { + DEFROUTE_IF=`LC_ALL=C /sbin/route | grep default |awk -- '{ print $8 }' | cut -d" " -f1` + if [ -n "${DEFROUTE_IF}" ] ; then + DEFROUTE_IP=`LC_ALL=C ip addr show "${DEFROUTE_IF}" | grep inet | head -n 1 | awk '{print $2}' | cut -d/ -f1 | grep -E '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$'` + if [ -n "${DEFROUTE_IP}" ] ; then + echo "Detected IP: ${DEFROUTE_IP}" + echo "127.0.0.1 localhost.localdomain localhost +${DEFROUTE_IP} ${HOST_FQDN} ${TARGET_OPENSTACK_REL}-${TARGET_DISTRO} + +# The following lines are desirable for IPv6 capable hosts +::1 ip6-localhost ip6-loopback +fe00::0 ip6-localnet +ff00::0 ip6-mcastprefix +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters +ff02::3 ip6-allhosts +" >/etc/hosts + fi + fi + echo $HOST_FQDN >/etc/hostname + hostname `cat /etc/hostname` +} + +install_all_software () { + ${APT} linux-image-amd64 sbuild apache2 screen joe apache2 pure-ftpd ftp most \ + man-db git-buildpackage debhelper eatmydata build-essential python-setuptools \ + fakeroot python3-all python-all python3-setuptools pristine-tar dh-autoreconf ssl-cert \ + dh-python dh-systemd python-sphinx sudo debootstrap openstack-pkg-tools \ + lintian lsb-release postfix + if [ "${DEV_OR_JENKINS}" = "jenkins" ] ; then + ${APT} jenkins jenkins-job-builder jenkins-cli + fi +} + +configure_apache () { + a2enmod proxy + a2enmod proxy_http + a2enmod ssl + a2enmod headers + if [ "${DEB_RELEASE}" = "precise" ] ; then + APACHE_SSL_VHOST_CONF=default-ssl + FORWARD_TO_ADDR=ip6-localhost + DEFAULT_SITE=default + DEFAULT_SSL_SITE=default-ssl + elif [ "${DEB_RELEASE}" = "wheezy" ] ; then + APACHE_SSL_VHOST_CONF=default-ssl + FORWARD_TO_ADDR=localhost + DEFAULT_SITE=default + DEFAULT_SSL_SITE=default-ssl + else + APACHE_SSL_VHOST_CONF=default-ssl.conf + FORWARD_TO_ADDR=localhost + DEFAULT_SITE=000-default.conf + DEFAULT_SSL_SITE=default-ssl.conf + fi + a2ensite ${DEFAULT_SSL_SITE} + APACHE_SSL_VHOST_CONF_FULL_PATH=/etc/apache2/sites-available/${APACHE_SSL_VHOST_CONF} + echo " + + ServerAdmin webmaster@localhost + ErrorLog \${APACHE_LOG_DIR}/error.log + CustomLog \${APACHE_LOG_DIR}/access.log combined + + SSLEngine on + SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem + SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key + + + SSLOptions +StdEnvVars + + + SSLOptions +StdEnvVars + + + # Jenkins proxy (and reverse) + ProxyPass / http://${FORWARD_TO_ADDR}:8080/ nocanon + ProxyPassReverse / http://${FORWARD_TO_ADDR}:8080/ + ProxyRequests Off + AllowEncodedSlashes NoDecode + Header edit Location ^http://${HOST_FQDN}/ https://${HOST_FQDN}/ + RequestHeader set X-Forwarded-Proto \"https\" + RequestHeader set X-Forwarded-Port \"443\" + ProxyPreserveHost on + SetOutputFilter INFLATE;proxy-html;DEFLATE + SetEnv proxy-nokeepalive 1 + + ServerAdmin webmaster@localhost + + +" >${APACHE_SSL_VHOST_CONF_FULL_PATH} + a2ensite ${APACHE_SSL_VHOST_CONF} + service apache2 restart + if [ ! -e /var/www/html/debian ] && [ ! -h /var/www/html/debian ] ; then + ln -s /home/ftp/debian /var/www/html/debian + fi +} + +configure_pure () { + if getent passwd ftp >/dev/null ; then + echo "FTP user already existing" + else + /usr/sbin/useradd -m ftp + fi + chown ${THE_DEV_USER}:${THE_DEV_USER} /home/ftp + rm -f /etc/pure-ftpd/conf/NoAnonymous + service pure-ftpd stop + sleep 2 + service pure-ftpd start +} + +install_jenkins_plugins () { + jenkins-cli -s https://${HOST_FQDN}/ -noCertificateCheck install-plugin instant-messaging + jenkins-cli -s https://${HOST_FQDN}/ -noCertificateCheck install-plugin ircbot +} + +configure_jenkins_dotgitconfig () { + echo "[user] + email = zigo@debian.org + name = Thomas Goirand +[gitreview] + username = thomas-goirand +[alias] + wdiff = diff --color-words + wshow = show --color-words +[color] + ui = true" >/var/lib/jenkins/.gitconfig +} + +configure_jenkins_sudoers () { + echo "jenkins ALL = NOPASSWD: /usr/bin/sbuild-update -udcar ${TARGET_DISTRO}-amd64" >/etc/sudoers.d/jenkins + chmod 440 /etc/sudoers.d/jenkins +} + +# @param: $1 homedir of the GPG user +gen_the_dev_user_gpg_key () { + GPG_USER_HOMEDIR=${1} + mkdir -p ${GPG_USER_HOMEDIR}/.gnupg + chmod 700 ${GPG_USER_HOMEDIR}/.gnupg + chmod 700 ${GPG_USER_HOMEDIR}/.gnupg + if ! [ -r ${GPG_USER_HOMEDIR}/.gnupg/gpg.conf ] ; then + echo "keyserver hkp://pool.sks-keyservers.net +personal-digest-preferences SHA256 +default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed +cert-digest-algo SHA256 +" >${GPG_USER_HOMEDIR}/.gnupg/gpg.conf + fi + if ! [ -r ${GPG_USER_HOMEDIR}/.gnupg/pkgos-gen-key-batchfile ] ; then + echo " +%echo Generating a basic OpenPGP key +Key-Type: RSA +Key-Length: 4096 +Name-Real: Autogenerated key +Name-Email: ${THE_DEV_USER}@"`hostname --fqdn`" +Expire-Date: 0 +" >${GPG_USER_HOMEDIR}/.gnupg/pkgos-gen-key-batchfile + fi + chown -R ${THE_DEV_USER}:${THE_DEV_USER} ${GPG_USER_HOMEDIR}/.gnupg + su ${THE_DEV_USER} -c 'gpg --gen-key --batch '${GPG_USER_HOMEDIR}'/.gnupg/pkgos-gen-key-batchfile' +} + +configure_jenkins_gpg_key () { + # Generate a self-signed gpg key so that we can sign packages + if ! [ -e /var/lib/jenkins/.gnupg/secring.gpg ] ; then + gen_the_dev_user_gpg_key /var/lib/jenkins + fi +} + + +check_user_gpg_key () { + if ! [ -d /home/${THE_DEV_USER}/.gnupg ] ; then + echo "There's no /home/${THE_DEV_USER}/.gnupg folder," + echo "do you want this script to generate one? If you" + echo "don't, the script will exit." + echo -n "Generate a GPG key (Y/n)?" + read GEN_KEY + if [ -z "${GEN_KEY}" ] || [ "${GEN_KEY}" = "y" ] || [ "${GEN_KEY}" = "Y" ] ; then + echo "Genrating a gpg key for you..." + gen_the_dev_user_gpg_key /home/${THE_DEV_USER} + else + echo "No gpg key: exiting..." + exit 1 + fi + fi + GPG_KEY_ID=$(su ${THE_DEV_USER} -c "gpg --list-keys ${THE_DEV_USER} | grep ^pub | awk '{print \$2}' | cut -d/ -f2 | head -n 1") + if [ -z "${GPG_KEY_ID}" ] ; then + echo "Cloud not find key ID, but there's a /home/${THE_DEV_USER}/.gnupg" + echo -n "Generate a GPG key (Y/n)?" + read GEN_KEY + if [ -z "${GEN_KEY}" ] || [ "${GEN_KEY}" = "y" ] || [ "${GEN_KEY}" = "Y" ] ; then + echo "Genrating a gpg key for you..." + gen_the_dev_user_gpg_key /home/${THE_DEV_USER} + else + echo "No gpg key: exiting..." + exit 1 + fi + fi + GPG_KEY_ID=$(su ${THE_DEV_USER} -c "gpg --list-keys ${THE_DEV_USER} | grep ^pub | awk '{print \$2}' | cut -d/ -f2 | head -n 1") + echo "===> Key ID: ${GPG_KEY_ID}" +} + +build_ostack_archive_keyring_package () { + # Export the jenkins GPG key as pubkey.gpg in debian/dists/pubkey.gpg + mkdir -p ${REPO_ROOT}/debian/dists + chown -R ${THE_DEV_USER}:${THE_DEV_USER} ${REPO_ROOT}/debian/dists + chown ${THE_DEV_USER}:${THE_DEV_USER} ${REPO_ROOT}/debian + su ${THE_DEV_USER} -c "gpg --export -a ${THE_DEV_USER}" >${REPO_ROOT}/debian/dists/pubkey.gpg + # Create a Debian package out of it, called openstack-debian-archive-keyring + # and put it in the newly created Debian repository. + # Yes, a working, Debian-policy-compliant package is really only a few lines of shell... :) + TMPDIR=`mktemp -d` + MYCWD=`pwd` + cd ${TMPDIR} + chown ${THE_DEV_USER}:${THE_DEV_USER} . + VER=0.1 + NAME=${TARGET_OPENSTACK_REL}-${TARGET_DISTRO}-archive-keyring + rm -rf ${NAME}-${VER} + mkdir -p ${NAME}-${VER}/debian/source + cd ${NAME}-${VER} + export DEBFULLNAME="Debian OpenStack Jenkins" + export DEBEMAIL="${THE_DEV_USER}@${HOST_FQDN}" + dch --create --package ${NAME} -D unstable --noquery --newversion 0.1 -m "Automatic archive package build." + sed -i 's/MAINTAINER /Debian OpenStack <'${THE_DEV_USER}'@'${HOST_FQDN}'>/' debian/changelog + echo "3.0 (native)" >debian/source/format + echo 9 >debian/compat + echo "#!/usr/bin/make -f +%: + dh \$@ +" >debian/rules + echo "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ${NAME} +Source: See the openstack-pkg-tools package + +Files: * +Copyright: (c) 2015, Thomas Goirand +License: Apache-2 + Licensed under the Apache License, Version 2.0 (the \"License\"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an \"AS IS\" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian-based systems the full text of the Apache version 2.0 license + can be found in /usr/share/common-licenses/Apache-2.0. +" >debian/copyright + echo "Source: ${NAME} +Section: net +Priority: extra +Maintainer: PKG OpenStack +Uploaders: Thomas Goirand +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.6 + +Package: ${NAME} +Architecture: all +Depends: \${misc:Depends} +Description: OpenStack ${TARGET_OPENSTACK_REL} ${TARGET_DISTRO} archive keyring + OpenStack ${TARGET_OPENSTACK_REL} ${TARGET_DISTRO} archive keyring +">debian/control + cp ${REPO_ROOT}/debian/dists/pubkey.gpg . + echo "pubkey.gpg /usr/share/${NAME}" >debian/${NAME}.install + echo "#!/bin/sh +set -e + +if [ \"\$1\" = \"configure\" ] || [ \"\$1\" = \"reconfigure\" ] ; then + apt-key add /usr/share/${NAME}/pubkey.gpg +fi + +#DEBHELPER# + +exit 0 +" >debian/${NAME}.postinst + chown -R ${THE_DEV_USER}:${THE_DEV_USER} . + su ${THE_DEV_USER} -c dpkg-buildpackage || true + FIRST_LETTER=`echo ${TARGET_OPENSTACK_REL} | awk '{print substr($0,0,2)}'` + cd .. + MYDEST=${REPO_ROOT}/debian/pool/${REPO_DEST}/main/${FIRST_LETTER}/${NAME} + MYDEST2=${REPO_ROOT}/debian/pool/${REPO_NOCHANGE_BACKPORT_DEST}/main/${FIRST_LETTER}/${NAME} + for i in ${MYDEST} ${MYDEST2} ; do + su ${THE_DEV_USER} -c "mkdir -p ${i}" + cp *.changes *.tar.xz *.deb *.dsc ${i} + chown -R ${THE_DEV_USER}:${THE_DEV_USER} ${i} + done + cd ${MYCWD} + rm -r ${TMPDIR} +} + +configure_sbuildrc () { + GPG_KEY_ID=$(su ${THE_DEV_USER} -c "gpg --list-keys ${THE_DEV_USER} | grep ^pub | awk '{print \$2}' | cut -d/ -f2") + DOT_SBUILDRC_PATH=${THE_USER_HOMEDIR}/.sbuildrc + if ! [ -r "${DOT_SBUILDRC_PATH}" ] ; then + echo "# don't remove this, Perl needs it: + +\$build_arch_all = 1; +\$build_source = 1; +\$distribution = '"${TARGET_DISTRO}"'; +\$run_lintian = 0; + +# Don't sign packages: +#\$pgp_options = '-us -uc'; + +# FIX THIS !!! +\$key_id = '${GPG_KEY_ID}'; + +1; +" >${DOT_SBUILDRC_PATH} + fi +} + +configure_sbuild () { + # Setup the gpg key for sbuild + mkdir -p /root/.gnupg + chmod 600 /root/.gnupg + gpg --list-keys + sbuild-update --keygen + + # Add jenkins as a sbuild user + sbuild-adduser ${THE_DEV_USER} + + # Create the actual schroot env + if ! [ -e /var/lib/sbuild/${TARGET_DISTRO}-amd64.tar.gz ] ; then + sbuild-createchroot --make-sbuild-tarball=/var/lib/sbuild/${TARGET_DISTRO}-amd64.tar.gz ${TARGET_DISTRO} `mktemp -d` ${CLOSEST_DEBIAN_MIRROR} + fi + + # Make sure git-buildpackage is using sbuild + sed -i 's/^[ #\t]*builder[ #\t]*=.*/builder = sbuild -v --no-apt-update/' /etc/git-buildpackage/gbp.conf + sed -i 's/^[ #\t]*cleaner[ #\t]*=.*/cleaner = \/bin\/true/' /etc/git-buildpackage/gbp.conf + + # Make sure that /dev/shm is mounted in the chroot, otherwise anything which + # uses /dev/shm (like python-taskflow, etc.) will fail to build + sed -i 's|#/dev/shm|/dev/shm|' /etc/schroot/default/fstab + + # Install the juno-jessie-archive-keyring package in the repository + FIRST_LETTER=`echo ${TARGET_OPENSTACK_REL} | awk '{print substr($0,0,2)}'` + NAME=${TARGET_OPENSTACK_REL}-${TARGET_DISTRO}-archive-keyring + VERS=0.1 + MYPKG_FILE_NAME=${NAME}_0.1_all.deb + LOCATION=debian/pool/${TARGET_DISTRO}-${TARGET_OPENSTACK_REL}-backports/main/${FIRST_LETTER}/${NAME}/${MYPKG_FILE_NAME} + schroot -c source:${TARGET_DISTRO}-amd64-sbuild -u root -- apt-get install -y wget + schroot -c source:${TARGET_DISTRO}-amd64-sbuild -u root -- wget http://localhost/${LOCATION} + schroot -c source:${TARGET_DISTRO}-amd64-sbuild -u root -- dpkg -i ${MYPKG_FILE_NAME} + + # Since we have already a first package (the archive-keyring one), + # let's scan the tree in /home/ftp/debian/pool, and build a valid Debian repo + + MYCWD=`pwd` + cd ${THE_USER_HOMEDIR} + su ${THE_DEV_USER} -c pkgos-scan-repo + su ${THE_DEV_USER} -c pkgos-scan-repo ${REPO_NOCHANGE_BACKPORT_DEST} + cd ${MYCWD} + + # Add a hook to have both our repositories used inside the sbuild chroot + echo "#!/bin/sh + +set -e + +. \"\$SETUP_DATA_DIR/common-data\" +. \"\$SETUP_DATA_DIR/common-functions\" +. \"\$SETUP_DATA_DIR/common-config\" + +if [ \$STAGE = \"setup-start\" ] || [ \$STAGE = \"setup-recover\" ]; then + echo \"deb http://localhost/debian ${TARGET_DISTRO}-${TARGET_OPENSTACK_REL}-backports main\" >\${CHROOT_PATH}/etc/apt/sources.list.d/openstack.list + echo \"deb http://localhost/debian ${REPO_NOCHANGE_BACKPORT_DEST} main\" >\${CHROOT_PATH}/etc/apt/sources.list.d/openstack-backports.list +fi" >>/etc/schroot/setup.d/80sources + chmod +x /etc/schroot/setup.d/80sources +} + +configure_jenkins_job_builder () { + GENERATED_PASSWORD=$(dd if=/dev/random bs=64 count=1 2>|/dev/null | md5sum | awk '{print $1}') + echo "[job_builder] +ignore_cache=True +keep_descriptions=False +include_path=/usr/local/bin +recursive=False +allow_duplicates=False + +[jenkins] +user=zigo +password=${JENKINS_JOBS_BUILDER_PASS} +url=http://localhost:8080/ +" >/etc/jenkins_jobs/jenkins_jobs.ini + echo "" >job.yaml + for i in `cat /etc/pkgos/build-list` ; do + echo "- job: + name: $i + builders: + - shell: 'pkgos-bop-jenkins "${i}"' + auth-token: g5rjtpms5emw + logrotate: + numToKeep: 4 + publishers: + - ircbot: + strategy: all + notify-start: true + message-type: summary + wrappers: + - ansicolor: + colormap: xterm +" >>job.yaml + done + jenkins-jobs update job.yaml +} + +restart_jenkins () { + service jenkins restart +} + +############################## +# ACTUAL START OF THE SCRIPT # +############################## + +usage () { + echo "Wrong usage: $0 [dev|jenkins] " + echo "the username 2nd param is only if you use the dev mode" + exit 1 +} + +if [ "${1}" = "dev" ] ; then + echo "Setting-up a developer machine." + DEV_OR_JENKINS=dev + shift + if [ -z "${1}" ] ; then + usage + fi + THE_DEV_USER=${1} + shift + if [ -n "${1}" ] ; then + usage + fi + THE_USER_HOMEDIR=/home/${THE_DEV_USER} +elif [ "${1}" = "jenkins" ] ; then + echo "Setting-up a Jenkins build server." + DEV_OR_JENKINS=jenkins + THE_DEV_USER=jenkins + shift + if [ -n "${1}" ] ; then + usage + fi + THE_USER_HOMEDIR=/var/lib/jenkins +else + usage +fi + +detect_env +[ "${DEV_OR_JENKINS}" = "jenkins" ] && configure_hostname +install_all_software +configure_apache +configure_pure +# This often fails because the list of plugins isn't fetched by Jenkins +#install_jenkins_plugins +[ "${DEV_OR_JENKINS}" = "jenkins" ] && configure_jenkins_dotgitconfig +[ "${DEV_OR_JENKINS}" = "jenkins" ] && configure_jenkins_sudoers +[ "${DEV_OR_JENKINS}" = "jenkins" ] && configure_jenkins_gpg_key +[ "${DEV_OR_JENKINS}" = "dev" ] && check_user_gpg_key +configure_sbuildrc +build_ostack_archive_keyring_package +configure_sbuild +[ "${DEV_OR_JENKINS}" = "jenkins" ] && configure_jenkins_job_builder +# This is needed so that jenkins can login into sbuild +[ "${DEV_OR_JENKINS}" = "jenkins" ] && restart_jenkins diff -Nru openstack-pkg-tools-21ubuntu5/debian/bzr-builddeb.conf openstack-pkg-tools-24ubuntu1/debian/bzr-builddeb.conf --- openstack-pkg-tools-21ubuntu5/debian/bzr-builddeb.conf 2015-01-08 10:33:12.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/debian/bzr-builddeb.conf 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -[BUILDDEB] -native = True diff -Nru openstack-pkg-tools-21ubuntu5/debian/changelog openstack-pkg-tools-24ubuntu1/debian/changelog --- openstack-pkg-tools-21ubuntu5/debian/changelog 2015-01-14 14:56:57.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/debian/changelog 2015-05-18 00:11:07.000000000 +0200 @@ -1,40 +1,32 @@ -openstack-pkg-tools (21ubuntu5) vivid; urgency=medium +openstack-pkg-tools (24ubuntu1) wily; urgency=medium - * upstart: Remove duplication of default configuration file in daemon - startup arguments. + * Sync from Debian unstable. Whole delta is already applied there. + * debian/control: Drop madison-lite, pristine-tar, libxml-xpath-perl + from Depends cause they are in universe. (LP: #1455985) - -- James Page Wed, 14 Jan 2015 13:56:52 +0000 + -- Artur Rona Mon, 18 May 2015 00:02:18 +0200 -openstack-pkg-tools (21ubuntu4) vivid; urgency=medium +openstack-pkg-tools (24) unstable; urgency=medium - * Only generate systemd unit files if a specialized one is not - provided as part of the packaging. + * Added tooling for sbuild. + * Uploading to unstable. - -- James Page Mon, 12 Jan 2015 13:32:11 +0000 + -- Thomas Goirand Fri, 17 Apr 2015 10:48:33 +0200 -openstack-pkg-tools (21ubuntu3) vivid; urgency=medium +openstack-pkg-tools (23) experimental; urgency=medium - * Tweak overrides for dh_installinit and dh_systemd_enable to make it - easier to add package specific overrides. + * Reviewed long description. + * Added build scripts and lots of utilities to automate building of OpenStack + packages. - -- James Page Mon, 12 Jan 2015 12:19:48 +0000 + -- Thomas Goirand Wed, 25 Feb 2015 21:56:24 +0100 -openstack-pkg-tools (21ubuntu2) vivid; urgency=medium +openstack-pkg-tools (22) unstable; urgency=medium - * Add respawn directive to upstart template. - * Increase default nofile limit to 65535/65535. + * Calls dh_installinit after dh_systemd_enable so that systemd services are + started at install time. - -- James Page Mon, 12 Jan 2015 08:28:02 +0000 - -openstack-pkg-tools (21ubuntu1) vivid; urgency=medium - - * Tweak order of execution for dh_installinit override to ensure that - dh_systemd_enable is called prior to dh_installinit, fixing problem - with ordering of debhelper snippets in postinst files. - * Specify package when calling dh_systemd_enable to avoid splurge of - warning messages during package build. - - -- James Page Thu, 08 Jan 2015 10:07:45 +0000 + -- Thomas Goirand Thu, 08 Jan 2015 15:12:13 +0000 openstack-pkg-tools (21) unstable; urgency=medium diff -Nru openstack-pkg-tools-21ubuntu5/debian/control openstack-pkg-tools-24ubuntu1/debian/control --- openstack-pkg-tools-21ubuntu5/debian/control 2015-01-08 10:34:57.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/debian/control 2015-05-18 00:06:08.000000000 +0200 @@ -3,10 +3,7 @@ Priority: extra Maintainer: Ubuntu Developers XSBC-Original-Maintainer: PKG OpenStack -Uploaders: Julien Danjou , - Thomas Goirand , - Ghe Rivero , - Mehdi Abaakouk +Uploaders: Thomas Goirand Build-Depends: debhelper (>= 9) Standards-Version: 3.9.6 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=openstack/openstack-pkg-tools.git;a=summary @@ -17,5 +14,13 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends} Description: Tools and scripts for building Openstack packages in Debian This package contains some useful shell scripts and helpers for building the - Openstack packages in Debian, including shared code for maintainer scripts, - and probably more in the future. + Openstack packages in Debian, including: + . + * shared code for maintainer scripts (.config, .postinst, ...). + * init script templates to automatically generate init scripts for sysv-rc, + systemd and upstart. + * tools to build backports using sbuild and/or Jenkins based on gbp workflow. + * utility to maintain git packaging (to be included in a debian/rules). + . + Even if this package is maintained in order to build OpenStack packages, it is + of a general purpose, and it can be used for building any package. diff -Nru openstack-pkg-tools-21ubuntu5/debian/gbp.conf openstack-pkg-tools-24ubuntu1/debian/gbp.conf --- openstack-pkg-tools-21ubuntu5/debian/gbp.conf 2015-01-08 10:33:12.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/debian/gbp.conf 2015-04-27 09:36:15.000000000 +0200 @@ -1,5 +1,5 @@ [DEFAULT] -debian-branch = debian/unstable +debian-branch = debian/kilo [git-buildpackage] export-dir = ../build-area/ diff -Nru openstack-pkg-tools-21ubuntu5/debian/openstack-pkg-tools.install openstack-pkg-tools-24ubuntu1/debian/openstack-pkg-tools.install --- openstack-pkg-tools-21ubuntu5/debian/openstack-pkg-tools.install 2015-01-08 10:33:12.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/debian/openstack-pkg-tools.install 2015-04-27 09:36:15.000000000 +0200 @@ -1,6 +1,10 @@ -pkgos.make /usr/share/openstack-pkg-tools -pkgos_func /usr/share/openstack-pkg-tools -pkgos_insert_include /usr/share/openstack-pkg-tools +pkgos.make /usr/share/openstack-pkg-tools +pkgos_func /usr/share/openstack-pkg-tools +pkgos_insert_include /usr/share/openstack-pkg-tools init-template/init-script-template /usr/share/openstack-pkg-tools init-template/pkgos-gen-systemd-unit /usr/bin init-template/pkgos-gen-upstart-job /usr/bin +misc/openstack.profile /usr/share/lintian/profiles/debian +misc/pkgos* /usr/bin +build-tools/* /usr/bin +etc/pkgos/* /etc/pkgos diff -Nru openstack-pkg-tools-21ubuntu5/etc/pkgos/build-list openstack-pkg-tools-24ubuntu1/etc/pkgos/build-list --- openstack-pkg-tools-21ubuntu5/etc/pkgos/build-list 1970-01-01 01:00:00.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/etc/pkgos/build-list 2015-04-27 09:36:15.000000000 +0200 @@ -0,0 +1,219 @@ +ceilometer +cinder +cliff-tablib +cobbler +designate +factory-boy +ftp-cloudfs +fuel-astute +fuel-nailgun +gf-complete +git-review +glance +heat +heat-cfntools +horizon +ironic +jerasure +keystone +liberasurecode +libjs-autonumeric +libjs-backbone-deep-model +libjs-backbone.stickit +libjs-cocktail +libjs-i18next +libjs-require-css +libjs-requirejs +libjs-requirejs-text +migrate +msgpack-python +murano +murano-agent +murano-dashboard +nailgun-agent +nailgun-mcagents +neutron +neutron-l3-healthcheck +nova +novnc +ntpstat +openstack-debian-images +openstack-doc-tools +openstack-meta-packages +openstack-nose +openstack-pkg-tools +openstack-trove +openvswitch +oslo-config +oslo.messaging +oslo.rootwrap +oslo-sphinx +python-barbicanclient +python-bashate +python-ceilometerclient +python-cinderclient +python-cloudfiles +python-coffin +python-concurrent.futures +python-couleur +python-croniter +python-daemonize +python-dbutils +python-ddt +python-designateclient +python-dib-utils +python-diskimage-builder +python-django-appconf +python-django-bootstrap-form +python-django-compressor +python-django-discover-runner +python-django-openstack-auth +python-django-pyscss +python-dogpile.cache +python-dogpile.core +python-extras +python-falcon +python-fixtures +python-fuelclient +python-glanceclient +python-glance-store +python-hacking +python-happybase +python-heatclient +python-hp3parclient +python-hplefthandclient +python-httpretty +python-hurry.filesize +python-ibm-db-sa +python-invocations +python-invoke +python-ironicclient +python-jingo +python-json-patch +python-jsonpath-rw +python-json-pointer +python-jsonschema +python-keystoneclient +python-keystonemiddleware +python-ldappool +python-lesscpy +python-logutils +python-misaka +python-mockito +python-mox3 +python-muranoclient +python-network-checker +python-neutronclient +python-nose-exclude +python-nosehtmloutput +python-nose-parameterized +python-nose-testconfig +python-nose-timer +python-novaclient +python-openstackclient +python-os-apply-config +python-os-client-config +python-os-collect-config +python-oslo.db +python-oslo.i18n +python-oslo.policy +python-oslo.serialization +python-oslotest +python-oslo.utils +python-oslo.vmware +python-osprofiler +python-os-refresh-config +python-pbr +python-pecan +python-pint +python-posix-ipc +python-proboscis +python-pycadf +python-pyeclib +python-pyghmi +python-pymemcache +python-pymysql +python-pysaml2 +python-pyvmomi +python-rednose +python-requests-mock +python-retrying +python-rfc3986 +python-rtslib-fb +python-rudolf +python-saharaclient +python-savannaclient +python-seamicroclient +python-semver +python-shotgun +python-sockjs-tornado +python-sphinxcontrib.plantuml +python-steadymark +python-sure +python-swiftclient +python-sysv-ipc +python-tablib +python-taskflow +python-tasklib +python-tempest-lib +python-termcolor +python-termstyle +python-testscenarios +python-tooz +python-trollius +python-troveclient +python-tuskarclient +python-warlock +python-wrapt +python-wsgi-intercept +python-wsme +python-xmlbuilder +python-xstatic +python-xstatic-angular +python-xstatic-angular-cookies +python-xstatic-angular-mock +python-xstatic-bootstrap-datepicker +python-xstatic-bootstrap-scss +python-xstatic-d3 +python-xstatic-font-awesome +python-xstatic-hogan +python-xstatic-jasmine +python-xstatic-jquery +python-xstatic-jquery.bootstrap.wizard +python-xstatic-jquery-migrate +python-xstatic-jquery.quicksearch +python-xstatic-jquery.tablesorter +python-xstatic-jquery-ui +python-xstatic-jsencrypt +python-xstatic-qunit +python-xstatic-rickshaw +python-xstatic-spin +python-xvfbwrapper +python-yaql +python-zake +q-text-as-data +ruby-cstruct +ruby-raemon +ruby-rethtool +ruby-symboltable +sahara +sftpcloudfs +sphinxcontrib-docbookrestapi +sphinxcontrib-httpdomain +sphinxcontrib-issuetracker +sphinxcontrib-pecanwsme +sphinxcontrib-programoutput +spice-html5 +stevedore +subunit +swift +swift-account-stats +swift-plugin-s3 +tasksel +tempest +testresources +tripleo-heat-templates +tripleo-image-elements +tuskar +tuskar-ui +websockify diff -Nru openstack-pkg-tools-21ubuntu5/etc/pkgos/pkgos.conf openstack-pkg-tools-24ubuntu1/etc/pkgos/pkgos.conf --- openstack-pkg-tools-21ubuntu5/etc/pkgos/pkgos.conf 1970-01-01 01:00:00.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/etc/pkgos/pkgos.conf 2015-04-27 09:36:15.000000000 +0200 @@ -0,0 +1,76 @@ +################################################# +# This file configure build tools for OpenStack # +# and is used by scripts under /usr/bin/pkgos-* # +################################################# + +### Target OS and target OpenStack release ### +############################################## +# Target distribution for which we are backporting for +TARGET_DISTRO=jessie + +# OpenStack release name we're building +TARGET_OPENSTACK_REL=kilo + +### Target backport distribution ### +# Release number as it appears on the changelog (ie: as in ~bpo8+1) +TARGET_DISTRO_NUM=8 + +# Release backport postfix, to use with pkgos-bb +BPO_POSTFIX=bpo${TARGET_DISTRO_NUM}+1 + +### Definitions for your Debian repository ### +############################################## +# Root folder where the Debian FTP archive will be populated by a build +REPO_ROOT=/home/ftp + +# what will be the http://debian main ? +REPO_DEST=${TARGET_DISTRO}-${TARGET_OPENSTACK_REL}-backports + +# Space separated list of arch to scan using dpkg-scanpackages +SCAN_ARCHES=amd64 + +# Where to store the strait backports (eg: backports with no change +# at all from original source package, only a rebuild...) +REPO_NOCHANGE_BACKPORT_DEST=${TARGET_DISTRO}-${TARGET_OPENSTACK_REL}-backports-nochange + +# This is where to upload a package to backport using pkgos-bb +SCP_DEST_HOST=archive.gplhost.com + +# What folder inside SCP_DEST_HOST +SCP_DEST_SUITE=${REPO_DEST} + +# Debian mirror near you for faster build (hint: you can use approx) +CLOSEST_DEBIAN_MIRROR=http://http.debian.net/debian + +### Hostname of your computer ### +################################# +# Hostname postfix (for example, with the above, it's going to +# be juno-jessie.pkgs.mirantis.com) +HOSTNAME_POSTFIX="pkgs.mirantis.com" + +# Calculated using the above +HOST_FQDN="${TARGET_OPENSTACK_REL}-${TARGET_DISTRO}.${HOSTNAME_POSTFIX}" + +# Password of the user for jenkins-jobs-builder to use +JENKINS_JOBS_BUILDER_PASS= + +### Git clone URLs (using alioth.debian.org ...) ### +#################################################### +# From what Git repository should we git clone packages? +CLONE_URL_BASE=git://anonscm.debian.org/openstack + +# Same as above, but for javascript packages listed in PKG_JS below +CLONE_URL_PKGJS=git://anonscm.debian.org/pkg-javascript + +############################ +# Definitions of branches. # +############################ +# Packages using debian/${TARGET_OPENSTACK_REL} +OSTACK_PKGS="openstack-pkg-tools python-pbr python-rtslib-fb tempest openstack-doc-tools python-oslo-context python-troveclient python-barbicanclient python-swiftclient python-oslo.vmware oslo-sphinx python-oslo.i18n python-glanceclient python-ironicclient python-saharaclient python-keystoneclient python-oslo.utils python-tooz python-gabbi python-ceilometerclient python-oslo.concurrency python-taskflow oslo.rootwrap python-oslo.middleware python-tempest-lib oslo-config oslo.messaging python-oslo.db python-keystonemiddleware python-oslo.serialization python-novaclient python-heatclient python-neutronclient python-pycadf migrate stevedore python-oslotest python-openstackclient python-glance-store openstack-meta-packages murano-agent murano sahara ceilometer cinder glance heat horizon keystone nova quantum swift neutron openstack-trove ironic designate" + +# Packages using debian/experimental +EXPERIMENTAL_BRANCH="python-pysaml2 python-autobahn python-httpretty python-requests-mock python-django-openstack-auth python-oslo.vmware python-pyghmi python-cinderclient" + +# List of packages within the pkgs-js Alioth group, +# cloned from the ${CLONE_URL_PKGJS} repository (see above for the URL) +PKG_JS="libjs-magic-search libjs-term.js libjs-angularjs-smart-table libjs-autonumeric libjs-backbone-deep-model libjs-backbone.stickit libjs-cocktail libjs-i18next libjs-require-css libjs-requirejs libjs-requirejs-text" diff -Nru openstack-pkg-tools-21ubuntu5/etc/pkgos/substitute openstack-pkg-tools-24ubuntu1/etc/pkgos/substitute --- openstack-pkg-tools-21ubuntu5/etc/pkgos/substitute 1970-01-01 01:00:00.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/etc/pkgos/substitute 2015-04-27 09:36:15.000000000 +0200 @@ -0,0 +1,3 @@ +pyopenssl python-openssl +sqlalchemy-migrate migrate +mysql-python python-mysqldb diff -Nru openstack-pkg-tools-21ubuntu5/misc/openstack.profile openstack-pkg-tools-24ubuntu1/misc/openstack.profile --- openstack-pkg-tools-21ubuntu5/misc/openstack.profile 1970-01-01 01:00:00.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/misc/openstack.profile 2015-04-27 09:36:15.000000000 +0200 @@ -0,0 +1,12 @@ +# This profile is auto-generated +Profile: debian/main +Extends: debian/ftp-master-auto-reject +Enable-Tags-From-Check: apache2, automake, binaries, changelog-file, changes-file, + conffiles, control-file, control-files, copyright-file, cruft, dbus, deb-format, + debconf, debhelper, debian-readme, debian-source-dir, description, + duplicate-files, fields, filename-length, files, group-checks, huge-usr-share, + infofiles, init.d, java, lintian, manpages, md5sums, menu-format, menus, nmu, + ocaml, patch-systems, phppear, po-debconf, rules, scripts, shared-libs, + source-copyright, standards-version, symlinks, systemd, testsuite, + version-substvars, watch-file +Disable-Tags: hardening-no-stackprotector, debian-watch-may-check-gpg-signature, unused-file-paragraph-in-dep5-copyright, no-upstream-changelog, binary-without-manpage, maintainer-script-should-not-use-update-alternatives-remove diff -Nru openstack-pkg-tools-21ubuntu5/misc/pkgos-alioth-new-git openstack-pkg-tools-24ubuntu1/misc/pkgos-alioth-new-git --- openstack-pkg-tools-21ubuntu5/misc/pkgos-alioth-new-git 1970-01-01 01:00:00.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/misc/pkgos-alioth-new-git 2015-04-27 09:36:15.000000000 +0200 @@ -0,0 +1,41 @@ +#!/bin/sh + +set -e + +CWD=`pwd` +PKG_NAME=`basename ${CWD}` + +usage () { + echo "$0 creates a new Git repository out of your current working tree on alioth." + echo "You must be at the root of that local git repository" + echo "$0 will use the current folder as the name for the Alioth git repository." + echo "" + echo "Usage: $0 " + echo "example: $0 openstack will create a /git/openstack/${PKG_NAME}.git repository" + echo "note that you will need to have write access on the destination project," + echo "which means you must be a member of that said project on Alioth." + echo "" + echo "Please send patch/comments to: Thomas Goirand " + exit 1 +} + +if [ $# != 1 ] ; then + usage +fi + +DEST_PROJECT=$1 + +# Create the tarball and upload it to Alioth +cd .. +echo "===> Cloning ${PKG_NAME} as bare: ${PKG_NAME}.git" +git clone --bare ${PKG_NAME} ${PKG_NAME}.git +echo "===> Building tarball: ${PKG_NAME}.git.tar.gz" +tar -czf ${PKG_NAME}.git.tar.gz ${PKG_NAME}.git +echo "===> Uploading ${PKG_NAME}.git.tar.gz to git.debian.org" +scp ${PKG_NAME}.git.tar.gz git.debian.org: + +# Uncompress it on Alioth, fix perms and hook +ssh git.debian.org "cd /git/${DEST_PROJECT} && echo '===> Uncompressing ${PKG_NAME}.git.tar.gz in /git/${DEST_PROJECT}' && tar -xzf ~/${PKG_NAME}.git.tar.gz && echo '===> Activating update-server-info hook' && mv ${PKG_NAME}.git/hooks/post-update.sample ${PKG_NAME}.git/hooks/post-update && cd /git/${DEST_PROJECT}/${PKG_NAME}.git && git --bare update-server-info && echo '===> Deleting tarball on alioth' && rm ~/${PKG_NAME}.git.tar.gz && echo '===> Fxing g+w unix permissions' && find /git/${DEST_PROJECT}/${PKG_NAME}.git -exec chmod g+w {} \\; && find . -type d -exec chmod g+s {} \\; && git config core.sharedRepository group " +echo "===> Cleaning local bare copy and tarball" +rm ${PKG_NAME}.git.tar.gz +rm -rf ${PKG_NAME}.git diff -Nru openstack-pkg-tools-21ubuntu5/misc/pkgos-debpypi openstack-pkg-tools-24ubuntu1/misc/pkgos-debpypi --- openstack-pkg-tools-21ubuntu5/misc/pkgos-debpypi 1970-01-01 01:00:00.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/misc/pkgos-debpypi 2015-04-27 09:36:15.000000000 +0200 @@ -0,0 +1,282 @@ +#!/bin/sh + +set -e +set -x + +if [ "${1}" = "-u" ] && [ -n "${2}" ] ; then + ORIG_URL="${2}" + shift + shift +fi + +if [ -z "${1}" ] ; then + echo "This tool creates a template Debian package out of a PyPi package name." + echo "Once this script has run, make sure it did what you expected, then use" + echo "the newly created source package as a template. Make sure you correct" + echo "the debian/copyright file before publishing any package." + echo "Usage: ${0} package-name" + exit 1 +fi + +PKG_NAME=${1} +# Calculate the package name based on the command line argument +LOWER_PKG_NAME=`echo ${PKG_NAME} | awk '{print tolower($0)}'` +LOWER_PKG_NAME=`echo ${LOWER_PKG_NAME} | sed 's/_/-/'` +if echo ${LOWER_PKG_NAME} | grep -q '^python-' ; then + DEB_PKG_NAME=${LOWER_PKG_NAME} +else + DEB_PKG_NAME=python-${LOWER_PKG_NAME} +fi +echo "===> Package name will be ${DEB_PKG_NAME}" + +if [ ! -e ${PKG_NAME}.xml ] ; then + echo "===> Downloading DOAP XML record" + wget -nv "https://pypi.python.org/pypi?:action=doap&name=${PKG_NAME}" -O ${PKG_NAME}.xml +fi + +# Get info from the XML document using xpath. +VERSION_STRING=`xpath -e "//release/Version/revision/text()" ${PKG_NAME}.xml 2> /dev/null` +SHORT_DESC=`xpath -e "//shortdesc/text()" ${PKG_NAME}.xml 2> /dev/null` +LONG_DESC=`xpath -e "//description/text()" ${PKG_NAME}.xml 2> /dev/null` +UP_MAINT_NAME=`xpath -e "//maintainer/foaf:Person/foaf:name/text()" ${PKG_NAME}.xml 2> /dev/null` +HOMEPAGE=`xpath -e "//homepage/@rdf:resource" ${PKG_NAME}.xml 2> /dev/null | cut -d= -f2 | sed 's#"##g'` +FIRST_LETTER=`echo ${PKG_NAME} | awk '{print substr($0,0,1)}'` +if [ -e ${DEB_PKG_NAME}_${VERSION_STRING}.orig.tar.xz ] ; then + ORIG=${DEB_PKG_NAME}_${VERSION_STRING}.orig.tar.xz +else + ORIG=${DEB_PKG_NAME}_${VERSION_STRING}.orig.tar.gz +fi + +echo "===> Package info: +Upstream version: ${VERSION_STRING} +Author: ${UP_MAINT_NAME} +Homepage: ${HOMEPAGE}" + +if [ ! -e ${ORIG} ] ; then + echo "===> Downloading ${ORIG} file" + if [ -z "${ORIG_URL}" ] ; then + ORIG_URL=https://pypi.python.org/packages/source/${FIRST_LETTER}/${PKG_NAME}/${PKG_NAME}-${VERSION_STRING}.tar.gz + fi + wget -nv "${ORIG_URL}" -O ${ORIG} +fi + +echo "===> Extracting ${ORIG}" +tar -xf ${ORIG} +if ! [ ${PKG_NAME}-${VERSION_STRING} = ${DEB_PKG_NAME}-${VERSION_STRING} ] ; then + mv ${PKG_NAME}-${VERSION_STRING} ${DEB_PKG_NAME}-${VERSION_STRING} +fi + +# Trying to guess the maintainer's email +if [ -r ${DEB_PKG_NAME}-${VERSION_STRING}/setup.py ] ; then + if grep -q author_email ${DEB_PKG_NAME}-${VERSION_STRING}/setup.py ; then + AUTHOR_EMAIL=`grep author_email ${DEB_PKG_NAME}-${VERSION_STRING}/setup.py | cut -d= -f2 | awk '{print $1}' | sed -e 's/,//' -e "s/'//g" -e 's/"//g' | grep -e '^[._a-zA-Z0-9+-]*@[-a-z0-9.]*$'` + fi +fi + +echo "===> Creating debian folder for ${DEB_PKG_NAME}" +if [ ! -d ${DEB_PKG_NAME}-${VERSION_STRING}/debian/source ] ; then + mkdir -p ${DEB_PKG_NAME}-${VERSION_STRING}/debian/source +fi +cd ${DEB_PKG_NAME}-${VERSION_STRING} + +echo "===> Searching for sphinx doc folder" +if [ -e doc ] ; then + DOC_FOLDER=doc +elif [ -e docs ] ; then + DOC_FOLDER=docs +fi +if [ -n "${DOC_FOLDER}" ] ; then + CONFPY_FILE=`find ${DOC_FOLDER} -name 'conf.py'` + if [ -r "${CONFPY_FILE}" ] ; then + DOC_FOLDER=`dirname ${CONFPY_FILE}` + SPHINX_BUILD_DEP=", python-sphinx" + RULES_WITH=",sphinxdoc" + SUGGEST_DOC=" +Suggests: ${DEB_PKG_NAME}-doc" + else + DOC_FOLDER= + SPHINX_BUILD_DEP="" + RULES_WITH="" + SUGGEST_DOC="" + fi +fi + +echo "===> Checking for PBR and fixing accordingly" +# If the package uses PBR, then we need openstack-pkg-tools +if grep -q "setup_requires=\['pbr'\]" ${DEB_PKG_NAME}-${VERSION_STRING}/setup.py ; then + OSTACK_PKG_T_CTRL=", openstack-pkg-tools" + # We need a mandatory include... + # ... and the export OSLO_PACKAGE_VERSION=$(VERSION) + OSTACK_PKG_T_RULES="include /usr/share/openstack-pkg-tools/pkgos.make +export OSLO_PACKAGE_VERSION=\$(VERSION)" +else + # Otherwise, we just include it non-mandatorily, so that + # we can use ./debian/rules gen-orig-xz + OSTACK_PKG_T_CTRL="" + OSTACK_PKG_T_RULES="-include /usr/share/openstack-pkg-tools/pkgos.make" +fi + +echo "Source: ${DEB_PKG_NAME} +Section: python +Priority: optional +Maintainer: PKG OpenStack +Uploaders: Thomas Goirand +Build-Depends: debhelper (>= 9), dh-python, python-setuptools, python-all (>= 2.6.6-3~), python3-setuptools, python3-all${SPHINX_BUILD_DEP}${OSTACK_PKG_T_CTRL} +Standards-Version: 3.9.6 +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=openstack/${DEB_PKG_NAME}.git +Vcs-Git: git://anonscm.debian.org/openstack/${DEB_PKG_NAME}.git +Homepage: ${HOMEPAGE} + +Package: ${DEB_PKG_NAME} +Architecture: all +Pre-Depends: dpkg (>= 1.15.6~) +Depends: \${python:Depends}, \${misc:Depends}${SUGGEST_DOC} +Description: ${SHORT_DESC} - Python 2.x + ${LONG_DESC} + . + This package contains the Python 2.x module. + +Package: python3-${LOWER_PKG_NAME} +Architecture: all +Pre-Depends: dpkg (>= 1.15.6~) +Depends: \${python3:Depends}, \${misc:Depends}${SUGGEST_DOC} +Description: ${SHORT_DESC} - Python 3.x + - REPLACE ME - + . + This package contains the Python 3.x module. +" >debian/control + +if [ -n "${DOC_FOLDER}" ] ; then + echo "Package: python-${LOWER_PKG_NAME}-doc +Section: doc +Architecture: all +Pre-Depends: dpkg (>= 1.15.6~) +Depends: \${misc:Depends}, \${sphinxdoc:Depends} +Description: ${SHORT_DESC} - doc + - REPLACE ME - + . + This package contains the documentation. +" >>debian/control + + echo "Document: ${DEB_PKG_NAME}-doc +Title: ${PKG_NAME} Documentation +Author: N/A +Abstract: Sphinx documentation for ${PKG_NAME} +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/python-${LOWER_PKG_NAME}-doc/html/index.html +Files: /usr/share/doc/python-${LOWER_PKG_NAME}-doc/html/*" >debian/python-${LOWER_PKG_NAME}-doc.doc-base +fi + +EDITOR=touch dch --create --package ${DEB_PKG_NAME} --distribution unstable --urgency medium -v ${VERSION_STRING}-1 +rm +1 + +echo "9" >debian/compat + +if [ -n "${AUTHOR_EMAIL}" ] ; then + UP_MAINT_AND_EMAIL="${UP_MAINT_NAME} <${AUTHOR_EMAIL}>" +else + UP_MAINT_AND_EMAIL=${UP_MAINT_NAME} +fi +echo "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ${PKG_NAME} +Source: ${HOMEPAGE} + +Files: debian/* +Copyright: (c) 2014, Thomas Goirand +License: Apache-2 + +Files: * +Copyright: (c) 2013, ${UP_MAINT_AND_EMAIL} +License: Apache-2 + +License: Apache-2 + Licensed under the Apache License, Version 2.0 (the \"License\"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an \"AS IS\" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian-based systems the full text of the Apache version 2.0 license + can be found in /usr/share/common-licenses/Apache-2.0. +" >debian/copyright + +echo "[DEFAULT] +upstream-branch = master +debian-branch = debian/unstable +upstream-tag = %(version)s +compression = xz + +[git-buildpackage] +export-dir = ../build-area/ +" >debian/gbp.conf + +if [ -n "${DOC_FOLDER}" ] ; then + SPHINX_BUILD_RULES="override_dh_sphinxdoc: + sphinx-build -b html doc debian/python-${LOWER_PKG_NAME}-doc/usr/share/doc/python-${LOWER_PKG_NAME}-doc/html + dh_sphinxdoc -O--buildsystem=python_distutils + +" +else + SPHINX_BUILD_RULES="" +fi +echo "#!/usr/bin/make -f + +PYTHONS:=\$(shell pyversions -vr) +PYTHON3S:=\$(shell py3versions -vr) + +UPSTREAM_GIT = git://github.com//${PKG_NAME}.git +${OSTACK_PKG_T_RULES} + +%: + dh \$@ --buildsystem=python_distutils --with python2,python3${RULES_WITH} + +override_dh_install: + set -e ; for pyvers in \$(PYTHONS); do \\ + python\$\$pyvers setup.py install --install-layout=deb \\ + --root \$(CURDIR)/debian/python-${LOWER_PKG_NAME}; \\ + done + set -e ; for pyvers in \$(PYTHON3S); do \\ + python\$\$pyvers setup.py install --install-layout=deb \\ + --root \$(CURDIR)/debian/python3-${LOWER_PKG_NAME}; \\ + done + rm -rf \$(CURDIR)/debian/python*-${LOWER_PKG_NAME}/usr/lib/python*/dist-packages/*.pth + +override_dh_auto_test: +ifeq (,\$(findstring nocheck, \$(DEB_BUILD_OPTIONS))) + set -e ; for pyvers in \$(PYTHONS) \$(PYTHON3S); do \\ + python\$\$pyvers setup.py test ; \\ + done +endif + +${SPHINX_BUILD_RULES} +override_dh_clean: + dh_clean -O--buildsystem=python_distutils + rm -rf build + + +# Commands not to run +override_dh_installcatalogs: +override_dh_installemacsen override_dh_installifupdown: +override_dh_installinfo override_dh_installmenu override_dh_installmime: +override_dh_installmodules override_dh_installlogcheck: +override_dh_installpam override_dh_installppp override_dh_installudev override_dh_installwm: +override_dh_installxfonts override_dh_gconf override_dh_icons override_dh_perl override_dh_usrlocal: +override_dh_installcron override_dh_installdebconf: +override_dh_installlogrotate override_dh_installgsettings: +" >debian/rules +chmod +x debian/rules + +echo "version=3 +http://pypi.python.org/packages/source/${FIRST_LETTER}/${PKG_NAME} ${PKG_NAME}-(.*).tar.gz +" >debian/watch + +echo "3.0 (quilt)" >debian/source/format +echo 'extend-diff-ignore = "^[^/]*[.]egg-info/"' >debian/source/options diff -Nru openstack-pkg-tools-21ubuntu5/misc/pkgos-fetch-fake-repo openstack-pkg-tools-24ubuntu1/misc/pkgos-fetch-fake-repo --- openstack-pkg-tools-21ubuntu5/misc/pkgos-fetch-fake-repo 1970-01-01 01:00:00.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/misc/pkgos-fetch-fake-repo 2015-04-27 09:36:15.000000000 +0200 @@ -0,0 +1,30 @@ +#!/bin/sh +# This script prepares a /etc/pkgos/fake-${TARGET_DISTRO}-mirror folder +# with Packages.gz and Sources.gz files so that we can later on use +# the madison-lite script when using pkgos-parse-requirements. +# Indeed, using rmadison for this task is a way too slow, considering the +# average amount of dependency in a typical OpenStack component. + +set -e + +if ! [ -r /etc/pkgos/pkgos.conf ] ; then + echo "Could not read /etc/pkgos/pkgos.conf" + exit 1 +else + . /etc/pkgos/pkgos.conf +fi + +# Create the folder and remove the Packages.gz / Sources.gz +DEST_DIST_DIR=/etc/pkgos/fake-${TARGET_DISTRO}-mirror/dists/${TARGET_DISTRO}/main +for i in binary-all binary-amd64 source ; do + if ! [ -d ${DEST_DIST_DIR}/$i ] ; then + mkdir -p ${DEST_DIST_DIR}/$i + fi + if [ "$i" = "source" ] ; then + GZFILE=Sources.gz + else + GZFILE=Packages.gz + fi + rm -f ${DEST_DIST_DIR}/$i/$GZFILE + wget ${CLOSEST_DEBIAN_MIRROR}/dists/${TARGET_DISTRO}/main/$i/$GZFILE -O ${DEST_DIST_DIR}/$i/$GZFILE +done diff -Nru openstack-pkg-tools-21ubuntu5/misc/pkgos-parse-requirements openstack-pkg-tools-24ubuntu1/misc/pkgos-parse-requirements --- openstack-pkg-tools-21ubuntu5/misc/pkgos-parse-requirements 1970-01-01 01:00:00.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/misc/pkgos-parse-requirements 2015-04-27 09:36:15.000000000 +0200 @@ -0,0 +1,232 @@ +#!/bin/sh + +set -e + +if ! [ -r /etc/pkgos/pkgos.conf ] ; then + echo "Could not read /etc/pkgos/pkgos.conf" + exit 1 +else + . /etc/pkgos/pkgos.conf +fi + +if [ "${1}" = "-h" ] ; then + echo "This utility attemps to parse an OpenStack requirements.txt file" + echo "as input, and produce a list of Debian dependencies as output." + echo "Note that this is far from perfect, and that you *WILL* need to" + echo "manually check for the dependencies. This is only a helper in" + echo "order to gain some precious development time." + echo "" + echo "If this utility is called without a parameter, it will attempt" + echo "to read the requirements.txt and test-requirements.txt file." + echo "Otherwise, it takes the first argument as the file to parse." + exit 0 +fi + +# Some packages should never be in the dependencies in Debian, +# as they are included in Python 2.7. If you find one that is +# missing, just add it to the list it here. +BLACK_LIST="discover argparse ordereddict" +is_blacklisted () { + ISBLACKLISTED="no" + for i in $BLACK_LIST ; do + if [ "${i}" = "${1}" ] ; then + ISBLACKLISTED="yes" + fi + done +} + +# Some packages should never make it into the Build-Depends-Indep:, +# because they are already in Build-Depends:. Here's the list for it. +BUILD_DEPENDS_LIST="sphinx pbr" +is_build_depends () { + ISBUILDDEPENDS="no" + for i in ${BUILD_DEPENDS_LIST} ; do + if [ "${i}" = ${1} ] ; then + ISBUILDDEPENDS="yes" + fi + done +} + +EPOC_1_IN="python-cinderclient python-keystoneclient python-glanceclient python-swiftclient python-oslo.config" +has_1_in_epoc () { + HAS_1_IN_EPOC="no" + for i in ${EPOC_1_IN} ; do + if [ "${i}" = ${1} ] ; then + HAS_1_IN_EPOC="yes" + fi + done +} + +EPOC_2_IN="python-novaclient" +has_2_in_epoc () { + HAS_2_IN_EPOC="no" + for i in ${EPOC_2_IN} ; do + if [ "${i}" = ${1} ] ; then + HAS_2_IN_EPOC="yes" + fi + done +} + +NO_PYTHON_PREFIX="alembic testrepository subunit websockify cliff-tablib" +is_python_prefixed () { + PY_PREFIX="yes" + for i in ${NO_PYTHON_PREFIX} ; do + if [ "${i}" = "${1}" ] ; then + PY_PREFIX="no" + fi + done +} + +# Param: $1: input file +# $2: if set, then the Build-Depends: programs will be removed (for example: sphinx, pbr, etc.) +parse_and_print () { + INPUT_FILE=$1 + REMOVE_BUILD_DEPENDS="no" + if [ -n "${2}" ] ; then + REMOVE_BUILD_DEPENDS="yes" + fi + DEP_LIST="" +# echo `cat ${INPUT_FILE} | grep -v '^#' | grep -v '^[ \t]*$' | awk '{print $1}' | tr '[:upper:]' '[:lower:]' | sed $EXP` + for i in `cat ${INPUT_FILE} | grep -v '^#' | grep -v '^[ \t]*$' | awk '{print $1}' | tr '[:upper:]' '[:lower:]' | sed $EXP` ; do +# echo "Line ---> $i" + VERS=`echo $i | sed -e 's/^[-a-zA-Z0-9._]*//'` + if [ -n "$VERS" ] ; then + PKG=`echo $i | sed -e "s/$VERS//" | sed -e s/python-//` + else + PKG=`echo $i | sed -e s/python-//` + fi + PKG=`echo $PKG | sed -e s/_/-/` + is_blacklisted $PKG + ISBUILDDEPENDS="no" + if [ REMOVE_BUILD_DEPENDS="yes" ] ; then + is_build_depends $PKG + fi + if [ $ISBLACKLISTED = "no" ] && [ ${ISBUILDDEPENDS} = "no" ]; then + is_python_prefixed ${PKG} + if [ ${PY_PREFIX} = "yes" ] ; then + PKG=python-$PKG + fi + # Convert the package name into lowercase, as Debian + # doesn't have any upper case in package names + PKG=`echo $PKG | tr '[:upper:]' '[:lower:]'` + if [ -n "$VERS" ] && [ $PKG != "python-hacking" ] ; then + # If there's a a version-depends, convert the pip style + # of dependency to the Debian one (ie: >> instead of >) + FIRST_CONSTR=`echo $VERS | cut -d, -f1` + FIRST_NUMS=`echo $FIRST_CONSTR | sed -e 's/[<>=\!]*//'` + FIRST_SIGN=`echo $FIRST_CONSTR | sed -e "s/${FIRST_NUMS}//"` + if [ "${FIRST_SIGN}" = '<' ] ; then + FIRST_SIGN='<<' + fi + if [ "${FIRST_SIGN}" = '>' ] ; then + FIRST_SIGN='>>' + fi + has_1_in_epoc $PKG + if [ "${HAS_1_IN_EPOC}" = "yes" ] ; then + FIRST_NUMS="1:${FIRST_NUMS}" + fi + has_2_in_epoc $PKG + if [ "${HAS_2_IN_EPOC}" = "yes" ] ; then + FIRST_NUMS="2:${FIRST_NUMS}" + fi + # If there's a fake-jessie-mirror folder in /etc/pkgos + # use that one with madison-lite to check if the version + # of the package is already in Jessie. + if [ -d /etc/pkgos/fake-jessie-mirror ] ; then + STABLE_VERSION=`madison-lite -a all,amd64 --mirror /etc/pkgos/fake-${TARGET_DISTRO}-mirror ${PKG} | awk '{print $3}'` + # Make sure that the package is in the stable repo + if [ -z "${STABLE_VERSION}" ] ; then + VERSION_TO_DEPEND_ON=" (${FIRST_SIGN} ${FIRST_NUMS})" + else + #echo "Comparing for ${PKG}: dpkg --compare-versions ${STABLE_VERSION} gt ${FIRST_NUMS}" + if dpkg --compare-versions ${STABLE_VERSION} gt ${FIRST_NUMS} ; then + VERSION_TO_DEPEND_ON="" + else + VERSION_TO_DEPEND_ON=" (${FIRST_SIGN} ${FIRST_NUMS})" + fi + fi + else + VERSION_TO_DEPEND_ON=" (${FIRST_SIGN} ${FIRST_NUMS})" + fi + if [ -z "${DEP_LIST}" ] ; then + DEP_LIST="${PKG}${VERSION_TO_DEPEND_ON}" + #echo " $PKG (${FIRST_SIGN} ${FIRST_NUMS})," + else + DEP_LIST="${DEP_LIST}\n$PKG${VERSION_TO_DEPEND_ON}" + fi + else + if [ -z "${DEP_LIST}" ] ; then + DEP_LIST="$PKG" + else + #echo " $PKG," + DEP_LIST="${DEP_LIST}\n$PKG" + fi + fi + #echo "Package: $PKG\t\tFirst sign: ${FIRST_SIGN}\t\tFirst num: ${FIRST_NUMS}..." + fi + done +} + +# Param: $DEPS: the dependency list, one package per line +# $1: the word for the package dep (ie: Depends: or Build-Depends-Indep:) +format_output () { +# set -x + SPACES_IN_FRONT=`echo "${1} " | sed -e 's/[a-zBDI:-]/ /g'` + CNT="0" + echo $DEPS | LC_COLLATE=C sort -u | while read i ; do + if [ "${CNT}" = "0" ] ; then + echo "${1} ${i}," + else + echo -n "${1}" | sed -e 's/[a-zBDI:-]/ /g' + echo " ${i}," + fi + CNT=$(($CNT + 1)) + done + if [ $1 = "Depends:" ] ; then + echo " \${misc:Depends}," + echo " \${python:Depends}," + fi +} + +calc_substitue_list () { + if [ -r /etc/pkgos/substitute ] ; then + while read i ; do + SOURCE=`echo $i | cut -d" " -f1` + DEST=`echo $i | cut -d" " -f2` + EXP="$EXP -e s/$SOURCE/$DEST/" + done = 9), + dh-python, + dh-systemd, + openstack-pkg-tools (>= 23~), + po-debconf, + python-all (>= 2.6.6-3~), + python-pbr, + python-sphinx," + # Gather the dependencies. + if [ -e test-requirements-py2.txt ] ; then + parse_and_print test-requirements-py2.txt build-depends + else + parse_and_print test-requirements.txt build-depends + fi + DEP_LIST_TESTS=${DEP_LIST} + parse_and_print requirements.txt + DEP_LIST_RUNTIME=${DEP_LIST} + + # Format the output + DEPS="${DEP_LIST_RUNTIME}\n${DEP_LIST_TESTS}" + format_output "Build-Depends-Indep:" + + DEPS=${DEP_LIST_RUNTIME} + format_output "Depends:" +fi diff -Nru openstack-pkg-tools-21ubuntu5/misc/pkgos-reqsdiff openstack-pkg-tools-24ubuntu1/misc/pkgos-reqsdiff --- openstack-pkg-tools-21ubuntu5/misc/pkgos-reqsdiff 1970-01-01 01:00:00.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/misc/pkgos-reqsdiff 2015-04-27 09:36:15.000000000 +0200 @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +TEMP_FILE1=`mktemp -t pkgos-reqsdiff1.XXXXXX` || exit 1 +TEMP_FILE2=`mktemp -t pkgos-reqsdiff1.XXXXXX` || exit 1 +pkgos-show-control-depends >${TEMP_FILE1} +pkgos-parse-requirements >${TEMP_FILE2} +diff -u ${TEMP_FILE1} ${TEMP_FILE2} +rm -f ${TEMP_FILE1} ${TEMP_FILE2} diff -Nru openstack-pkg-tools-21ubuntu5/misc/pkgos-show-control-depends openstack-pkg-tools-24ubuntu1/misc/pkgos-show-control-depends --- openstack-pkg-tools-21ubuntu5/misc/pkgos-show-control-depends 1970-01-01 01:00:00.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/misc/pkgos-show-control-depends 2015-04-27 09:36:15.000000000 +0200 @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e + +TOTAL_NUM_OF_LINES=`cat debian/control | wc -l` +BUILD_DEPENDS_LINE=`cat debian/control | grep -n "^Build-Depends:" | head -n 1 | cut -d":" -f1` +BUILD_DEPENDS_INDEP_LINE=`cat debian/control | grep -n "^Build-Depends-Indep:" | head -n 1 | cut -d":" -f1` +STANDARD_VERSION_LINE=`cat debian/control | grep -n "^Standards-Version:" | head -n 1 | cut -d":" -f1` +DEPENDS_LINE=`cat debian/control | grep -n "^Depends:" | head -n 1 | cut -d":" -f1` +DESCRIPTION_LINE=`cat debian/control | grep -n "^Description:" | head -n 1 | cut -d":" -f1` + +# Params: $1 line start +# $2 line end +show_part_of_file () { + LINE_END=$((${2} - 1)) + TMP_FILE=`mktemp -t pkgos-show-control-depends.XXXXXX` || exit 1 + head -n ${LINE_END} debian/control >${TMP_FILE} + LINE_START=$(($LINE_END - ${1} + 1)) + tail -n ${LINE_START} ${TMP_FILE} + rm ${TMP_FILE} +} + +# Show Build-Depends: +show_part_of_file ${BUILD_DEPENDS_LINE} ${BUILD_DEPENDS_INDEP_LINE} + +# Show Build-Depends-Indep: +show_part_of_file ${BUILD_DEPENDS_INDEP_LINE} ${STANDARD_VERSION_LINE} + +# Show Depends: +show_part_of_file ${DEPENDS_LINE} ${DESCRIPTION_LINE} diff -Nru openstack-pkg-tools-21ubuntu5/pkgos_func openstack-pkg-tools-24ubuntu1/pkgos_func --- openstack-pkg-tools-21ubuntu5/pkgos_func 2015-01-08 10:33:12.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/pkgos_func 2015-04-27 09:36:15.000000000 +0200 @@ -96,11 +96,21 @@ INIFILE_SHELL_INCLUDE=no fi INIFILE_ACCESS_MODE=${1} ; INIFILE_MYCONFIG=${2} ; INIFILE_SEARCH_SECTION=${3} ; SEARCH_DIRECTIVE=${4} + if [ "${PKGOS_VERBOSE}" = "yes" ] ; then + if [ "x${INIFILE_ACCESS_MODE}" = "xset" ] ; then + echo "pkgos_inifile: Setting value in ${INIFILE_MYCONFIG}:[${INIFILE_SEARCH_SECTION}]/${SEARCH_DIRECTIVE}" + else + echo "pkgos_inifile: Getting value in ${INIFILE_MYCONFIG}:[${INIFILE_SEARCH_SECTION}]/${SEARCH_DIRECTIVE}" + fi + fi if [ "x${INIFILE_ACCESS_MODE}" = "xset" ] ; then INIFILE_NEW_VALUE=${5} ; else INIFILE_NEW_VALUE="pkgos_inifile_function_called_with_wrong_access_mode" ; fi INIFILE_CNT=0 RET=NOT_FOUND - if [ ! -r ${INIFILE_MYCONFIG} ] ; then return ; fi + if [ ! -r "${INIFILE_MYCONFIG}" ] ; then + if [ "${PKGOS_VERBOSE}" = "yes" ] ; then echo "Config file ${INIFILE_MYCONFIG} not readable: exiting" ; fi + return + fi # Iterate through all lines of the file while read INIFILE_LINE ; do diff -Nru openstack-pkg-tools-21ubuntu5/pkgos.make openstack-pkg-tools-24ubuntu1/pkgos.make --- openstack-pkg-tools-21ubuntu5/pkgos.make 2015-01-12 13:35:34.000000000 +0100 +++ openstack-pkg-tools-24ubuntu1/pkgos.make 2015-04-27 09:36:15.000000000 +0200 @@ -20,6 +20,7 @@ MYINIT=`echo $$i | sed s/.init.in//` ; \ cp $$i $$MYINIT.init ; \ cat /usr/share/openstack-pkg-tools/init-script-template >>$$MYINIT.init ; \ + pkgos-gen-systemd-unit $$i ; \ done # If there's an upstart.in file, use that one instead of the generated one for i in `ls -1 debian/*.upstart.in` ; do \