Debian Codegraph @

package/debian/rules

raw
1 #!/usr/bin/make -f
2 # Made with the aid of dh_make, by Craig Small
3 # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
4 # Some lines taken from debmake, by Cristoph Lameter.
5
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
8
9 SHELL = /bin/bash
10 DPKG_EXPORT_BUILDFLAGS = 1
11 export DEB_BUILD_MAINT_OPTIONS := hardening=+all qa=+bug reproducible=+all
12
13 include /usr/share/dpkg/buildflags.mk
14
15 # These are used for cross-compiling and for saving the configure script
16 # from having to guess our platform (since we know it already)
17 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
18 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
19
20 DESKTOP_VENDOR = dickey
21
22 PKG_SUFFIX = -dev
23 PKG_CLASS = XTermDev
24
25 PACKAGE := $(shell dpkg-parsechangelog| \
26 sed -n 's/^Source: \(.*\)$$/\1/p')
27
28 PKG_APPDEFAULTS := /etc/X11/app-defaults
29 PKG_DESKTOP := /usr/share/applications
30
31 DSTDIR := $(CURDIR)/debian/$(PACKAGE)
32 MY_DESKTOP := $(DSTDIR)/usr/share/applications
33
34 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
35 DEBOP=--enable-debug
36 else
37 DEBOP=
38 endif
39
40 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
41 CFLAGS += -O0
42 else
43 CFLAGS += -O2
44 endif
45 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
46 INSTALL_PROGRAM += -s
47 endif
48
49 configure_flags = \
50 --host=$(DEB_HOST_GNU_TYPE) \
51 --build=$(DEB_BUILD_GNU_TYPE) \
52 --program-suffix=$(PKG_SUFFIX) \
53 --prefix=/usr \
54 --libexecdir=\$${prefix}/lib \
55 --mandir=\$${prefix}/share/man \
56 --sysconfdir=/etc/$(PACKAGE) \
57 --localstatedir=/var \
58 --libdir=/etc/$(PACKAGE) \
59 --with-app-class=$(PKG_CLASS) \
60 --without-xterm-symlink \
61 --disable-imake \
62 --enable-backarrow-is-erase \
63 --enable-dabbrev \
64 --enable-dec-locator \
65 --enable-exec-xterm \
66 --enable-hp-fkeys \
67 --enable-load-vt-fonts \
68 --enable-logfile-exec \
69 --enable-logging \
70 --enable-mini-luit \
71 --enable-regis-graphics \
72 --enable-sco-fkeys \
73 --enable-status-line \
74 --enable-toolbar \
75 --enable-xmc-glitch \
76 --with-app-defaults=$(PKG_APPDEFAULTS) \
77 --with-icondir=\$${prefix}/share/icons \
78 --with-pixmapdir=\$${prefix}/share/pixmaps \
79 --with-own-terminfo=\$${prefix}/share/terminfo \
80 --with-icon-theme \
81 --with-terminal-type=xterm-new \
82 --with-utempter \
83 --with-icon-name=mini.xterm \
84 --with-xpm ${DEBOP}
85
86 configure: configure-stamp
87 configure-stamp:
88 dh_testdir
89
90 # Update config.guess, config.sub
91 dh_update_autotools_config
92
93 # Configure xterm-dev
94 dh_auto_configure -- $(configure_flags)
95
96 touch configure-stamp
97
98 build: build-stamp
99 build-stamp: configure-stamp
100 dh_testdir
101
102 $(MAKE)
103
104 touch build-stamp
105
106 clean:
107 dh_testdir
108 dh_testroot
109
110 [ ! -f Makefile ] || $(MAKE) distclean
111
112 dh_clean
113
114 install: install-stamp
115 install-stamp: build-stamp
116 dh_testdir
117 dh_testroot
118 dh_prep
119 dh_installdirs
120
121 $(MAKE) install \
122 DESTDIR=$(CURDIR)/debian/$(PACKAGE)
123
124 touch install-stamp
125
126 install: install-indep install-arch
127 install-indep:
128
129 install-arch:
130 dh_testdir
131 dh_testroot
132 dh_prep -a
133 dh_installdirs -a
134
135 $(MAKE) install-bin \
136 DESTDIR=$(DSTDIR)
137
138 # Build architecture-independent files here.
139 binary-indep: build install
140 dh_testdir
141 dh_testroot
142
143 # This overwrites the Debian package's copy of app-defaults and icons.
144 # But the resources are not the same; they are patched.
145 sed -i -f package/debian/color.sed XTerm-col.ad
146 sed -i -f package/debian/xterm-xres.sed XTerm.ad
147
148 $(MAKE) install-app \
149 install-icon \
150 install-man \
151 DESTDIR=$(DSTDIR)
152
153 # Follow-up with a check against the installed resource files.
154 ( cd $(DSTDIR)$(PKG_APPDEFAULTS) \
155 && $(SHELL) -c 'for p in *; do \
156 test -f $(PKG_APPDEFAULTS)/$$p && \
157 diff -u $(PKG_APPDEFAULTS)/$$p $$p; \
158 done' ; \
159 exit 0 )
160
161 # The Debian package stopped installing xterm's desktop files; a
162 # subsequent revision added that back with limitations. xterm's
163 # configure script checks for categories which are used by other
164 # terminal emulators. The Debian package overrides that to a single
165 # category.
166 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=486317
167 $(MAKE) install-desktop \
168 DESKTOP_FLAGS="--dir $(MY_DESKTOP)"
169
170 ( cd $(DSTDIR)$(PKG_DESKTOP) \
171 && $(SHELL) -c 'for p in *;do \
172 test -f $(PKG_DESKTOP)/$$p && \
173 diff -u $(PKG_DESKTOP)/$$p $$p; \
174 test -n "$(PKG_SUFFIX)" && mv $$p `basename $$p .desktop`$(PKG_SUFFIX).desktop; \
175 done' ; \
176 exit 0 )
177
178 dh_icons
179
180 # Build architecture-dependent files here.
181 binary-arch: build install
182 dh_testdir
183 dh_testroot
184 dh_installdebconf
185 dh_lintian
186 dh_installdocs
187 dh_installmenu
188 dh_installmime
189 dh_installexamples tektests vttests
190 dh_installchangelogs
191 dh_install
192 dh_link
193 dh_strip
194 dh_compress -Xexamples
195 dh_fixperms
196 dh_installdeb
197 dh_shlibdeps
198 dh_gencontrol
199 dh_md5sums
200 dh_builddeb
201
202 binary: binary-indep binary-arch
203 .PHONY: build clean binary-indep binary-arch binary install install-stamp