waja revised this gist 12 years ago. Go to revision
1 file changed, 1 insertion, 1 deletion
git2release
| @@ -63,7 +63,7 @@ case "$1" in | |||
| 63 | 63 | ORIGTAR=$(echo "${UTARBALL}"|sed 's/\.tar\.gz/.orig.tar.gz/'|sed 's/plugins-/plugins_/') | |
| 64 | 64 | UTARBALL=$(basename ${UTARBALL}) | |
| 65 | 65 | [ -L "${ORIGTAR}" ] || ln -s "${UTARBALL}" "${ORIGTAR}" | |
| 66 | - | if [ "$(echo ${DEBIAN_FRONTEND} | grep noninteractive | wc -l)" -gt "0" ]; then | |
| 66 | + | if [ ! "$(echo ${DEBIAN_FRONTEND} | grep noninteractive | wc -l)" -gt "0" ]; then | |
| 67 | 67 | # fetch build-deps | |
| 68 | 68 | sudo apt-get build-dep nagios-plugins | |
| 69 | 69 | # add changelog entry and start to build the package | |
waja revised this gist 12 years ago. Go to revision
1 file changed, 1 insertion
git2release
| @@ -61,6 +61,7 @@ case "$1" in | |||
| 61 | 61 | # create a symlink to match debian conventions | |
| 62 | 62 | # FIXME - the last part of this needs to be approved | |
| 63 | 63 | ORIGTAR=$(echo "${UTARBALL}"|sed 's/\.tar\.gz/.orig.tar.gz/'|sed 's/plugins-/plugins_/') | |
| 64 | + | UTARBALL=$(basename ${UTARBALL}) | |
| 64 | 65 | [ -L "${ORIGTAR}" ] || ln -s "${UTARBALL}" "${ORIGTAR}" | |
| 65 | 66 | if [ "$(echo ${DEBIAN_FRONTEND} | grep noninteractive | wc -l)" -gt "0" ]; then | |
| 66 | 67 | # fetch build-deps | |
waja revised this gist 12 years ago. Go to revision
1 file changed, 7 insertions, 5 deletions
git2release
| @@ -51,7 +51,7 @@ case "$1" in | |||
| 51 | 51 | fi | |
| 52 | 52 | fi | |
| 53 | 53 | #DEBIANGITURL="git@github.com:waja/pkg-nagios-plugins.git" | |
| 54 | - | DEBIANGITURL="git@github.com:waja/pkg-nagios-plugins.git -b m-p" | |
| 54 | + | DEBIANGITURL="https://github.com/waja/pkg-nagios-plugins.git -b m-p" | |
| 55 | 55 | # extract the tarball | |
| 56 | 56 | tar -xzf "${UTARBALL}" | |
| 57 | 57 | # fetch latest debian packaging | |
| @@ -62,10 +62,12 @@ case "$1" in | |||
| 62 | 62 | # FIXME - the last part of this needs to be approved | |
| 63 | 63 | ORIGTAR=$(echo "${UTARBALL}"|sed 's/\.tar\.gz/.orig.tar.gz/'|sed 's/plugins-/plugins_/') | |
| 64 | 64 | [ -L "${ORIGTAR}" ] || ln -s "${UTARBALL}" "${ORIGTAR}" | |
| 65 | - | # fetch build-deps | |
| 66 | - | sudo apt-get build-dep nagios-plugins | |
| 67 | - | # add changelog entry and start to build the package | |
| 68 | - | cd "${PROJECT}" && dch -R && debuild -sa | |
| 65 | + | if [ "$(echo ${DEBIAN_FRONTEND} | grep noninteractive | wc -l)" -gt "0" ]; then | |
| 66 | + | # fetch build-deps | |
| 67 | + | sudo apt-get build-dep nagios-plugins | |
| 68 | + | # add changelog entry and start to build the package | |
| 69 | + | cd "${PROJECT}" && dch -R && debuild -sa | |
| 70 | + | fi | |
| 69 | 71 | ;; | |
| 70 | 72 | *) | |
| 71 | 73 | echo "Usage: ${0} [--release-tarball|--prepare-debian]" >&2 | |
waja revised this gist 12 years ago. Go to revision
1 file changed, 2 insertions, 2 deletions
git2release
| @@ -25,8 +25,8 @@ case "$1" in | |||
| 25 | 25 | mv ${EXTRACTDIR}/* ${EXTRACTDIR}/.. && rm ${EXTRACTDIR}/.git* && rmdir ${EXTRACTDIR} | |
| 26 | 26 | # install needed packages | |
| 27 | 27 | if [ ! $(apt-cache showsrc nagios-plugins | grep "^Package: nagios-plugins" | wc -l) -gt "0" ]; then sudo echo "deb-src ftp://ftp.de.debian.org/debian unstable main contrib non-free" > /etc/apt/sources.list.d/unstable.list && sudo apt-get update; fi | |
| 28 | - | sudo apt-get build-dep -qq --no-install-recommends nagios-plugins | |
| 29 | - | sudo apt-get install -qq --no-install-recommends autoconf automake | |
| 28 | + | sudo apt-get build-dep -y -qq --no-install-recommends nagios-plugins | |
| 29 | + | sudo apt-get install -y -qq --no-install-recommends autoconf automake | |
| 30 | 30 | # create release tarball | |
| 31 | 31 | cd ${TMPDIR}/${PROJECT} | |
| 32 | 32 | tools/setup && ./configure && make dist | |
waja revised this gist 12 years ago. Go to revision
1 file changed, 2 insertions, 2 deletions
git2release
| @@ -25,8 +25,8 @@ case "$1" in | |||
| 25 | 25 | mv ${EXTRACTDIR}/* ${EXTRACTDIR}/.. && rm ${EXTRACTDIR}/.git* && rmdir ${EXTRACTDIR} | |
| 26 | 26 | # install needed packages | |
| 27 | 27 | if [ ! $(apt-cache showsrc nagios-plugins | grep "^Package: nagios-plugins" | wc -l) -gt "0" ]; then sudo echo "deb-src ftp://ftp.de.debian.org/debian unstable main contrib non-free" > /etc/apt/sources.list.d/unstable.list && sudo apt-get update; fi | |
| 28 | - | sudo apt-get build-dep --no-install-recommends nagios-plugins | |
| 29 | - | sudo apt-get install --no-install-recommends autoconf automake | |
| 28 | + | sudo apt-get build-dep -qq --no-install-recommends nagios-plugins | |
| 29 | + | sudo apt-get install -qq --no-install-recommends autoconf automake | |
| 30 | 30 | # create release tarball | |
| 31 | 31 | cd ${TMPDIR}/${PROJECT} | |
| 32 | 32 | tools/setup && ./configure && make dist | |
waja revised this gist 12 years ago. Go to revision
1 file changed, 1 insertion
git2release
| @@ -24,6 +24,7 @@ case "$1" in | |||
| 24 | 24 | # move all one directory level higher | |
| 25 | 25 | mv ${EXTRACTDIR}/* ${EXTRACTDIR}/.. && rm ${EXTRACTDIR}/.git* && rmdir ${EXTRACTDIR} | |
| 26 | 26 | # install needed packages | |
| 27 | + | if [ ! $(apt-cache showsrc nagios-plugins | grep "^Package: nagios-plugins" | wc -l) -gt "0" ]; then sudo echo "deb-src ftp://ftp.de.debian.org/debian unstable main contrib non-free" > /etc/apt/sources.list.d/unstable.list && sudo apt-get update; fi | |
| 27 | 28 | sudo apt-get build-dep --no-install-recommends nagios-plugins | |
| 28 | 29 | sudo apt-get install --no-install-recommends autoconf automake | |
| 29 | 30 | # create release tarball | |
waja revised this gist 12 years ago. Go to revision
1 file changed, 2 insertions, 2 deletions
git2release
| @@ -24,8 +24,8 @@ case "$1" in | |||
| 24 | 24 | # move all one directory level higher | |
| 25 | 25 | mv ${EXTRACTDIR}/* ${EXTRACTDIR}/.. && rm ${EXTRACTDIR}/.git* && rmdir ${EXTRACTDIR} | |
| 26 | 26 | # install needed packages | |
| 27 | - | sudo apt-get build-dep nagios-plugins | |
| 28 | - | sudo aptitude install autoconf automake | |
| 27 | + | sudo apt-get build-dep --no-install-recommends nagios-plugins | |
| 28 | + | sudo apt-get install --no-install-recommends autoconf automake | |
| 29 | 29 | # create release tarball | |
| 30 | 30 | cd ${TMPDIR}/${PROJECT} | |
| 31 | 31 | tools/setup && ./configure && make dist | |
waja revised this gist 12 years ago. Go to revision
1 file changed, 1 insertion, 1 deletion
git2release
| @@ -11,7 +11,7 @@ case "$1" in | |||
| 11 | 11 | --release-tarball) | |
| 12 | 12 | URL=${2} | |
| 13 | 13 | UTARBALL=$(basename ${URL}) | |
| 14 | - | PROJECT=$(basename -s .tar.gz ${UTARBALL}) | |
| 14 | + | PROJECT=$(basename ${UTARBALL} .tar.gz) | |
| 15 | 15 | REPACKURL="https://raw.github.com/waja/pkg-nagios-plugins/master/debian/bin/repack.sh" | |
| 16 | 16 | ||
| 17 | 17 | # grab tarball | |
waja revised this gist 12 years ago. Go to revision
1 file changed, 73 insertions
git2release(file created)
| @@ -0,0 +1,73 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | #TMPDIR=/tmp/ | |
| 3 | + | # creating temp dir | |
| 4 | + | TMPDIR=`mktemp -d` | |
| 5 | + | trap "rm -rf $TMPDIR" EXIT | |
| 6 | + | # defining some values | |
| 7 | + | DIR=$(pwd) | |
| 8 | + | # git clone git://git.debian.org/git/pkg-nagios/pkg-nagios-plugins.git /tmp/monitoring-plugins.git | |
| 9 | + | ||
| 10 | + | case "$1" in | |
| 11 | + | --release-tarball) | |
| 12 | + | URL=${2} | |
| 13 | + | UTARBALL=$(basename ${URL}) | |
| 14 | + | PROJECT=$(basename -s .tar.gz ${UTARBALL}) | |
| 15 | + | REPACKURL="https://raw.github.com/waja/pkg-nagios-plugins/master/debian/bin/repack.sh" | |
| 16 | + | ||
| 17 | + | # grab tarball | |
| 18 | + | wget ${URL} -O ${TMPDIR}/${UTARBALL} | |
| 19 | + | # create a dir where we extract | |
| 20 | + | mkdir -p ${TMPDIR}/${PROJECT} | |
| 21 | + | # extract the tarball | |
| 22 | + | tar -xzf ${TMPDIR}/${UTARBALL} -C ${TMPDIR}/${PROJECT} | |
| 23 | + | EXTRACTDIR=$(ls -d ${TMPDIR}/${PROJECT}/*) | |
| 24 | + | # move all one directory level higher | |
| 25 | + | mv ${EXTRACTDIR}/* ${EXTRACTDIR}/.. && rm ${EXTRACTDIR}/.git* && rmdir ${EXTRACTDIR} | |
| 26 | + | # install needed packages | |
| 27 | + | sudo apt-get build-dep nagios-plugins | |
| 28 | + | sudo aptitude install autoconf automake | |
| 29 | + | # create release tarball | |
| 30 | + | cd ${TMPDIR}/${PROJECT} | |
| 31 | + | tools/setup && ./configure && make dist | |
| 32 | + | RELEASETAR=$(ls ${TMPDIR}/${PROJECT}/*.tar.gz) | |
| 33 | + | # download debian repack script | |
| 34 | + | REPACK=$(basename ${REPACKURL}) | |
| 35 | + | wget ${REPACKURL} -O ${TMPDIR}/${REPACK} | |
| 36 | + | # repack everything | |
| 37 | + | chmod +x ${TMPDIR}/${REPACK} | |
| 38 | + | ${TMPDIR}/${REPACK} ${RELEASETAR} | |
| 39 | + | # copy everything in here | |
| 40 | + | cp $(ls ${TMPDIR}/${PROJECT}/*.tar.gz) ${DIR} | |
| 41 | + | ;; | |
| 42 | + | --prepare-debian) | |
| 43 | + | UTARBALL=${2} | |
| 44 | + | PROJECT=$(basename $(tar tfz "${UTARBALL}" | head -1)) | |
| 45 | + | if [ -d "${PROJECT}" ] ; then | |
| 46 | + | echo -n remove "${PROJECT}"? ${RTURN} | |
| 47 | + | read RTURN | |
| 48 | + | if [ "$RTURN" == "Y" ] || [ "$RTURN" == "y" ] ; then | |
| 49 | + | rm -rf "${PROJECT}" | |
| 50 | + | fi | |
| 51 | + | fi | |
| 52 | + | #DEBIANGITURL="git@github.com:waja/pkg-nagios-plugins.git" | |
| 53 | + | DEBIANGITURL="git@github.com:waja/pkg-nagios-plugins.git -b m-p" | |
| 54 | + | # extract the tarball | |
| 55 | + | tar -xzf "${UTARBALL}" | |
| 56 | + | # fetch latest debian packaging | |
| 57 | + | git clone ${DEBIANGITURL} "${TMPDIR}" | |
| 58 | + | # copy over the whole debian packaging | |
| 59 | + | cp -a "${TMPDIR}"/debian "${PROJECT}" | |
| 60 | + | # create a symlink to match debian conventions | |
| 61 | + | # FIXME - the last part of this needs to be approved | |
| 62 | + | ORIGTAR=$(echo "${UTARBALL}"|sed 's/\.tar\.gz/.orig.tar.gz/'|sed 's/plugins-/plugins_/') | |
| 63 | + | [ -L "${ORIGTAR}" ] || ln -s "${UTARBALL}" "${ORIGTAR}" | |
| 64 | + | # fetch build-deps | |
| 65 | + | sudo apt-get build-dep nagios-plugins | |
| 66 | + | # add changelog entry and start to build the package | |
| 67 | + | cd "${PROJECT}" && dch -R && debuild -sa | |
| 68 | + | ;; | |
| 69 | + | *) | |
| 70 | + | echo "Usage: ${0} [--release-tarball|--prepare-debian]" >&2 | |
| 71 | + | exit 3 | |
| 72 | + | ;; | |
| 73 | + | esac | |