File: rules

package info (click to toggle)
jed-extra 2.5.7-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,968 kB
  • sloc: makefile: 75; ruby: 43; sed: 38; sh: 31
file content (154 lines) | stat: -rwxr-xr-x 4,596 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/usr/bin/make -f
# -*- make -*-
# debian/rules file for jed-extra
# GNU copyright 2003, 2005 by Rafael Laboissiere <rafael@debian.org>
# $Id: rules 1198 2009-10-05 18:25:59Z milde-guest $

# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1

#include /usr/share/dpatch/dpatch.make

# Variables
# =========

# File Sorting
# ------------

CONTENTS_FILE = debian/contents.txt

ADDITION = $(shell awk '/^A/ { print $$2"/*"; }' $(CONTENTS_FILE))
COLOR = $(shell awk '/^C/ { print $$2"/*"; }' $(CONTENTS_FILE))
DROP_IN = $(shell awk '/^D/ { print $$2"/*"; }' $(CONTENTS_FILE))
ENHANCEMENT = $(shell awk '/^E/ { print $$2"/*"; }' $(CONTENTS_FILE))
EXPERIMENTAL = $(shell awk '/^X/ { print $$2"/*"; }' $(CONTENTS_FILE))
TESTS = $(shell awk '/^T/ { print $$2"/*"; }' $(CONTENTS_FILE))
UTILS = $(shell awk '/^U/ { print $$2"/*"; }' $(CONTENTS_FILE))

debroot = $(CURDIR)/debian/jed-extra
libdir = /usr/share/jed/jed-extra

dh_inst_excl = -X.html -X.otl -X.example -X.template -XREADME


# Source download
# ---------------

WGET = wget -N

# URL of the upstream source package
UPSTREAM_VERSION ?= $(shell perl -ne '/([\d.]+[pre]*\d*)-?/; print $$1; exit' < debian/changelog)
UPSTREAM_PACKAGE =          jedmodes-$(UPSTREAM_VERSION).tgz
UPSTREAM_PACKAGE_CHECKSUM = jedmodes-$(UPSTREAM_VERSION).md5sum
# officially released CVS tarball from the SF FRS
UPSTREAM_URL = http://downloads.sourceforge.net/project/jedmodes/
MIRROR = ?use_mirror=surfnet

# build from local copy
# Use curl, as this also understands a file:// URL
# * write output to file named like the remote file
# * attempt  to  figure  out  the timestamp  of the remote file,
#   and if that is available make the local file get that same timestamp.
#UPSTREAM_URL = file:/home/milde/.jed/jedmodes/src/
#MIRROR = ''
#WGET = curl --remote-name --remote-time

# Rules
# =====

get-orig-source:
	# get and check the jedmodes tarball
	$(WGET) $(UPSTREAM_URL)$(UPSTREAM_PACKAGE)$(MIRROR)
	# Check the md5sum of the upstream tarball
	$(WGET) $(UPSTREAM_URL)$(UPSTREAM_PACKAGE_CHECKSUM)$(MIRROR)
	cat $(UPSTREAM_PACKAGE_CHECKSUM) | md5sum -c || exit 1

	mv $(UPSTREAM_PACKAGE) jed-extra_$(UPSTREAM_VERSION).orig.tar.gz

	# additional modes from other sources
	# currently none, code kept for reference
	# mkdir --parents jedmodes-$(UPSTREAM_VERSION)/boxquote
	# cd jedmodes-$(UPSTREAM_VERSION)/boxquote; \
	#     $(WGET) http://www.cis.fu-berlin.de/~phgrau/slang/boxquote.sl
	# 
	# gunzip jed-extra_$(UPSTREAM_VERSION).orig.tar.gz
	# tar --append --file jed-extra_$(UPSTREAM_VERSION).orig.tar \
	#     jedmodes-$(UPSTREAM_VERSION)/boxquote/*
	# gzip -9 jed-extra_$(UPSTREAM_VERSION).orig.tar

clean:
	dh_testdir
	# debconf-updatepo
	rm -rf *.tgz *.md5sum *.tar.gz jedmodes-*
	dh_clean

binary binary-indep:
	dh_testdir
	dh_testroot
	dh_clean

	# install modes
ifneq ($(ADDITION)$(ENHANCEMENT), )
	dh_install $(dh_inst_excl) $(ADDITION) $(ENHANCEMENT) $(libdir)
endif
ifneq ($(COLOR), )
	dh_install $(dh_inst_excl) $(COLOR) $(libdir)/colors
endif
ifneq ($(DROP_IN), )
	dh_install $(dh_inst_excl) $(DROP_IN) $(libdir)/drop-in
endif
ifneq ($(TESTS), )
	dh_install $(dh_inst_excl) $(TESTS) $(libdir)/tests
endif
ifneq ($(UTILS), )
	dh_install $(dh_inst_excl) $(UTILS) $(libdir)/utils
endif
ifneq ($(EXPERIMENTAL), )
	dh_install $(dh_inst_excl) $(EXPERIMENTAL) $(libdir)/extra
endif

        # install package documentation
	dh_installdocs debian/contents.txt

	# install upstream documentation
	dh_install $$(find . -wholename ./debian -prune \
	    -o \( -name README \) -print) usr/share/doc/jed-extra/

	dh_install $$(find . -wholename ./debian -prune \
	    -o \(   -name \*.html \
	         -o -name \*.otl \
	         -o -name \*.example \
		 -o -name \*.hlp \
		 -o -name \*.template \
	       \) -print) \
	    usr/share/doc/jed-extra/mode-doc/
	# TODO: *.hlp files are installed in mode-doc and jed-library-path
	#       symlink them instead

	# Install examples
	dh_installexamples debian/examples/*

	# fix some names (as dh_install* cannot change filenames)
	mv $(debroot)/usr/share/jed/compile/compile \
	   $(debroot)/usr/share/jed/compile/jed-extra

	chmod +x $(debroot)/usr/share/jed/compile/jed-extra	\
		$(debroot)/usr/share/jed/jed-extra/tm.sed

	dh_installdebconf

	dh_installchangelogs
	dh_compress --exclude=.sl
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

build build-arch build-indep:
	# nothing to do, but required by debian policy

binary-arch:
	# nothing to do, but we need it to be policy conform

.PHONY: build build-arch build-indep clean binary binary-arch binary-indep get-orig-source