21
21
# Pass $(DH_OPTIONS) into the environment for debhelper's benefit.
24
# force quilt to not use ~/.quiltrc
25
QUILT = quilt --quiltrc /dev/null
26
# force QUILT_PATCHES to the default in case it is exported in the environment
27
QUILT_PATCHES = patches/
24
# force quilt to not use ~/.quiltrc and to use debian/patches
25
QUILT = QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null
29
27
# Set up parameters for the upstream build environment.
121
119
# Set up the package build directory as quilt expects to find it.
123
121
stampdir_targets+=prepare
124
prepare: $(STAMP_DIR)/genscripts $(STAMP_DIR)/prepare $(STAMP_DIR)/patches $(STAMP_DIR)/log
122
prepare: $(STAMP_DIR)/genscripts $(STAMP_DIR)/prepare $(STAMP_DIR)/log
125
123
$(STAMP_DIR)/prepare: $(STAMP_DIR)/stampdir
126
if [ ! -e $(STAMP_DIR)/patches ]; then \
127
mkdir $(STAMP_DIR)/patches; \
128
ln -s $(STAMP_DIR)/patches .pc; \
129
echo 2 >$(STAMP_DIR)/patches/.version; \
131
124
if [ ! -e $(STAMP_DIR)/log ]; then \
132
125
mkdir $(STAMP_DIR)/log; \
134
if [ -e debian/patches ] && [ ! -e patches ]; then \
135
ln -s debian/patches patches; \
139
129
# Apply all patches to the upstream source.
163
153
# Revert all patches to the upstream source.
155
unpatch: $(STAMP_DIR)/prepare
166
156
rm -f $(STAMP_DIR)/patch
167
157
@echo -n "Unapplying patches..."; \
168
if [ -e $(STAMP_DIR)/patches/applied-patches ]; then \
158
if $(QUILT) applied >/dev/null 2>/dev/null; then \
169
159
if $(QUILT) pop -a -v >$(STAMP_DIR)/log/unpatch 2>&1; then \
170
160
cat $(STAMP_DIR)/log/unpatch; \
171
161
echo "successful."; \
209
198
updatepo: debian/po/pothead
210
199
debian/scripts/debconf-updatepo --pot-header=pothead --verbose
212
# Use the MANIFEST files to determine whether we're shipping everything we
213
# expect to ship, and not shipping anything we don't expect to ship.
214
.PHONY: check-manifest
215
stampdir_targets+=check-manifest
216
check-manifest: $(STAMP_DIR)/check-manifest
217
$(STAMP_DIR)/check-manifest: $(STAMP_DIR)/install
219
(cd debian/tmp && find -type f | LC_ALL=C sort | cut -c3-) \
220
>debian/MANIFEST.$(ARCH).new
221
# Construct MANIFEST files from MANIFEST.$(ARCH).in and
222
# MANIFEST.$(ARCH).all or MANIFEST.all.
223
if expr "$(findstring -DBuildFonts=NO,$(IMAKE_DEFINES))" \
224
: "-DBuildFonts=NO" >/dev/null 2>&1; then \
225
LC_ALL=C sort -u debian/MANIFEST.$(ARCH).in >debian/MANIFEST.$(ARCH); \
227
if [ -e debian/MANIFEST.$(ARCH).all ]; then \
228
LC_ALL=C sort -u debian/MANIFEST.$(ARCH).in debian/MANIFEST.$(ARCH).all >debian/MANIFEST.$(ARCH); \
230
LC_ALL=C sort -u debian/MANIFEST.$(ARCH).in debian/MANIFEST.all >debian/MANIFEST.$(ARCH); \
233
# Confirm that the installed file list has not changed.
234
if [ -e debian/MANIFEST.$(ARCH) ]; then \
235
if ! cmp -s debian/MANIFEST.$(ARCH) debian/MANIFEST.$(ARCH).new; then \
236
diff -U 0 debian/MANIFEST.$(ARCH) debian/MANIFEST.$(ARCH).new || DIFFSTATUS=$$?; \
237
case $${DIFFSTATUS:-0} in \
239
1) if [ -n "$$IGNORE_MANIFEST_CHANGES" ]; then \
240
echo 'MANIFEST check failed; ignoring problem because \$$IGNORE_MANIFEST_CHANGES set' >&2; \
241
echo 'Please ensure that the package maintainer has an up-to-date version of the' >&2; \
242
echo 'MANIFEST.$(ARCH).in file.' >&2; \
244
echo 'MANIFEST check failed; please see debian/README' >&2; \
248
*) echo "diff reported unexpected exit status $$DIFFSTATUS when performing MANIFEST check" >&2; \
256
# Because we build (and install) different files depending on whether or not
257
# any architecture-independent packages are being created, the list of files we
258
# expect to see will differ; see the discussion of the "build" target above.
259
.PHONY: check-manifest-arch check-manifest-indep
260
check-manifest-arch: IMAKE_DEFINES+= -DBuildSpecsDocs=NO -DBuildFonts=NO -DInstallHardcopyDocs=NO
261
check-manifest-arch: check-manifest
262
check-manifest-indep: check-manifest
264
201
# Remove files from the upstream source tree that we don't need, or which have
265
202
# licensing problems. It must be run before creating the .orig.tar.gz.
273
210
grep -rvh '^#' debian/prune/ | xargs --no-run-if-empty rm -rf
275
# Change to what should be the correct directory, ensure it is, and if
276
# so, create the .orig.tar.gz file. Exclude the debian directory and its
277
# contents, and any .svn directories and their contents (so that we can safely
278
# build an .orig.tar.gz from SVN checkout, not just an export).
280
# Note: This rule is for Debian package maintainers' convenience, and is not
281
# needed for conventional build scenarios.
283
# This rule *IS* the recommended method for creating a new .orig.tar.gz file,
284
# for the rare situations when one is needed.
285
.PHONY: make-orig-tar-gz
286
make-orig-tar-gz: clean prune-upstream-tree
288
&& if [ $(shell basename $(CURDIR)) != $(SOURCE_NAME)-$(NO_EPOCH_VER) ]; then \
289
echo "Our current working directory has the wrong name. Renaming..." >&2; \
290
mv $(CURDIR) $(SOURCE_NAME)-$(NO_EPOCH_VER); \
292
tar --exclude=debian --exclude=debian/* \
293
--exclude=.svn --exclude=.svn/* \
294
-cf - $(SOURCE_NAME)-$(NO_EPOCH_VER) \
295
| gzip -9 >$(SOURCE_NAME)_$(NO_EPOCH_VER).orig.tar.gz; \
298
212
# Verify that there are no offsets or fuzz in the patches we apply.
300
214
# Note: This rule is for Debian package maintainers' convenience, and is not