Date:2012-06-21 10:42:40 (11 years 9 months ago)
Author:Xiangfu
Commit:45805bd7cdd55a7c220dbe06f87644a48947ba92
Message:Switch debian/* from SVN to GIT, now build package base on git commit

Files: debian/autogen.sh (1 diff)
debian/changelog (2 diffs)
debian/changelog.upstream.awk (1 diff)
debian/clean.sh (1 diff)
debian/control (1 diff)
debian/get-orig-source.sh (1 diff)
debian/rules (1 diff)
debian/source/format (1 diff)

Change Details

debian/autogen.sh
1#!/bin/sh
2# Generate debian/changelog.upstream.
3#
4# Uses debian/changelog and the git revision log.
5#
6
7set -e
8
9dpkg-parsechangelog --format rfc822 --all |
10    awk -f debian/changelog.upstream.awk
debian/changelog
1fped (0.0+201205-1) lucid; urgency=low
2
3  * New snapshot, taken from commit 59b90b3
4  * Switched to new project host: http://projects.qi-hardware.com/p/fped
5  * debian/rules:
6    - rewrite as a minimal rules file using dh
7    - add a get-orig-source target
8  * debian/autogen.sh: new script
9
10 -- Xiangfu Liu <xiangfu@sharism.cc> Thu, 21 Jun 2012 16:58:21 +0800
11
112fped (0.0+r6006-1) lucid; urgency=low
213
14  * New snapshot, taken from commit 78e4ba0
315  * update to r6006
416
517 -- Xiangfu Liu <xiangfu@sharism.cc> Fri, 25 Mar 2011 08:43:21 +0800
618
719fped (0.0+r6005-1) lucid; urgency=low
820
21  * New snapshot, taken from commit 335ddb6
922  * update to r6005
1023
1124 -- Xiangfu Liu <xiangfu@sharism.cc> Wed, 23 Mar 2011 16:28:26 +0800
1225
1326fped (0.0+r5999-1) lucid; urgency=low
1427
28  * New snapshot, taken from commit 1409cfa
1529  * update to r5999
1630
1731 -- Xiangfu Liu <xiangfu@sharism.cc> Tue, 22 Mar 2011 15:12:02 +0800
1832
1933fped (0.0+r5997-1) lucid; urgency=low
2034
35  * New snapshot, taken from commit ceaa519
2136  * Fix "FTBFS: tsort: cycle: ./Common: line 37: 2851 Aborted"
2237    This was a "false error" - the regression test is supposed to cause
2338    fped to abort, which it did, but the shell didn't print "Aborted" on
...... 
2843
2944fped (0.0+r5986-1) unstable; urgency=low
3045
46  * New snapshot, taken from commit feae08f
3147  * Initial release (Closes: #599090).
3248
3349 -- Xiangfu Liu <xiangfu@sharism.cc> Mon, 04 Oct 2010 23:27:52 +0800
debian/changelog.upstream.awk
1#!/bin/awk -f
2# Generate debian/changelog.upstream from debian/changelog and
3# the git revision log. Inspired by Gerrit Pape’s
4# debian/changelog.upstream.sh, from the git-core Debian package.
5#
6# Requires a working /dev/stderr.
7#
8# Usage:
9# dpkg-parsechangelog --format rfc822 --all |
10# awk -f debian/changelog.upstream.awk
11
12# If argument matches /^Version: /, return remaining text.
13# Result is nonempty if and only if argument matches.
14function version_line(line) {
15    if (line ~ /^Version: /) {
16        sub(/^Version: /, "", line);
17        return line;
18    }
19    return "";
20}
21
22# If argument matches /^\*.* from commit /, return remaining text.
23# Result is nonempty if and only if argument matches.
24function commit_id_line(line) {
25    if (line ~ / from commit /) {
26        sub(/^.* from commit /, "", line);
27        sub(/[(][Cc]loses.*/, "", line);
28        sub(/[^0-9a-f]*$/, "", line);
29        return line;
30    }
31    return "";
32}
33
34# Read standard input, scanning for a changelog entry of the
35# form “* New snapshot, taken from commit <blah>.”
36# Result is <blah>.
37# Result is empty and writes a message to standard error if no such entry is
38# found before the next Version: line with a different upstream
39# version (or EOF).
40# Argument is the upstream version sought.
41function read_commit_id(upstream, line,version,corresponding_upstream,commit) {
42    while (getline line) {
43        version = version_line(line);
44        corresponding_upstream = version;
45        sub(/-[^-]*$/, "", corresponding_upstream);
46        if (version != "" && corresponding_upstream != upstream)
47            break;
48
49        commit = commit_id_line(line);
50        if (commit != "")
51            return commit;
52    }
53
54    print "No commit id for " upstream >> "/dev/stderr";
55    return "";
56}
57
58BEGIN {
59    last = "none";
60    last_cid = "none";
61    cl = "debian/changelog.upstream";
62}
63
64# Add a list of all revisions up to last to debian/changelog.upstream
65# and set last = new_cid.
66# new is a user-readable name for the commit new_cide.
67function add_version(new,new_cid, limiter,versionline,command,line) {
68    if (last == "none") {
69        printf "" > cl;
70        last = new;
71        last_cid = new_cid;
72        return 0;
73    }
74
75    if (new == "none") {
76        versionline = "Version " last;
77        limiter = "";
78    } else {
79        versionline = "Version " last "; changes since " new ":";
80        limiter = new_cid "..";
81    }
82    print versionline >> cl;
83    gsub(/./, "-", versionline);
84    print versionline >> cl;
85
86    print "" >> cl;
87    command = "git shortlog \"" limiter last_cid "\"";
88    while(command | getline line)
89        print line >> cl;
90
91    if (new != "none")
92        print "" >> cl;
93    last = new;
94    last_cid = new_cid;
95}
96
97{
98    version = version_line($0);
99    if (version != "") {
100        # strip Debian revision
101        upstream_version = version;
102        sub(/-[^-]*$/, "", upstream_version);
103
104        commit = read_commit_id(upstream_version);
105        if (commit == "")
106            exit 1;
107        add_version(upstream_version, commit);
108    }
109}
110
111END {
112    add_version("none", "none");
113}
debian/clean.sh
1#!/bin/sh
2# Clean up after a failed build.
3#
4# Requires access to .gitignore files excluding _all_ modified files.
5#
6# Requires a working /dev/fd (with more than just /dev/fd/0 and 1)
7# or gawk.
8
9set -e
10
11splitgitignore='#!/usr/bin/awk
12!/^#/ && !/^$/ {
13    glob = /[[*?]/;
14    directory = /\/$/;
15    sub(/\/$/, "");
16    anchored = /\//;
17    sub(/^\//, "");
18
19    output = "nonexistent/nonsense";
20    if (anchored) {
21        if (!directory && !glob)
22            output = "/dev/fd/1";
23        else if (directory && !glob)
24            output = "/dev/fd/3";
25        else if (!directory && glob)
26            output = "/dev/fd/4";
27        else if (directory && glob)
28            output = "/dev/fd/5";
29    } else {
30        if (!directory)
31            output = "/dev/fd/6";
32        else
33            output = "/dev/fd/7";
34    }
35    print >> output;
36}
37'
38
39offlimits="-type d -name '.*' -prune -o -type d -name debian -prune"
40
41remove_file_globs() {
42    while read glob
43    do
44        eval "rm -f $glob"
45    done
46}
47
48remove_directory_globs() {
49    while read glob
50    do
51        eval "rm -fr $glob"
52    done
53}
54
55remove_file_findpatterns() {
56    while read pat
57    do
58        find . $offlimits -o \
59            '(' -name "$pat" -execdir rm -f '{}' + ')'
60    done
61}
62
63remove_directory_findpatterns() {
64    while read pat
65    do
66        find . $offlimits -o \
67            '(' -type d -name "$pat" -execdir rm -fr '{}' + ')'
68    done
69}
70
71find . $offlimits -o '(' -name .gitignore -print ')' |
72while read file
73do
74    (
75        cd "$(dirname "$file")"
76        # Dispatch using pipes. Yuck.
77        { { { { {
78            awk "$splitgitignore" |
79        {
80            # anchored files (globless)
81            xargs -d '\n' rm -f
82        }
83        } 3>&1 >&2 |
84        {
85            # anchored directories (globless)
86            xargs -d '\n' rm -fr
87        }
88        } 4>&1 >&2 |
89        {
90            # anchored files
91            remove_file_globs
92        }
93        } 5>&1 >&2 |
94        {
95            # anchored directories
96            remove_directory_globs
97        }
98        } 6>&1 >&2 |
99        {
100            # unanchored files
101            remove_file_findpatterns
102        }
103        } 7>&1 >&2 |
104        {
105            remove_directory_findpatterns
106        } >&2
107    ) < "$file"
108done
debian/control
66    bash (>= 4), flex, bison,
77    imagemagick, transfig, netpbm, ghostscript,
88    libgtk2.0-dev
9Standards-Version: 3.9.1
9Standards-Version: 3.9.3
1010Homepage: http://downloads.qi-hardware.com/people/werner/fped/gui.html
1111
1212Package: fped
debian/get-orig-source.sh
11#!/bin/sh
22# Build a tarball from the latest upstream version, with a nice
33# version number.
4#
5# Requires git 1.6.6 or later, GNU date, and gzip.
46
57set -e
68
7# Determine version number.
8release=0.0
9upstream_version="${release}+r${REV}"
9: ${REPO=$(git rev-parse --git-dir)}
10: ${BRANCH=remotes/origin/master}
11
12mkdir debian-orig-source
13trap 'rm -fr debian-orig-source || exit 1' EXIT
1014
11TOPFOLDER=fped-$upstream_version.orig
15git init -q debian-orig-source
16GIT_DIR=$(pwd)/debian-orig-source/.git
17export GIT_DIR
1218
13trap 'rm -fr ${TOPFOLDER} || exit 1' EXIT INT TERM
19# Fetch latest upstream version.
20git fetch -q "$REPO" "$BRANCH"
1421
15svn export -r${REV} http://svn.openmoko.org/trunk/eda/fped ${TOPFOLDER}
22# Determine version number.
23release=0.0
24date=$(date --utc --date="$(git log -1 --pretty=format:%cD FETCH_HEAD)" "+%Y%m")
25upstream_version="${release}+${date}"
1626
1727# Generate tarball.
18echo "packaging ..."
19tar -czf fped_$upstream_version.orig.tar.gz ${TOPFOLDER}
28echo "packaging $(git rev-parse --short FETCH_HEAD)"
29git archive FETCH_HEAD |
30    gzip -n -9 >"fped_$upstream_version.orig.tar.gz"
debian/rules
11#!/usr/bin/make -f
2# -*- makefile -*-
3# Sample debian/rules that uses debhelper.
4# This file was originally written by Joey Hess and Craig Small.
5# As a special exception, when this file is copied by dh-make into a
6# dh-make output file, you may use that output file without restriction.
7# This special exception was added by Craig Small in version 0.37 of dh-make.
2# This file is in the public domain.
3# You may freely use, modify, distribute, and relicense it.
84
95# Uncomment this to turn on verbose mode.
106#export DH_VERBOSE=1
117
128export PREFIX=/usr
139
14REV=6006
15debiandir_SQ = $(subst ','\'',$(dir $(lastword $(MAKEFILE_LIST))))
16get-orig-source:
17    REV='$(REV)' sh '$(debiandir_SQ)'get-orig-source.sh
10build clean install binary-arch binary-indep binary:
11    +dh --parallel $(opt_no_act) $@
1812
1913override_dh_auto_clean:
20    make spotless
14    $(MAKE) spotless
15    sh debian/clean.sh
16
17override_dh_installchangelogs:
18    dpkg-parsechangelog --format rfc822 --all | \
19        awk -f debian/changelog.upstream.awk
20    dh_installchangelogs debian/changelog.upstream
21
22opt_optimize = CFLAGS="-g -O2"
23opt_no_act =
24opt_quiet =
25
26ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
27    opt_optimize = CFLAGS="-g -O0"
28endif
29
30ifneq (,$(findstring n,$(MAKEFLAGS)))
31    opt_no_act = --no-act
32endif
33
34ifneq (,$(filter quiet,$(DEB_BUILD_OPTIONS)))
35    opt_quiet = --quiet
36    MAKEFLAGS += --quiet
37endif
38
39REPO = git://projects.qi-hardware.com/fped.git
40BRANCH = master
41debiandir_SQ = $(subst ','\'',$(dir $(lastword $(MAKEFILE_LIST))))
42get-orig-source:
43    REPO='$(REPO)' BRANCH='$(BRANCH)' \
44        sh '$(debiandir_SQ)'get-orig-source.sh
2145
2246%:
2347    dh $@
debian/source/format
13.0 (quilt)
13.0 (quilt)

Archive Download the corresponding diff file

Branches:
master



interactive