files for debian package

This commit is contained in:
Xiangfu 2012-08-13 11:10:39 +08:00
parent c709333aa1
commit 4dfde414c4
13 changed files with 371 additions and 0 deletions

10
debian/autogen.sh vendored Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
# Generate debian/changelog.upstream.
#
# Uses debian/changelog and the git revision log.
#
set -e
dpkg-parsechangelog --format rfc822 --all |
awk -f debian/changelog.upstream.awk

6
debian/changelog vendored Normal file
View File

@ -0,0 +1,6 @@
fpgatools (0.0+201208) UNRELEASED; urgency=low
* Takoen from commit 884c036
* Initial release. (Closes: #XXXXXX)
-- Xiangfu Liu <xiangfu.z@gmail.com> Tue, 14 Aug 2012 10:03:41 +0800

113
debian/changelog.upstream.awk vendored Normal file
View File

@ -0,0 +1,113 @@
#!/bin/awk -f
# Generate debian/changelog.upstream from debian/changelog and
# the git revision log. Inspired by Gerrit Papes
# debian/changelog.upstream.sh, from the git-core Debian package.
#
# Requires a working /dev/stderr.
#
# Usage:
# dpkg-parsechangelog --format rfc822 --all |
# awk -f debian/changelog.upstream.awk
# If argument matches /^Version: /, return remaining text.
# Result is nonempty if and only if argument matches.
function version_line(line) {
if (line ~ /^Version: /) {
sub(/^Version: /, "", line);
return line;
}
return "";
}
# If argument matches /^\*.* from commit /, return remaining text.
# Result is nonempty if and only if argument matches.
function commit_id_line(line) {
if (line ~ / from commit /) {
sub(/^.* from commit /, "", line);
sub(/[(][Cc]loses.*/, "", line);
sub(/[^0-9a-f]*$/, "", line);
return line;
}
return "";
}
# Read standard input, scanning for a changelog entry of the
# form “* New snapshot, taken from commit <blah>.”
# Result is <blah>.
# Result is empty and writes a message to standard error if no such entry is
# found before the next Version: line with a different upstream
# version (or EOF).
# Argument is the upstream version sought.
function read_commit_id(upstream, line,version,corresponding_upstream,commit) {
while (getline line) {
version = version_line(line);
corresponding_upstream = version;
sub(/-[^-]*$/, "", corresponding_upstream);
if (version != "" && corresponding_upstream != upstream)
break;
commit = commit_id_line(line);
if (commit != "")
return commit;
}
print "No commit id for " upstream >> "/dev/stderr";
return "";
}
BEGIN {
last = "none";
last_cid = "none";
cl = "debian/changelog.upstream";
}
# Add a list of all revisions up to last to debian/changelog.upstream
# and set last = new_cid.
# new is a user-readable name for the commit new_cide.
function add_version(new,new_cid, limiter,versionline,command,line) {
if (last == "none") {
printf "" > cl;
last = new;
last_cid = new_cid;
return 0;
}
if (new == "none") {
versionline = "Version " last;
limiter = "";
} else {
versionline = "Version " last "; changes since " new ":";
limiter = new_cid "..";
}
print versionline >> cl;
gsub(/./, "-", versionline);
print versionline >> cl;
print "" >> cl;
command = "git shortlog \"" limiter last_cid "\"";
while(command | getline line)
print line >> cl;
if (new != "none")
print "" >> cl;
last = new;
last_cid = new_cid;
}
{
version = version_line($0);
if (version != "") {
# strip Debian revision
upstream_version = version;
sub(/-[^-]*$/, "", upstream_version);
commit = read_commit_id(upstream_version);
if (commit == "")
exit 1;
add_version(upstream_version, commit);
}
}
END {
add_version("none", "none");
}

108
debian/clean.sh vendored Normal file
View File

@ -0,0 +1,108 @@
#!/bin/sh
# Clean up after a failed build.
#
# Requires access to .gitignore files excluding _all_ modified files.
#
# Requires a working /dev/fd (with more than just /dev/fd/0 and 1)
# or gawk.
set -e
splitgitignore='#!/usr/bin/awk
!/^#/ && !/^$/ {
glob = /[[*?]/;
directory = /\/$/;
sub(/\/$/, "");
anchored = /\//;
sub(/^\//, "");
output = "nonexistent/nonsense";
if (anchored) {
if (!directory && !glob)
output = "/dev/fd/1";
else if (directory && !glob)
output = "/dev/fd/3";
else if (!directory && glob)
output = "/dev/fd/4";
else if (directory && glob)
output = "/dev/fd/5";
} else {
if (!directory)
output = "/dev/fd/6";
else
output = "/dev/fd/7";
}
print >> output;
}
'
offlimits="-type d -name '.*' -prune -o -type d -name debian -prune"
remove_file_globs() {
while read glob
do
eval "rm -f $glob"
done
}
remove_directory_globs() {
while read glob
do
eval "rm -fr $glob"
done
}
remove_file_findpatterns() {
while read pat
do
find . $offlimits -o \
'(' -name "$pat" -execdir rm -f '{}' + ')'
done
}
remove_directory_findpatterns() {
while read pat
do
find . $offlimits -o \
'(' -type d -name "$pat" -execdir rm -fr '{}' + ')'
done
}
find . $offlimits -o '(' -name .gitignore -print ')' |
while read file
do
(
cd "$(dirname "$file")"
# Dispatch using pipes. Yuck.
{ { { { {
awk "$splitgitignore" |
{
# anchored files (globless)
xargs -d '\n' rm -f
}
} 3>&1 >&2 |
{
# anchored directories (globless)
xargs -d '\n' rm -fr
}
} 4>&1 >&2 |
{
# anchored files
remove_file_globs
}
} 5>&1 >&2 |
{
# anchored directories
remove_directory_globs
}
} 6>&1 >&2 |
{
# unanchored files
remove_file_findpatterns
}
} 7>&1 >&2 |
{
remove_directory_findpatterns
} >&2
) < "$file"
done

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
7

19
debian/control vendored Normal file
View File

@ -0,0 +1,19 @@
Source: fpgatools
Section: electronics
Priority: extra
Maintainer: Xiangfu Liu <xiangfu@openmobilefree.net>
Build-Depends: debhelper (>= 7.4.10), pkg-config,
libxml2-dev
Standards-Version: 3.9.3
Homepage: https://github.com/Wolfgang-Spraul/fpgatools
Package: fpgatools
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: tools for create fpga bitstream
small independent command line utilities, no GUI
plain C, no C++
simple Makefiles
text-based file formats
no documentation - read the sources
automatic test suite

33
debian/copyright vendored Normal file
View File

@ -0,0 +1,33 @@
This work was packaged for Debian by:
Xiangfu Liu <xiangfu@openmobilefree.net> on Tue, 14 Aug 2012 10:57:14 +0800
It was downloaded from:
https://github.com/Wolfgang-Spraul/fpgatools
Upstream Author:
Wolfgang Spraul
Copyright:
Copyright 2012 by Wolfgang Spraul
License:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>
The Debian packaging is:
Copyright (C) 2012 Xiangfu Liu <xiangfu@openmobilefree.net> and is released
into the public domain.

1
debian/dirs vendored Normal file
View File

@ -0,0 +1 @@
usr/bin

1
debian/fpgatools.manpages vendored Normal file
View File

@ -0,0 +1 @@
fpgatools.1

30
debian/get-orig-source.sh vendored Normal file
View File

@ -0,0 +1,30 @@
#!/bin/sh
# Build a tarball from the latest upstream version, with a nice
# version number.
#
# Requires git 1.6.6 or later, GNU date, and gzip.
set -e
: ${REPO=$(git rev-parse --git-dir)}
: ${BRANCH=remotes/origin/master}
mkdir debian-orig-source
trap 'rm -fr debian-orig-source || exit 1' EXIT
git init -q debian-orig-source
GIT_DIR=$(pwd)/debian-orig-source/.git
export GIT_DIR
# Fetch latest upstream version.
git fetch -q "$REPO" "$BRANCH"
# Determine version number.
release=0.0
date=$(date --utc --date="$(git log -1 --pretty=format:%cD FETCH_HEAD)" "+%Y%m")
upstream_version="${release}+${date}"
# Generate tarball.
echo "packaging $(git rev-parse --short FETCH_HEAD)"
git archive FETCH_HEAD |
gzip -n -9 >"fpgatools_$upstream_version.orig.tar.gz"

47
debian/rules vendored Executable file
View File

@ -0,0 +1,47 @@
#!/usr/bin/make -f
# This file is in the public domain.
# You may freely use, modify, distribute, and relicense it.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export PREFIX=/usr
build clean install binary-arch binary-indep binary:
+dh --parallel $(opt_no_act) $@
override_dh_auto_clean:
$(MAKE) clean
sh debian/clean.sh
override_dh_installchangelogs:
dpkg-parsechangelog --format rfc822 --all | \
awk -f debian/changelog.upstream.awk
dh_installchangelogs debian/changelog.upstream
opt_optimize = CFLAGS="-g -O2"
opt_no_act =
opt_quiet =
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
opt_optimize = CFLAGS="-g -O0"
endif
ifneq (,$(findstring n,$(MAKEFLAGS)))
opt_no_act = --no-act
endif
ifneq (,$(filter quiet,$(DEB_BUILD_OPTIONS)))
opt_quiet = --quiet
MAKEFLAGS += --quiet
endif
REPO = git://github.com/Wolfgang-Spraul/fpgatools.git
BRANCH = master
debiandir_SQ = $(subst ','\'',$(dir $(lastword $(MAKEFILE_LIST))))
get-orig-source:
REPO='$(REPO)' BRANCH='$(BRANCH)' \
sh '$(debiandir_SQ)'get-orig-source.sh
%:
dh $@

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)

1
debian/watch vendored Normal file
View File

@ -0,0 +1 @@
# We track fpgatools git revisions, thus no need for a watch file.