~ubuntu-branches/ubuntu/natty/libconfig-inifiles-perl/natty

« back to all changes in this revision

Viewing changes to debian/cdbs/1/rules/upstream-tarball.mk

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard, gregor herrmann
  • Date: 2009-01-24 22:25:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090124222526-uutu8jg5r4vrfljq
Tags: 2.47-1
[ Jonas Smedegaard ]
* New upstream release. Closes: bug#430426, #380280.
* Depend on ${misc:Depends}.
* Fix Vcs-* fields to point to refer to correct package.
* Update CDBS snippets:
  + Update copyright-check output to more closely match proposed new
    copyright file format
  + Simplify internal variables
  + Ignore no files by default in copyright-check.mk
  + Correct and update copyright hints of the snippets themselves
  + Move dependency cleanup to new local snippet package-relations.mk.
* Update debian/copyright and copyright hints:
  + Rewrite debian/copyright using new file format, version 428
  + Add info on CDBS snippets (new owners, no new licenses)
* Add DEB_MAINTAINER_MODE in debian/rules (thanks to Romain Beauxis).

[ gregor herrmann ]
* debian/watch: use dist-based URL.
* debian/control: Changed: Switched Vcs-Browser field to ViewSVN
  (source stanza).

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
DEB_UPSTREAM_WORKDIR = ../tarballs
41
41
 
 
42
# Base filename (without extension) as used in upstream URL
 
43
DEB_UPSTREAM_TARBALL_BASENAME = $(DEB_UPSTREAM_PACKAGE)-$(DEB_UPSTREAM_TARBALL_VERSION)
 
44
 
42
45
# Perl regexp to change locally used string into that in upstream URL and srcdir
43
 
#DEB_UPSTREAM_TARBALL_VERSION_MANGLE
44
 
cdbs_upstream_tarball_version_mangled = $(if $(strip $(DEB_UPSTREAM_TARBALL_VERSION_MANGLE)),$(shell echo '$(DEB_UPSTREAM_TARBALL_VERSION)' | perl -pe '$(DEB_UPSTREAM_TARBALL_VERSION_MANGLE)'),$(DEB_UPSTREAM_TARBALL_VERSION))
45
 
 
46
 
# Base filename (without extension) as used in upstream URL
47
 
DEB_UPSTREAM_TARBALL_BASENAME = $(DEB_UPSTREAM_PACKAGE)-$(cdbs_upstream_tarball_version_mangled)
 
46
#DEB_UPSTREAM_TARBALL_BASENAME_MANGLE =
48
47
 
49
48
# Base directory within tarball
50
 
DEB_UPSTREAM_TARBALL_SRCDIR = $(DEB_UPSTREAM_PACKAGE)-$(cdbs_upstream_tarball_version_mangled)
 
49
DEB_UPSTREAM_TARBALL_SRCDIR = $(cdbs_upstream_tarball_basename)
51
50
 
52
51
# Space-delimited list of directories and files to strip (optional)
53
52
#DEB_UPSTREAM_REPACKAGE_EXCLUDE = CVS .cvsignore doc/rfc*.txt doc/draft*.txt
54
53
DEB_UPSTREAM_REPACKAGE_TAG = dfsg
55
54
DEB_UPSTREAM_REPACKAGE_DELIMITER = ~
56
55
 
57
 
cdbs_upstream_tarball = $(DEB_UPSTREAM_TARBALL_BASENAME).$(DEB_UPSTREAM_TARBALL_EXTENSION)
58
 
cdbs_upstream_local_tarball = $(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_TARBALL_VERSION).orig.$(if $(findstring $(DEB_UPSTREAM_TARBALL_EXTENSION),tgz),tar.gz,$(DEB_UPSTREAM_TARBALL_EXTENSION))
59
 
cdbs_upstream_repackaged_basename = $(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_TARBALL_VERSION)$(DEB_UPSTREAM_REPACKAGE_DELIMITER)$(DEB_UPSTREAM_REPACKAGE_TAG).orig
60
 
cdbs_upstream_uncompressed_tarball = $(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_TARBALL_VERSION).orig.tar
 
56
cdbs_upstream_tarball_basename = $(if $(strip $(DEB_UPSTREAM_TARBALL_BASENAME_MANGLE)),$(shell echo '$(DEB_UPSTREAM_TARBALL_BASENAME)' | perl -pe '$(DEB_UPSTREAM_TARBALL_BASENAME_MANGLE)'),$(DEB_UPSTREAM_TARBALL_BASENAME))
 
57
cdbs_upstream_tarball = $(cdbs_upstream_tarball_basename).$(DEB_UPSTREAM_TARBALL_EXTENSION)
 
58
cdbs_upstream_received_tarball = $(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_TARBALL_VERSION).orig.$(if $(findstring $(DEB_UPSTREAM_TARBALL_EXTENSION),tgz),tar.gz,$(DEB_UPSTREAM_TARBALL_EXTENSION))
 
59
cdbs_upstream_local_basename = $(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_TARBALL_VERSION)$(if $(strip $(DEB_UPSTREAM_REPACKAGE_EXCLUDE)),$(DEB_UPSTREAM_REPACKAGE_DELIMITER)$(DEB_UPSTREAM_REPACKAGE_TAG))
 
60
cdbs_upstream_local_srcdir = $(cdbs_upstream_tarball_basename)$(if $(strip $(DEB_UPSTREAM_REPACKAGE_EXCLUDE)),$(DEB_UPSTREAM_REPACKAGE_DELIMITER)$(DEB_UPSTREAM_REPACKAGE_TAG))
61
61
 
62
62
# # These variables are deprecated
63
 
_cdbs_deprecated_vars += DEB_UPSTREAM_TARBALL DEB_UPSTREAM_LOCAL_TARBALL DEB_UPSTREAM_REPACKAGE_TARBALL
 
63
_cdbs_deprecated_vars += DEB_UPSTREAM_TARBALL DEB_UPSTREAM_LOCAL_TARBALL DEB_UPSTREAM_REPACKAGE_TARBALL DEB_UPSTREAM_TARBALL_VERSION_MANGLE
64
64
_cdbs_deprecated_vars += DEB_UPSTREAM_REPACKAGE_EXCLUDES
65
65
DEB_UPSTREAM_REPACKAGE_EXCLUDE += $(DEB_UPSTREAM_REPACKAGE_EXCLUDES)
66
66
 
72
72
        @@dh_testdir
73
73
        @@mkdir -p "$(DEB_UPSTREAM_WORKDIR)"
74
74
 
75
 
        @if [ ! -s "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_tarball)" ] ; then \
76
 
                if [ -f "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_tarball)" ] ; then \
77
 
                        rm "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_tarball)" ; \
 
75
        @if [ ! -s "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" ] ; then \
 
76
                if [ -f "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" ] ; then \
 
77
                        rm "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" ; \
78
78
                fi ; \
79
 
                echo "Downloading $(cdbs_upstream_local_tarball) from $(DEB_UPSTREAM_URL)/$(cdbs_upstream_tarball) ..." ; \
80
 
                wget -nv -T10 -t3 -O "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_tarball)" "$(DEB_UPSTREAM_URL)/$(cdbs_upstream_tarball)" ; \
 
79
                echo "Downloading $(cdbs_upstream_received_tarball) from $(DEB_UPSTREAM_URL)/$(cdbs_upstream_tarball) ..." ; \
 
80
                wget -nv -T10 -t3 -O "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" "$(DEB_UPSTREAM_URL)/$(cdbs_upstream_tarball)" ; \
81
81
        else \
82
 
                echo "Upstream source tarball have been already downloaded: $(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_tarball)" ; \
 
82
                echo "Upstream source tarball have been already downloaded: $(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" ; \
83
83
        fi
84
84
 
85
 
        @md5current=`md5sum "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_tarball)" | sed -e 's/ .*//'`; \
 
85
        @md5current=`md5sum "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" | sed -e 's/ .*//'`; \
86
86
        if [ -n "$(DEB_UPSTREAM_TARBALL_MD5)" ] ; then \
87
87
                if [ "$$md5current" != "$(DEB_UPSTREAM_TARBALL_MD5)" ] ; then \
88
88
                        echo "Expecting upstream tarball md5sum $(DEB_UPSTREAM_TARBALL_MD5), but $$md5current found" ; \
89
89
                        echo "Upstream tarball md5sum is NOT trusted! Possible upstream tarball forge!" ; \
90
90
                        echo "Purging downloaded file. Try new download." ; \
91
 
                        rm -f "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_tarball)" ; \
 
91
                        rm -f "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" ; \
92
92
                        false ; \
93
93
                else \
94
94
                        echo "Upstream tarball is trusted!" ; \
99
99
 
100
100
# TODO: Rewrite using make variables like cdbs_upstream_unpack_cmd and
101
101
# DEB_UPSTREAM_SUPPORTED_COMPRESSIONS (recent dpkg supports bz2)
 
102
# TODO: Add .orig suffix to top folder inside tarball when only
 
103
# recompressing (when $uncompress set and ...REPACKAGE_EXCLUDE unset)
102
104
        @untar="tar -x -C"; \
103
 
        case "$(cdbs_upstream_local_tarball)" in \
 
105
        case "$(cdbs_upstream_received_tarball)" in \
104
106
            *.tar.gz)  unpack="gunzip -c";; \
105
107
            *.tar.bz2) unpack="bunzip2 -c";    uncompress="bunzip2";; \
106
108
            *.tar.Z)   unpack="uncompress -c"; uncompress="uncompress";; \
107
109
            *.zip)     unpack="unzip -q";      uncompress="false";       untar="-d"; nopipe="true";; \
108
110
            *.tar)     unpack="cat";           uncompress="true";; \
109
 
            *) echo "Unknown extension for upstream tarball $(cdbs_upstream_local_tarball)"; false;; \
 
111
            *) echo "Unknown extension for upstream tarball $(cdbs_upstream_received_tarball)"; false;; \
110
112
        esac && \
111
113
        if [ -n "$(strip $(DEB_UPSTREAM_REPACKAGE_EXCLUDE))" ] || [ "$$uncompress" = "false" ]; then \
112
114
                echo "Repackaging tarball ..." && \
113
115
                mkdir -p "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)" && \
114
116
                if [ -n "$$nopipe" ]; then \
115
 
                        $$unpack "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_tarball)" \
 
117
                        $$unpack "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" \
116
118
                                $$untar "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)" $(patsubst %,--exclude='%',$(DEB_UPSTREAM_REPACKAGE_EXCLUDE)); \
117
119
                else \
118
 
                        $$unpack "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_tarball)" \
 
120
                        $$unpack "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)" \
119
121
                                | $$untar "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)" $(patsubst %,--exclude='%',$(DEB_UPSTREAM_REPACKAGE_EXCLUDE)); \
120
122
                fi && \
121
 
                if [ "$(DEB_UPSTREAM_TARBALL_SRCDIR)" != "$(cdbs_upstream_repackaged_basename)" ]; then \
122
 
                        mv -T "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)/$(DEB_UPSTREAM_TARBALL_SRCDIR)" "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)/$(cdbs_upstream_repackaged_basename)"; \
123
 
                fi && \
124
 
                if [ -n "$(strip $(DEB_UPSTREAM_REPACKAGE_EXCLUDE))" ]; then \
125
 
                        GZIP=-9 tar -b1 -czf "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_repackaged_basename).tar.gz" -C "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)" "$(cdbs_upstream_repackaged_basename)"; \
126
 
                else \
127
 
                        GZIP=-9 tar -b1 -czf "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_uncompressed_tarball).gz" -C "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)" "$(cdbs_upstream_repackaged_basename)"; \
128
 
                fi && \
 
123
                if [ "$(DEB_UPSTREAM_TARBALL_SRCDIR)" != "$(cdbs_upstream_local_srcdir)" ]; then \
 
124
                        mv -T "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)/$(DEB_UPSTREAM_TARBALL_SRCDIR)" "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)/$(cdbs_upstream_local_srcdir)"; \
 
125
                fi && \
 
126
                GZIP=-9 tar -b1 -czf "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_basename).orig.tar.gz" -C "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)" "$(cdbs_upstream_local_srcdir)" && \
129
127
                echo "Cleaning up" && \
130
128
                rm -rf "$(DEB_UPSTREAM_WORKDIR)/$(DEB_UPSTREAM_REPACKAGE_TAG)"; \
131
129
        elif [ -n "$$uncompress" ]; then \
132
130
                echo "Recompressing tarball ..." && \
133
 
                $$uncompress "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_tarball)"; \
134
 
                gzip -9 "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_uncompressed_tarball)"; \
 
131
                $$uncompress "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_received_tarball)"; \
 
132
                gzip -9 "$(DEB_UPSTREAM_WORKDIR)/$(cdbs_upstream_local_basename).orig.tar"; \
135
133
        fi
136
134
 
137
135
DEB_PHONY_RULES += print-version get-orig-source