~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

Viewing changes to debian/get-orig-source

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
 
 
3
# This script is used to generate the codeblocks orig tarball used for this
 
4
# package.
 
5
 
 
6
# Some variables to make maintaining this script easier
 
7
CODEBLOCKS_VERSION="10.05"
 
8
CODEBLOCKS_URL_DIR="http://download.berlios.de/codeblocks"
 
9
CODEBLOCKS_TARBALL="codeblocks-$CODEBLOCKS_VERSION-src.tar.bz2"
 
10
CODEBLOCKS_TARBALL_CHECKSUM="ab077d562e98b0586f2f86c14cb773ba"
 
11
 
 
12
USAGE="\n\
 
13
This script is used to generate the orig tarball used in building\n\
 
14
Debian packages for codeblocks-$CODEBLOCKS_VERSION.\n\
 
15
Usage: get-orig-source [OPTION]\n\
 
16
\n\
 
17
 -h, --help                 Display this help message.\n\
 
18
 --keep-upstream-files      Keep downloaded files.\n\
 
19
 --keep-orig-dir            Keep the generated orig directory.\n"
 
20
 
 
21
while [ "$#" -gt "0" ]
 
22
do
 
23
    case "$1" in
 
24
        --keep-upstream-files)
 
25
            KEEP_UPSTREAM_FILES=1
 
26
            shift
 
27
            ;;
 
28
        --keep-orig-dir)
 
29
            KEEP_ORIG_DIR=1
 
30
            shift
 
31
            ;;
 
32
        -h|--help|*)
 
33
            echo >&2 "${USAGE}"
 
34
            exit 1
 
35
            ;;
 
36
    esac
 
37
done
 
38
 
 
39
set -e
 
40
 
 
41
# Function to download files. Takes two parameters, the directory name of the
 
42
# url to use, and the filename of the file.
 
43
download() {
 
44
    local url="$1/$2"
 
45
    if [ ! -f $2 ] ; then
 
46
        # Download the tarball
 
47
        wget $url
 
48
    fi
 
49
}
 
50
 
 
51
# Function to verify the checksum. Takes two parameters, the file to compute the
 
52
# checksum for and the checksum it should be.
 
53
verify_checksum() {
 
54
    local checksum=`md5sum $1 | cut -d ' ' -f 1`
 
55
 
 
56
    if [ $2 != $checksum ] ; then
 
57
        echo "Checksum verification failed. Checksum was $checksum
 
58
    Expected checksum $2"
 
59
        exit 1
 
60
    else
 
61
        echo "Checksum verified. Checksum is $2"
 
62
    fi
 
63
}
 
64
 
 
65
# The rest is our main functions.
 
66
#Download the files
 
67
download $CODEBLOCKS_URL_DIR $CODEBLOCKS_TARBALL
 
68
 
 
69
# Verify the checksums
 
70
verify_checksum $CODEBLOCKS_TARBALL $CODEBLOCKS_TARBALL_CHECKSUM
 
71
 
 
72
# Unpack the upstream source
 
73
if [ ! -d codeblocks-$CODEBLOCKS_VERSION-release -a ! -d codeblocks-$CODEBLOCKS_VERSION ]; then
 
74
    echo "Unpacking upstream source."
 
75
    tar jxf $CODEBLOCKS_TARBALL
 
76
    mv codeblocks-$CODEBLOCKS_VERSION-release codeblocks-$CODEBLOCKS_VERSION
 
77
else
 
78
    echo -n "Please remove or move codeblocks-$CODEBLOCKS_VERSION-release and codeblocks-$CODEBLOCKS_VERSION "
 
79
    echo "directory."
 
80
    exit 1
 
81
fi
 
82
 
 
83
# Pack into a gzipped tarball
 
84
if [ ! -f codeblocks-$CODEBLOCKS_VERSION ]; then
 
85
                echo "Removing all prebuilt windows binaries"
 
86
                find codeblocks-$CODEBLOCKS_VERSION -name "*.dll" | xargs rm -f
 
87
    echo "Creating codeblocks_$CODEBLOCKS_VERSION orig tarball."
 
88
    tar --owner=root --group=root -cjf codeblocks_$CODEBLOCKS_VERSION.orig.tar.bz2 codeblocks-$CODEBLOCKS_VERSION
 
89
else
 
90
    echo "Please remove or move codeblocks_$CODEBLOCKS_VERSION.orig.tar.gz."
 
91
    exit 1
 
92
fi
 
93
 
 
94
# Perform cleanup
 
95
if [ -z "$KEEP_ORIG_DIR" ]; then
 
96
    echo "Removing extracted directory."
 
97
    rm -rf codeblocks-$CODEBLOCKS_VERSION
 
98
fi
 
99
if [ -z "$KEEP_UPSTREAM_FILES" ]; then
 
100
    echo "Removing upstream files."
 
101
    rm $CODEBLOCKS_TARBALL
 
102
fi