From 33064cdd17c0cc2ecdabf702af45481087221127 Mon Sep 17 00:00:00 2001 From: Bill Winslow Date: Mon, 1 Sep 2014 13:45:48 -0500 Subject: [PATCH 1/3] modify buildPackages --- buildPackages.sh | 54 ++++++++++++++++++++++++++++++++++++++++++ coreav.cpp | 16 +++++++++++++ tools/buildPackages.sh | 31 ------------------------ 3 files changed, 70 insertions(+), 31 deletions(-) create mode 100755 buildPackages.sh delete mode 100644 tools/buildPackages.sh diff --git a/buildPackages.sh b/buildPackages.sh new file mode 100755 index 000000000..cddbe29fa --- /dev/null +++ b/buildPackages.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# Config (Update me if needed !) +VERSION_UPSTREAM="1.0" +VERSION_PACKAGE="1" +PACKAGENAME="qtox" +UPSTREAM_URL="https://github.com/tux3/qTox/archive/master.tar.gz" + +# Make some vars for convenience +VERNAME=$PACKAGENAME"_"$VERSION_UPSTREAM +FULLVERNAME=$VERNAME"-"$VERSION_PACKAGE +ARCHIVENAME=$VERNAME".orig.tar.gz" + +# ARCHIVENAME > FULLVERNAME > VERNAME = PACKAGENAME+UPVER + +# Get the requried tools if needed +echo "Installing missing tools (if any)..." +if [[ $EUID -ne 0 ]]; then + sudo apt-get install wget debhelper cdbs devscripts alien tar gzip build-essential +else + apt-get install wget debhelper cdbs devscripts alien tar gzip build-essential +fi + +mkdir -p .packages +cd .packages + +# Cleanup +rm -r $VERNAME 2> /dev/null +rm $ARCHIVENAME 2> /dev/null + +# Fectch sources and layout directories +wget -O $ARCHIVENAME $UPSTREAM_URL +tar xvf $ARCHIVENAME # Extracts to qTox-master +mv qTox-master $VERNAME +#tar cz $VERNAME > $ARCHIVENAME + +# Build packages +cd $VERNAME +debuild -us -uc +cd .. + +# alien warns that it should probably be run as root... +if [[ $EUID -ne 0 ]]; then + sudo alien ./$FULLVERNAME*.deb -r +else + alien ./$FULLVERNAME*.deb -r +fi + +mv *.deb .. +mv *.rpm .. + +rm -r * +cd .. +rmdir .packages diff --git a/coreav.cpp b/coreav.cpp index 2b18e37d4..2a3ce7a67 100644 --- a/coreav.cpp +++ b/coreav.cpp @@ -1,3 +1,19 @@ +/* + Copyright (C) 2013 by Maxim Biro + + This file is part of Tox Qt GUI. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the COPYING file for more details. +*/ + #include "core.h" #include "widget/widget.h" diff --git a/tools/buildPackages.sh b/tools/buildPackages.sh deleted file mode 100644 index 03e7415a2..000000000 --- a/tools/buildPackages.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# Config (Update me if needed !) -VERSION_UPSTREAM="1.0" -VERSION_PACKAGE="1" -PACKAGENAME="qtox" -UPSTREAM_GIT_URL="https://github.com/tux3/qtox.git" - -# Make some vars for convenience -VERNAME=$PACKAGENAME"_"$VERSION_UPSTREAM -FULLVERNAME=$VERNAME"-"$VERSION_PACKAGE -ARCHIVENAME=$VERNAME".orig.tar.gz" - -# Get the requried tools if needed -echo "Installing missing tools (if any)..." -apt-get install git debhelper cdbs devscripts alien tar gzip build-essential - -# Cleanup -rm -r $VERNAME 2> /dev/null -rm $ARCHIVENAME 2> /dev/null - -# Fectche sources and layour directories -git clone --depth 1 $UPSTREAM_GIT_URL -mv $PACKAGENAME $VERNAME -tar cz $VERNAME > $ARCHIVENAME - -# Build packages -cd $VERNAME -debuild -us -uc -cd .. -alien ./$FULLVERNAME*.deb -r From 68649cb44854a046e0adda5bf2ddbbff07f379ae Mon Sep 17 00:00:00 2001 From: Bill Winslow Date: Mon, 1 Sep 2014 14:09:31 -0500 Subject: [PATCH 2/3] Fancy package script --- buildPackages.sh | 68 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 56 insertions(+), 12 deletions(-) diff --git a/buildPackages.sh b/buildPackages.sh index cddbe29fa..dc01f4a82 100755 --- a/buildPackages.sh +++ b/buildPackages.sh @@ -13,12 +13,53 @@ ARCHIVENAME=$VERNAME".orig.tar.gz" # ARCHIVENAME > FULLVERNAME > VERNAME = PACKAGENAME+UPVER +# Get some args +OPT_SUDO=true +OPT_APT=true +OPT_KEEP=false +while [ $# -ge 1 ] ; do + if [ ${1} = "-s" -o ${1} = "--no-sudo" ] ; then + OPT_SUDO=false + shift + elif [ ${1} = "-a" -o ${1} = "--no-apt" ] ; then + OPT_APT=false + shift + elif [ ${1} = "-k" -o ${1} = "--keep" ]; then + OPT_KEEP=true + shift + else + if [ ${1} != "-h" -a ${1} != "--help" ] ; then + echo "[ERROR] Unknown parameter \"${1}\"" + echo "" + fi + + # print help + echo "Use this script to build qTox packages for Debian and Red Hat families" + echo "" + echo "usage:" + echo " ${0} [-h|--help|-k|--keep|-s|--no-sudo|-a|--no-apt]" + echo "" + echo "parameters:" + echo " -h|--help : displays this help" + echo " -s|--no-sudo: disables using sudo for apt and alien" + echo " -a|--no-apt : disables apt-get (used for build deps) entirely" + echo " -k|--keep : does not delete the build files afterwards" + echo "" + echo "example usages:" + echo " ${0} -- build packages, cleaning up trash and running sudo alien and apt-get" + echo " ${0} -s -k -- build packages, keeping build files and non-sudo alien and apt-get" + exit 1 + fi +done + # Get the requried tools if needed -echo "Installing missing tools (if any)..." -if [[ $EUID -ne 0 ]]; then - sudo apt-get install wget debhelper cdbs devscripts alien tar gzip build-essential -else - apt-get install wget debhelper cdbs devscripts alien tar gzip build-essential +if [[ $OPT_APT = "true" ]]; then + echo "Installing missing tools (if any)..." + if [[ $EUID -ne 0 && $OPT_SUDO = "true" ]]; then + sudo apt-get install wget debhelper cdbs devscripts alien tar gzip build-essential + else + apt-get install wget debhelper cdbs devscripts alien tar gzip build-essential + fi fi mkdir -p .packages @@ -30,7 +71,7 @@ rm $ARCHIVENAME 2> /dev/null # Fectch sources and layout directories wget -O $ARCHIVENAME $UPSTREAM_URL -tar xvf $ARCHIVENAME # Extracts to qTox-master +tar xvf $ARCHIVENAME 2> /dev/null # Extracts to qTox-master mv qTox-master $VERNAME #tar cz $VERNAME > $ARCHIVENAME @@ -40,15 +81,18 @@ debuild -us -uc cd .. # alien warns that it should probably be run as root... -if [[ $EUID -ne 0 ]]; then - sudo alien ./$FULLVERNAME*.deb -r +if [[ $EUID -ne 0 && $OPT_SUDO = "true" ]]; then + sudo alien ./$FULLVERNAME*.deb -r else - alien ./$FULLVERNAME*.deb -r + alien ./$FULLVERNAME*.deb -r fi mv *.deb .. -mv *.rpm .. +mv -f *.rpm .. + +if [[ $OPT_KEEP = "false" ]]; then + rm -r * +fi -rm -r * cd .. -rmdir .packages +rmdir .packages 2> /dev/null # fails if non empty From 8a64a415a068781da88b8431864966788784f4a6 Mon Sep 17 00:00:00 2001 From: Bill Winslow Date: Mon, 1 Sep 2014 14:20:06 -0500 Subject: [PATCH 3/3] moved packages script back to tools --- buildPackages.sh => tools/buildPackages.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename buildPackages.sh => tools/buildPackages.sh (100%) diff --git a/buildPackages.sh b/tools/buildPackages.sh similarity index 100% rename from buildPackages.sh rename to tools/buildPackages.sh