File: rules

package info (click to toggle)
jed 0.99.18-8.etch.4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,608 kB
  • ctags: 5,106
  • sloc: ansic: 39,429; sh: 3,426; makefile: 350
file content (168 lines) | stat: -rwxr-xr-x 4,805 bytes parent folder | download
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#!/usr/bin/make -f

#export DH_VERBOSE=1

# These additional compiler flags should bring up warnings about common
# sources of errors.
CFLAGS += -Wall -Wformat=2 -Wunused -Wundef -Wextra -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

include /usr/share/dpatch/dpatch.make

jed=$(CURDIR)/debian/jed
xjed=$(CURDIR)/debian/xjed
jed-common=$(CURDIR)/debian/jed-common
temp=debian/tmp

# get upstream version from changelog (FIXME)
# UPSTREAM_VERSION = $(shell perl -ne '/([\d.]+)-/; print $$1; exit' < \
#                       $(dir $(firstword $(MAKEFILE_LIST)))/changelog)
UPSTREAM_VERSION=0.99-18

clean: unpatch
	dh_testdir
	dh_clean
	-make distclean
	rm -f build-stamp install-stamp
	# fixme-upstream
	rm -f src/config.h

build: build-stamp
build-stamp: patch-stamp
	dh_testdir
	./configure "CFLAGS=$(CFLAGS)" --prefix=/usr/share --exec-prefix=/usr --with-x

	#
	# --- MAKE ---
	#
        # These settings of DL_LIB, OTHERLIBS and XRENDERFONTLIBS are to get
        # right of unnecessary dependencies on libraries.
        # http://rerun.lefant.net/checklib/
        #
        # DL_LIB introduces a dependency on libdl that is already solved by
        # libc. OTHERLIBS introduces a dependency on libm that is also solved
        # by libc. XRENDERFONTLIBS fixes a problem with libxft-dev that defines
        # libfontconfig.
	make DL_LIB="" OTHERLIBS=-lutil XRENDERFONTLIBS=-lXft jed xjed # getmail

	touch build-stamp

binary-indep: patch-stamp
	dh_testdir
	dh_testroot
	# keep dh_install informations (debian/files) and debian/tmp
	dh_clean -i --keep
	dh_installdirs -i

	if ! [ -e src/objs/jed ]; then > src/objs/jed; fi
	make DESTDIR=$(jed-common) install
	if ! [ -s src/objs/jed ]; then rm src/objs/jed; fi
	rm -r $(jed-common)/usr/bin/ $(jed-common)/usr/share/man/
	# fixme-upstream
	rm -r $(jed-common)/usr/share/jed/bin/

	#
	# --- JED-COMMON ---
	#
	# fill up /usr/share/doc/jed-common
	dh_installchangelogs -pjed-common changes.txt

	mv $(jed-common)/usr/share/jed/doc/* \
	    $(jed-common)/usr/share/doc/jed-common
	rmdir $(jed-common)/usr/share/jed/doc
	dh_link -pjed-common usr/share/doc/jed-common usr/share/jed/doc
	dh_installdocs -pjed-common debian/README.Debian \
	    debian/init.d/README.Debian-startup \
	    debian/Debian-Jed-Policy.txt

	mv $(jed-common)/usr/share/doc/jed-common/manual \
	    $(jed-common)/usr/share/doc/jed-common/html
	hevea -fix -o $(jed-common)/usr/share/doc/jed-common/html/jed.hevea \
	    $(jed-common)/usr/share/doc/jed-common/html/jed.tex
	cd $(jed-common)/usr/share/doc/jed-common/html/; hacha jed.hevea
	cd $(jed-common)/usr/share/doc/jed-common/html/; \
	    rm jed.hevea jed.haux jed.htoc jed.tex

	# install some extra docs from the source
	dh_installexamples -pjed-common lib/jed.conf \
	    $(jed-common)/usr/share/jed/lib/jed.rc

	# install *.sl files
	dh_install -pjed-common debian/defaults.sl usr/share/jed/lib/
	rm $(jed-common)/usr/share/jed/lib/jed.rc # it's moved to examples above

	# install info files
	mv $(jed-common)/usr/share/jed/info $(jed-common)/usr/share
	rm $(jed-common)/usr/share/info/dir.info \
	    $(jed-common)/usr/share/info/info.info

	# install compile script to build *.slc files after installation
	dh_install -pjed-common debian/compile usr/share/jed/compile
	mv $(jed-common)/usr/share/jed/compile/compile \
	    $(jed-common)/usr/share/jed/compile/jed-common
	chmod +x $(jed-common)/usr/share/jed/compile/jed-common

	# fill up /etc
	dh_install -pjed-common debian/init.d/*.sl etc/jed.d/
	dh_link -i usr/share/doc/jed-common/README.Debian-startup etc/jed.d/README

	dh_installdebconf -i

	#
	# --- INSTALL-ARCH-INDEP ---
	#
	dh_compress -i --exclude=libfuns.hlp --exclude=jedfuns.hlp

	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build-stamp
	dh_testdir
	dh_testroot
	# keep dh_install informations (debian/files) and debian/tmp
	dh_clean -a
	dh_installdirs -a

	#
	# --- JED ---
	#
	dh_install -pjed src/objs/jed usr/bin/
	dh_installman -pjed doc/manual/jed.1
	dh_link -pjed usr/share/doc/jed-common usr/share/doc/jed

	#
	# --- XJED ---
	#
	dh_install -pxjed src/objs/xjed usr/bin/
	dh_installman -pxjed doc/manual/jed.1
	mv $(xjed)/usr/share/man/man1/jed.1 $(xjed)/usr/share/man/man1/xjed.1
	dh_link -pxjed usr/share/doc/jed-common usr/share/doc/xjed

	#
	# --- INSTALL-ARCH-DEP ---
	#
	dh_installmenu -a
	dh_fixperms -a
	dh_strip -a
	dh_compress -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-arch binary-indep

get-orig-source:
	wget ftp://space.mit.edu/pub/davis/jed/v0.99/jed-$(UPSTREAM_VERSION).tar.gz
	mv jed-$(UPSTREAM_VERSION).tar.gz jed_$(UPSTREAM_VERSION).orig.tar.gz

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