Skip to content

Instantly share code, notes, and snippets.

@suhailshergill
Forked from DamienCassou/update-emacs-ppa.sh
Created June 29, 2012 14:51
Show Gist options
  • Save suhailshergill/3018418 to your computer and use it in GitHub Desktop.
Save suhailshergill/3018418 to your computer and use it in GitHub Desktop.
Emacs-snapshot build script for Ubuntu PPA
#!/bin/bash
# Author: Damien Cassou
#
# This is the script I use to build https://launchpad.net/~cassou/+archive/emacs/
# from http://emacs.naquadah.org/.
MAIN_VERSION=20120410
SUB_VERSION=1
SERVER=http://emacs.naquadah.org/unstable
PKG_VERSION=-1
VERSION=${MAIN_VERSION}${PKG_VERSION}
PACKAGE=emacs-snapshot
function packageForDistribution() {
distrib="$1"
mkdir build_$distrib
cp *.tar.gz build_$distrib
cp *.tar.bz2 build_$distrib
cd build_$distrib
tar xfz *.tar.gz
tar xfj *.tar.bz2
mv debian emacs-snapshot*/
cd emacs-snapshot*
cd debian
# Changes compression from xz to bzip2
sed --in-place 's/\(dh_builddeb .* \)-Z xz/\1-Z bzip2/' rules
# Lower dependency requirement on dpkg-dev as we don't use xz anymore
sed --in-place 's/\(dpkg.* \)(>= 1.15.6)/\1(>= 1.15.5)/' control
sed --in-place 's/\(dpkg.* \)(>= 1.15.6)/\1(>= 1.15.5)/' control.in
cd ..
EMAIL=damien.cassou@gmail.com dch -l ~ppa$SUB_VERSION~$distrib "Build for $distrib"
debuild -S -sa --changes-option='-DDistribution='${distrib}
cd ..
dput ppa:cassou/emacs emacs-snapshot*_source.changes
cd ..
}
wget --no-clobber ${SERVER}/${PACKAGE}_${VERSION}.dsc
wget --no-clobber ${SERVER}/${PACKAGE}_${MAIN_VERSION}.orig.tar.xz
wget --no-clobber ${SERVER}/${PACKAGE}_${VERSION}.debian.tar.gz
# Convert from tar.xz to tar.bz2 to support Ubuntu lucid and its dpkg < 1.15.6
file=${PACKAGE}_${MAIN_VERSION}.orig.tar
unxz --stdout $file.xz | bzip2 --compress --stdout > $file.bz2
rm -f $file.xz
packageForDistribution oneiric
packageForDistribution natty
packageForDistribution lucid
packageForDistribution maverick
packageForDistribution precise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment