summaryrefslogtreecommitdiffstats
path: root/PACKAGE/debian/rules
blob: 08cabf63a620b031dadcd0d384aabbcbaf8c6251 (plain)
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
#!/usr/bin/make -f
# $LynxId: rules,v 1.24 2024/03/14 13:48:36 tom Exp $

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

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

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

PKG_SUFFIX	= -dev

PACKAGE		:= $(shell dpkg-parsechangelog| \
			sed -n 's/^Source: \(.*\)$$/\1/p')

docdir		:= /usr/share/doc/$(PACKAGE)
helpdir		:= $(docdir)/help_dir

DSTDIR		:= $(CURDIR)/debian/$(PACKAGE)
DOCDIR		:= $(DSTDIR)$(docdir)

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
DEBOP=--enable-debug
else
DEBOP=
endif

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

# This package adds the following not in Debian lynx-cur:
# --enable-htmlized-cfg
# --enable-local-docs
# --with-cfg-path

configure: configure-stamp
configure-stamp:
	dh_testdir

	CPPFLAGS="$(CPPFLAGS)" \
	CFLAGS="$(CFLAGS)" \
	LDFLAGS="$(LDFLAGS)" \
	env cf_cv_SYSTEM_MAIL=/usr/sbin/sendmail \
		COMPRESS=/usr/bin/compress \
		BZIP2=/bin/bzip2 \
		UNZIP=/usr/bin/unzip \
		ZIP=/usr/bin/zip \
		LIBS="-lbsd" \
	./configure \
		--host=$(DEB_HOST_GNU_TYPE) \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--program-suffix=$(PKG_SUFFIX) \
		--prefix=/usr \
		--libexecdir=\$${prefix}/lib \
		--mandir=\$${prefix}/share/man \
		--sysconfdir=/etc/$(PACKAGE) \
		--with-cfg-path=/etc/$(PACKAGE):$(docdir)/samples \
		--localstatedir=/var \
		--disable-rpath-hack \
		--libdir=/etc/$(PACKAGE) \
		--enable-8bit-toupper \
		--enable-cgi-links \
		--enable-change-exec \
		--enable-charset-choice \
		--enable-cjk \
		--enable-default-colors \
		--enable-exec-links \
		--enable-exec-scripts \
		--enable-externs \
		--enable-font-switch \
		--enable-forms-options \
		--enable-gzip-help \
		--enable-htmlized-cfg \
		--enable-internal-links \
		--enable-ipv6 \
		--enable-chinese-utf8 \
		--enable-japanese-utf8 \
		--enable-justify-elts \
		--enable-kbd-layout \
		--enable-local-docs \
		--enable-nested-tables \
		--enable-nls \
		--enable-nsl-fork \
		--enable-partial \
		--enable-persistent-cookies \
		--enable-prettysrc \
		--enable-read-eta \
		--enable-scrollbar \
		--enable-source-cache \
		--enable-syslog \
		--enable-warnings \
		--with-gnutls=/usr \
		--with-screen=ncursesw6dev \
		--with-textdomain=$(PACKAGE) \
		--without-included-gettext \
		${DEBOP}

	$(MAKE) preinstall \
		docdir=$(docdir) \
		helpdir=$(helpdir)

	touch configure-stamp

build: build-stamp
build-stamp: configure-stamp
	dh_testdir

	$(MAKE) \
		docdir=$(docdir) \
		helpdir=$(helpdir)

	touch build-stamp

clean:
	dh_testdir
	dh_testroot

	[ ! -f Makefile ] || $(MAKE) clean

	rm -f configure-stamp build-stamp install-stamp \
		config.cache config.h config.status config.log makefile

	rm -f *.o lynx

	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	$(MAKE) install \
		DESTDIR=$(CURDIR)/debian/$(PACKAGE) \
		docdir=$(docdir) \
		helpdir=$(helpdir)

	touch install-stamp

install: install-indep install-arch
install-indep:

install-arch:
	dh_testdir
	dh_testroot
	dh_prep -a
	dh_installdirs -a

	$(MAKE) install-full \
		DESTDIR=$(DSTDIR) \
		docdir=$(docdir) \
		helpdir=$(helpdir)

	cd $(DOCDIR) && rm -f COPY*.asc CHANGES

# Build architecture-independent files here.
binary-indep: build install
# No binary-indep target.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_lintian
	dh_installdebconf
	dh_installdocs
	dh_installmenu
	dh_installmime
	dh_installexamples
	dh_installchangelogs CHANGES
	dh_install
	dh_link
	dh_strip
	dh_compress -XCOPY -X.lss
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install install-stamp