diff options
author | wattazoum <wattazoum@svn> | 2009-11-26 23:13:54 +0000 |
---|---|---|
committer | wattazoum <wattazoum@svn> | 2009-11-26 23:13:54 +0000 |
commit | 349b3f7035270ab43b21e06871a31e2b2db4534d (patch) | |
tree | 067b3d0af95a1cc9e5d2ea50cb2f3307e9baaa01 /tools/Linux | |
parent | 1cefa6dde4b026af6b2528f7c1b6d580cdba61b9 (diff) |
[packaging] * added the ppa building scripts in SVN (and simplify them)
* add rules file for hardy
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@25078 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'tools/Linux')
-rw-r--r-- | tools/Linux/packaging/debian/rules.hardy | 137 | ||||
-rwxr-xr-x | tools/Linux/packaging/debian/xbmc-live.postinst | 2 | ||||
-rw-r--r-- | tools/Linux/packaging/pbuilder-dist | 50 | ||||
-rw-r--r-- | tools/Linux/packaging/ppa-builder.sh | 279 |
4 files changed, 468 insertions, 0 deletions
diff --git a/tools/Linux/packaging/debian/rules.hardy b/tools/Linux/packaging/debian/rules.hardy new file mode 100644 index 0000000000..84db2ed50e --- /dev/null +++ b/tools/Linux/packaging/debian/rules.hardy @@ -0,0 +1,137 @@ +#!/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 + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +#get the svnversion if the file exists +SVNVERSION ?= $(shell dpkg-parsechangelog | grep '^Version:' | sed 's/.*svn\([[:digit:]]*\).*/\1/') + +ifeq "$(SVNVERSION)" "" + ifneq "$(shell cat debian/svnrevision)" "" + SVNVERSION ?= $(shell cat debian/svnrevision) + endif +endif + +config-stamp: + dh_testdir + # Add here commands to configure the package. + ./bootstrap + dh_auto_configure -- --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --enable-vdpau --enable-avahi SVN_REV="$(SVNVERSION)" + touch $@ + +#Architecture +build: build-arch + +build-arch: build-arch-stamp +build-arch-stamp: config-stamp + + # Add here commands to compile the arch part of the package. + dh_auto_build -- externals xbmc.bin xbmc-xrandr + touch $@ + +build-indep: build-indep-stamp +build-indep-stamp: config-stamp + + # Add here commands to compile the indep part of the package. + $(MAKE) skins + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-arch-stamp build-indep-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) distclean + rm -f config-stamp + + dh_clean + +install: install-indep install-arch +install-indep: + dh_testdir + dh_testroot + dh_clean -i + dh_prep -i + dh_installdirs -i + $(MAKE) install-web install-datas install-livedatas prefix=$(CURDIR)/debian/tmp/usr/ + + # xbmc Live files + mkdir -p $(CURDIR)/debian/tmp/etc/init/ + cp $(CURDIR)/tools/XBMCLive/xbmc-live.conf $(CURDIR)/debian/tmp/etc/init/ + cp $(CURDIR)/tools/XBMCLive/xbmc-live-install.conf $(CURDIR)/debian/tmp/etc/init/ + + # XBMC WEB PM + mkdir -p $(CURDIR)/debian/xbmc-web-pm/usr/share/xbmc/web + cp -a $(CURDIR)/web/Project_Mayhem -d $(CURDIR)/debian/xbmc-web-pm/usr/share/xbmc/web + # XBMC WEB PM 3 + mkdir -p $(CURDIR)/debian/xbmc-web-pm3/usr/share/xbmc/web + cp -a $(CURDIR)/web/Project_Mayhem_III -d $(CURDIR)/debian/xbmc-web-pm/usr/share/xbmc/web + # XBMC WEB Iphone + mkdir -p $(CURDIR)/debian/xbmc-web-iphone-tlrobinson/usr/share/xbmc + cp -a $(CURDIR)/web/xbmciphone -d $(CURDIR)/debian/xbmc-web-iphone-tlrobinson/usr/share/xbmc/web + mkdir -p $(CURDIR)/debian/xbmc-web-iphone-tlrobinson/usr/share/doc/xbmc-web-iphone-tlrobinson/ + mv $(CURDIR)/debian/xbmc-web-iphone-tlrobinson/usr/share/xbmc/web/README $(CURDIR)/debian/xbmc-web-iphone-tlrobinson/usr/share/doc/xbmc-web-iphone-tlrobinson/ + +install-arch: + dh_testdir + dh_testroot + dh_clean -s + dh_prep -s + dh_installdirs -s + + # Add here commands to install the arch part of the package into + # debian/tmp/usr/share/xbmc + make install-binaries install-arch prefix=$(CURDIR)/debian/tmp/usr/ + + make eventclients prefix=$(CURDIR)/debian/tmp/usr/ installdir=/usr WII_EXTRA_OPTS=-DCWIID_OLD + + dh_install -s --sourcedir=$(CURDIR)/debian/tmp + +# Must not depend on anything. This is to be called by +# binary-arch/binary-indep +# in another 'make' thread. +binary-common: + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_installinit + dh_pysupport + dh_link + dh_strip --dbg-package=xbmc-dbg + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture independant packages using the common target. +binary-indep: build-indep install-indep + $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common + +# Build architecture dependant packages using the common target. +binary-arch: build-arch install-arch + $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common + +binary: binary-arch binary-indep +.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch + diff --git a/tools/Linux/packaging/debian/xbmc-live.postinst b/tools/Linux/packaging/debian/xbmc-live.postinst index 24643ff99c..ef4e06bc19 100755 --- a/tools/Linux/packaging/debian/xbmc-live.postinst +++ b/tools/Linux/packaging/debian/xbmc-live.postinst @@ -4,6 +4,8 @@ set -e case "$1" in configure) + # TODO: What's the purpose of this line? As I see it, if 'xbmc' can't + # get a console session going, we're in trouble anyway. ceros sed -i.bak-xbmc-live s/allowed_users=console/allowed_users=anybody/ /etc/X11/Xwrapper.config # Add the 'xbmc' user if the primary one is missing diff --git a/tools/Linux/packaging/pbuilder-dist b/tools/Linux/packaging/pbuilder-dist new file mode 100644 index 0000000000..43d9bc8660 --- /dev/null +++ b/tools/Linux/packaging/pbuilder-dist @@ -0,0 +1,50 @@ +#!/bin/sh +# script from Jamin W. Collins BTS: #255165 +# modded by Oumar Aziz OUATTARA +# +# Set the PBUILDER_XBMC_BASE_DIR var to your custom pbuilder base directory. You can set it while calling the script. +# To select an ubuntu distribution to launch the build, use the first argument of the script. +# The second is the actual command to launch. + +OPERATION=$2 +DISTRIBUTION=$1 +PROCEED=false + +if [ -z $PBUILDER_XBMC_BASE_DIR ] ; then + PBUILDER_XBMC_BASE_DIR="/var/cache/pbuilder" +fi + +case $OPERATION in + create|update|build|clean|login|execute) + PROCEED=true + ;; +esac +if ( $PROCEED == true ) then + shift 2 + sudo pbuilder $OPERATION \ + --basetgz $PBUILDER_XBMC_BASE_DIR/$DISTRIBUTION-base.tgz \ + --distribution $DISTRIBUTION \ + --buildresult $PBUILDER_XBMC_BASE_DIR/result \ + --aptcache $PBUILDER_XBMC_BASE_DIR/aptcache \ + --buildplace $PBUILDER_XBMC_BASE_DIR/build \ + --extrapackages "less vim gnupg" \ + --mirror "http://archive.ubuntu.com/ubuntu/" \ + --components "main restricted universe multiverse" \ + --othermirror "deb http://ppa.launchpad.net/team-xbmc/ppa/ubuntu $DISTRIBUTION main|\ +deb http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu $DISTRIBUTION main|\ +deb http://security.ubuntu.com/ubuntu $DISTRIBUTION-security main restricted universe multiverse|\ +deb http://archive.ubuntu.com/ubuntu/ $DISTRIBUTION-backports main restricted universe multiverse|\ +deb http://archive.ubuntu.com/ubuntu/ $DISTRIBUTION-updates main restricted universe multiverse" "$@" + +else + echo "Usage: $0 [distribution] [command] " + echo "Invalid command..." + echo "Valid commands are:" + echo " create" + echo " update" + echo " build" + echo " clean" + echo " login" + echo " execute" + exit 1 +fi diff --git a/tools/Linux/packaging/ppa-builder.sh b/tools/Linux/packaging/ppa-builder.sh new file mode 100644 index 0000000000..7517a908c4 --- /dev/null +++ b/tools/Linux/packaging/ppa-builder.sh @@ -0,0 +1,279 @@ +#!/bin/bash + +usage() +{ +myEcho "For --tag|-t, use the following options: + svnsrc=<dir> + version=<version> (without 'xbmc-') + " +myEcho "For -u, use: + srcdir=<dir> + version=<version> (or revision) + minor=<minor> + " +myEcho "For -nsg, use: + srcdir=<dir> + revision=<revision> (or version=<version>) + " +myEcho "For -prev, use: + rev=<revision> + " +myEcho "You can use: + > -debian-tag=<tag> (to select the debian directory tag to use) + " +exit 0 +} + +myEcho() { + echo -e "$1" + echo -e "$1" >> $BUILD_LOG +} + +BUILDALL=1 +FULLDEBUILDOPTS="-S -sa" +DEBUILDOPTS="-S -sd" +MINOR=1 +XBMCPPA=xbmc-svn +HVERSION=9.11~beta1 +DEBIAN_TAG_OPT= +BUILD_LOG=debuilder_`date +%F_%T`.log + + +export DEBFULLNAME="Ouattara Oumar Aziz (alias wattazoum)" +export DEBEMAIL="wattazoum@gmail.com" + +parse_options() +{ + for I in "$@" + do + OPT=${I%=*} + PAR=${I#*=} + case $OPT in + --local|-l) + LOCAL=1 + ;; + --pbuilder|-p) + PBUILDER=1 + LOCAL=1 + ;; + hardy|intrepid|jaunty|karmic) + BUILDALL=0 + DIST="$OPT" + DEBUILDOPTS=$FULLDEBUILDOPTS + ;; + --noclean|-nc) + NOCLEAN=1 + ;; + --no-src-gen|-nsg) + NO_SRC_GEN=1 + ;; + --update|-u) + UPDPPA=1 + FULLDEBUILDOPTS=$DEBUILDOPTS + ;; + --tag|-t) + BUILD_TAG=1 + ;; + -debian-tag) + DEBIAN_TAG_OPT="-r $PAR" + ;; + -prev) + EXPORT_PREV_REV=1 + ;; + --help|-h) + usage + ;; + *) + myEcho "Setting $OPT=$PAR" + export $OPT=$PAR + ;; + esac + done +} + +getrootright() +{ + if [[ $PBUILDER ]]; then + myEcho "Give me the admin rights ... " + sudo echo "Thank you !" + fi +} + +preparesrc() +{ + myEcho "Exporting the sources at revision $REVISION ... " + if [[ -z $HEAD_REVISION ]]; then + # The revision given might not be the head one + svn export -r $REVISION $SVNSRC $DESTSRC 2>&1 + else + svn cleanup $SVNSRC + svn export $SVNSRC $DESTSRC + fi + myEcho "Copying to .orig folder" + cp -a $DESTSRC $DESTSRC.orig +} + +builddeb() +{ + myEcho "Copy the debian folder to the root" + cp -a $DESTSRC/tools/Linux/packaging/debian $DESTSRC/debian + + if [[ -z $CHNLG ]]; then + CHNLG="Build of $VERSION" + fi + myEcho "Changelog : $CHNLG" + cd $DESTSRC + dch -v ${VERSION}-$1${MINOR} -D $1 "$CHNLG" 2>&1 + myEcho "$REVISION" > debian/svnrevision + myEcho "Building the $1 debian package" + + if [ $1 -eq "hardy"] ; then + tweaks_for_hardy + fi + + # Add vdpau dependencies + mv debian/control debian/control.orig + sed s/"make,"/"make, nvidia-190-libvdpau-dev,"/ debian/control.orig > debian/control + rm debian/control.orig + + if [[ $BUILT_ONCE ]]; then + debuild $DEBUILDOPTS 2>&1 + else + debuild $FULLDEBUILDOPTS 2>&1 + BUILT_ONCE=1 + fi + + cd $OLDPWD + if [[ $PBUILDER ]]; then + myEcho "'pbuilder' is set. Trying into pbuilder" + $SCRIPTDIR/pbuilder-dist $1 build xbmc_${VERSION}-$1${MINOR}.dsc 2>&1 + rm -rf $DESTSRC/debian + fi + if [[ -z $LOCAL ]]; then + myEcho "'--local' is not set. Uploading to PPA" + dput $XBMCPPA xbmc_${VERSION}-$1${MINOR}_source.changes 2>&1 + rm -rf $DESTSRC/debian + fi +} + +tweaks_for_hardy() +{ + # change debhelper version in control + mv debian/control debian/control.orig + sed -r s/"debhelper \(>= .+?\)"/"debhelper (>= 7)"/ debian/control.orig > debian/control + rm debian/control.orig + + # change the rules file. + rm -f debian/rules + cp debian/rules.hardy debian/rules + # move the format spec to 1.0 + echo "1.0" > debian/source/format +} + +clean() +{ +if [[ -z $NOCLEAN ]] && [[ -z $LOCAL ]] ; then + myEcho "Cleaning ... " + find . -depth -maxdepth 1 -regex "\./xbmc[-_].+-.+" -not -name "*.orig.tar.gz" -exec rm -rf {} \; + if [[ -z $UPDPPA ]] && [[ -z $NO_SRC_GEN ]] ; then + rm -rf xbmc-$VERSION xbmc_$VERSION.orig.tar.gz + fi +fi +} + +preparevars() +{ + myEcho "Preparing Vars ..." + echo "Nothing" > test.txt + gpg -s test.txt + rm test.txt test.txt.gpg + + BUILD_LOG=$BUILD_DIR/debuilder_`date +%F_%T`.log + myEcho "Build directory: $BUILD_DIR" + + if [[ -z $SVNSRC ]]; then + SVNSRC=$(readlink -f ../../../) + fi + if [[ $UPDPPA ]]; then + DESTSRC=$srcdir + if [[ $revision ]]; then + REVISION=$revision + VERSION=${HVERSION}+svn$REVISION + fi + if [[ -z $VERSION ]] && [[ $version ]]; then + VERSION=$version + fi + MINOR=$minor + BUILT_ONCE=1 + fi + if [[ $NO_SRC_GEN ]]; then + DESTSRC=$srcdir + if [[ $revision ]]; then + REVISION=$revision + VERSION=${HVERSION}+svn$REVISION + fi + if [[ -z $VERSION ]] && [[ $version ]]; then + VERSION=$version + fi + fi + if [[ $BUILD_TAG ]]; then + VERSION=$version + fi + if [[ $EXPORT_PREV_REV ]]; then + myEcho "Revision to export: $rev" + REVISION=$rev + fi + + myEcho "Setting SVN Sources: $SVNSRC" + + # If the version is not yet set it + if [ -z $REVISION ]; then + svn update $SVNSRC + HEAD_REVISION=$(expr $(svn info $SVNSRC --xml 2>&1 | grep -m 1 -e "revision=\"[0-9]*\">") : 'revision="\([0-9]\+\)">') + REVISION=$HEAD_REVISION + fi + if [ -z $VERSION ]; then + VERSION=${HVERSION}+svn$REVISION + fi + + myEcho "XBMC version: $VERSION" + myEcho "XBMC revision: $REVISION" + + # Set Destination folder if not set + if [ -z $DESTSRC ]; then + DESTSRC=xbmc-$VERSION + fi + + myEcho "XBMC Destination folder: $DESTSRC" + myEcho "Package minor version: $MINOR" + +} + +# = = = = = = = = = = = = = = + +SCRIPTDIR=`pwd` + +# We are in the source tree. Go out +if [ -z $BUILD_DIR ] ; then + BUILD_DIR=$(eval readlink -f ../../../../) +fi + +parse_options +getrootright +preparevars + +cd $BUILD_DIR + +if [[ -z $UPDPPA ]] && [[ -z $NO_SRC_GEN ]] ; then + preparesrc +fi + +for distro in "hardy" "intrepid" "jaunty" "karmic"; do + if [ $BUILDALL -eq 1 ] || [ $DIST == "$distro" ]; then + builddeb $distro + fi +done + +clean + +exit 0 |