From 7aa344a5e83de7214b1201647e665bc493c96cdb Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 5 Aug 2016 17:56:42 +0200 Subject: PPA release script, still work in progress. --- scripts/release_ppa.sh | 212 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100755 scripts/release_ppa.sh diff --git a/scripts/release_ppa.sh b/scripts/release_ppa.sh new file mode 100755 index 00000000..e29443b9 --- /dev/null +++ b/scripts/release_ppa.sh @@ -0,0 +1,212 @@ +#!/usr/bin/env bash +############################################################################## +## This is used to package .deb packages and upload them to the launchpad +## ppa servers for building. +## +## The gnupg key for "build@ethdev.com" has to be present in order to sign +## the package. +## +## It will clone the Solidity git from github, determine the version, +## create a source archive and push it to the ubuntu ppa servers. +## +## A version, tag or commit hash can be given as argument. +## +############################################################################## + +set -ev + +keyid=703F83D0 +email=builds@ethereum.org +packagename=solc + +# TODO determine whether to use dev or not +pparepo=ethereum/ethereum-dev +ppafilesurl=https://launchpad.net/~ethereum/+archive/ubuntu/ethereum-dev/+files + +for distribution in trusty vivid wily xenial yakkety +do +cd /tmp/ +mkdir $distribution +cd $distribution + +# Fetch source +git clone --recursive https://github.com/ethereum/solidity.git -b $1 +mv solidity solc + +# Determine version +cd solc +version=`grep -oP "PROJECT_VERSION \"?\K[0-9.]+(?=\")"? CMakeLists.txt` +commithash=`git rev-parse --short HEAD` +committimestamp=`git show --format=%ci HEAD | head -n 1` +commitdate=`git show --format=%ci HEAD | head -n 1 | cut - -b1-10` + +# TODO determine if we are on a "release" (tagged commit?) and push to non-dev in that case +# TODO store the commit hash in a file so that the build info mechanism can pick it up even without git + +debversion="$version-nightly-$commitdate-ffi-$commithash" +tar --mtime "$committimestamp" --exclude .git -czf ../${packagename}_${debversion}.orig.tar.gz . + +# Create debian package information + +case $distribution in + trusty) + jsoncpplib=libjsoncppv0 + ;; + vivid) + jsoncpplib=libjsoncppv0 + ;; + wily) + jsoncpplib=libjsoncppv0v5 + ;; + *) + jsoncpplib=libjsoncpp1 + ;; +esac + +mkdir debian +echo 9 > debian/compat +cat < debian/control +Source: solc +Section: science +Priority: extra +Maintainer: Christian (Buildserver key) +Build-Depends: debhelper (>= 9.0.0), + dh_sphinxdoc, + libcryptopp-dev, + cmake, + g++-4.8, + git, + libgmp-dev, + libboost-all-dev, + automake, + libtool, + scons, + libjsoncpp-dev +Standards-Version: 3.9.5 +Homepage: https://ethereum.org +Vcs-Git: git://github.com/ethereum/solidity.git +Vcs-Browser: https://github.com/ethereum/solidity + +Package: solc +Architecture: any-i386 any-amd64 +Multi-Arch: same +Depends: \${shlibs:Depends}, \${misc:Depends}, $jsoncpplib +Description: Solidity compiler. + The commandline interface to the Solidity smart contract compiler. +EOF +cat < debian/rules +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. +# +# Modified to make a template file for a multi-binary package with separated +# build-arch and build-indep targets by Bill Allombert 2001 + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + + +%: + dh \$@ --buildsystem=cmake --with sphinxdoc + +override_dh_auto_test: + +override_dh_installdocs: + make -C docs html + dh_installdocs docs/_build/html + +override_dh_shlibdeps: + dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info +EOF +cat < debian/copyright +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: solc +Source: https://github.com/ethereum/solidity + +Files: * +Copyright: 2014-2016 Ethereum +License: GPL-3.0+ + +Files: debian/* +Copyright: 2016 Ethereum +License: GPL-3.0+ + +License: GPL-3.0+ + 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 package 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 + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". +EOF +cat < debian/changelog +solc (0.0.1-0ubuntu1) saucy; urgency=low + + * Initial release. + + -- Christian Mon, 03 Feb 2016 14:50:20 +0000 +EOF +echo docs > debian/docs +mkdir debian/source +echo "3.0 (quilt)" > debian/source/format +chmod +x debian/rules + +versionsuffix=0ubuntu4~${distribution} +# bump version / add entry to changelog +EMAIL="$email" dch -v 1:${debversion}-${versionsuffix} "git build of ${commithash}" + + +# build source package +# If packages is rejected because original source is already present, add +# -sd to remove it from the .changes file +debuild -S -sa -us -uc + +# prepare .changes file for Launchpad +sed -i -e s/UNRELEASED/${distribution}/ -e s/urgency=medium/urgency=low/ ../*.changes + +# check if ubuntu already has the source tarball +( +cd .. +orig=${packagename}_${debversion}.orig.tar.gz +orig_size=$(ls -l $orig | cut -d ' ' -f 5) +orig_sha1=$(sha1sum $orig | cut -d ' ' -f 1) +orig_sha256=$(sha256sum $orig | cut -d ' ' -f 1) +orig_md5=$(md5sum $orig | cut -d ' ' -f 1) + +if wget --quiet -O $orig-tmp "$ppafilesurl/$orig" +then + echo "[WARN] Original tarball found in Ubuntu archive, using it instead" + mv $orig-tmp $orig + new_size=$(ls -l *.orig.tar.gz | cut -d ' ' -f 5) + new_sha1=$(sha1sum $orig | cut -d ' ' -f 1) + new_sha256=$(sha256sum $orig | cut -d ' ' -f 1) + new_md5=$(md5sum $orig | cut -d ' ' -f 1) + sed -i -e s,$orig_sha1,$new_sha1,g -e s,$orig_sha256,$new_sha256,g -e s,$orig_size,$new_size,g -e s,$orig_md5,$new_md5,g *.dsc + sed -i -e s,$orig_sha1,$new_sha1,g -e s,$orig_sha256,$new_sha256,g -e s,$orig_size,$new_size,g -e s,$orig_md5,$new_md5,g *.changes +fi +) + +# sign the package +debsign --re-sign -k ${keyid} ../${packagename}_${debversion}-${versionsuffix}_source.changes + +# upload +dput ppa:${pparepo} ../${packagename}_${debversion}-${versionsuffix}_source.changes + +done -- cgit v1.2.3 From ff08a8fab0f8bfdf500497e253af889a12e2bf59 Mon Sep 17 00:00:00 2001 From: chriseth Date: Sun, 7 Aug 2016 23:57:34 +0200 Subject: Do not compile sphinx docs for now, so we get to a workable state. --- scripts/release_ppa.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/release_ppa.sh b/scripts/release_ppa.sh index e29443b9..c6aebb45 100755 --- a/scripts/release_ppa.sh +++ b/scripts/release_ppa.sh @@ -71,7 +71,6 @@ Section: science Priority: extra Maintainer: Christian (Buildserver key) Build-Depends: debhelper (>= 9.0.0), - dh_sphinxdoc, libcryptopp-dev, cmake, g++-4.8, @@ -115,13 +114,13 @@ export DH_OPTIONS %: - dh \$@ --buildsystem=cmake --with sphinxdoc + dh \$@ --buildsystem=cmake #--with sphinxdoc override_dh_auto_test: -override_dh_installdocs: - make -C docs html - dh_installdocs docs/_build/html +#override_dh_installdocs: +# make -C docs html +# dh_installdocs docs/_build/html override_dh_shlibdeps: dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info -- cgit v1.2.3 From e404d42f60d56d48e7a9cd9ee3f89e014a26441d Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 8 Aug 2016 10:55:08 +0200 Subject: Correct jsoncpp versions. --- scripts/release_ppa.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/release_ppa.sh b/scripts/release_ppa.sh index c6aebb45..ca33d9f8 100755 --- a/scripts/release_ppa.sh +++ b/scripts/release_ppa.sh @@ -50,13 +50,13 @@ tar --mtime "$committimestamp" --exclude .git -czf ../${packagename}_${debversio case $distribution in trusty) - jsoncpplib=libjsoncppv0 + jsoncpplib=libjsoncpp0 ;; vivid) - jsoncpplib=libjsoncppv0 + jsoncpplib=libjsoncpp0 ;; wily) - jsoncpplib=libjsoncppv0v5 + jsoncpplib=libjsoncpp0v5 ;; *) jsoncpplib=libjsoncpp1 -- cgit v1.2.3 From 39ced1ba551aa5cbb369ffbab49aad5a2cb7dc58 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 8 Aug 2016 19:01:10 +0200 Subject: Make aware of branches and only create source tarball once. --- scripts/release_ppa.sh | 49 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/scripts/release_ppa.sh b/scripts/release_ppa.sh index ca33d9f8..68ee7cdc 100755 --- a/scripts/release_ppa.sh +++ b/scripts/release_ppa.sh @@ -3,26 +3,41 @@ ## This is used to package .deb packages and upload them to the launchpad ## ppa servers for building. ## -## The gnupg key for "build@ethdev.com" has to be present in order to sign +## If no argument is given, creates a package for the develop branch +## and uploads it to the ethereum/ethereum-dev ppa. +## +## If an argument is given, it is used as a tag and the resulting package +## is uploaded to the ethereum/ethereum ppa. +## +## The gnupg key for "builds@ethereum.org" has to be present in order to sign ## the package. ## ## It will clone the Solidity git from github, determine the version, ## create a source archive and push it to the ubuntu ppa servers. ## -## A version, tag or commit hash can be given as argument. -## ############################################################################## set -ev +if [ -z "$1" ] +then + branch=develop +else + branch=$1 +fi + +if [ "$branch" = develop ] + pparepo=ethereum/ethereum-dev + ppafilesurl=https://launchpad.net/~ethereum/+archive/ubuntu/ethereum-dev/+files +else + pparepo=ethereum/ethereum + ppafilesurl=https://launchpad.net/~ethereum/+archive/ubuntu/ethereum/+files +fi + keyid=703F83D0 email=builds@ethereum.org packagename=solc -# TODO determine whether to use dev or not -pparepo=ethereum/ethereum-dev -ppafilesurl=https://launchpad.net/~ethereum/+archive/ubuntu/ethereum-dev/+files - for distribution in trusty vivid wily xenial yakkety do cd /tmp/ @@ -30,7 +45,7 @@ mkdir $distribution cd $distribution # Fetch source -git clone --recursive https://github.com/ethereum/solidity.git -b $1 +git clone --recursive https://github.com/ethereum/solidity.git -b "$branch" mv solidity solc # Determine version @@ -40,11 +55,23 @@ commithash=`git rev-parse --short HEAD` committimestamp=`git show --format=%ci HEAD | head -n 1` commitdate=`git show --format=%ci HEAD | head -n 1 | cut - -b1-10` -# TODO determine if we are on a "release" (tagged commit?) and push to non-dev in that case # TODO store the commit hash in a file so that the build info mechanism can pick it up even without git -debversion="$version-nightly-$commitdate-ffi-$commithash" -tar --mtime "$committimestamp" --exclude .git -czf ../${packagename}_${debversion}.orig.tar.gz . +if [ $branch = develop] +then + debversion="$version-nightly-$commitdate-$commithash" +else + debversion="$version" +fi + +# gzip will create different tars all the time and we are not allowed +# to upload the same file twice with different contents, so we only +# create it once. +if [ -n -e /tmp/${packagename}_${debversion}.orig.tar.gz ] +then + tar --exclude .git -czf /tmp/${packagename}_${debversion}.orig.tar.gz . +fi +cp /tmp/${packagename}_${debversion}.orig.tar.gz ../ # Create debian package information -- cgit v1.2.3