Debian Codegraph @

PACKAGE/debian/rules

raw
1 #!/usr/bin/make -f
2 # $LynxId: rules,v 1.25 2024/06/15 22:58:31 tom Exp $
3
4 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
5 DPKG_EXPORT_BUILDFLAGS = 1
6 include /usr/share/dpkg/buildflags.mk
7
8 # Uncomment this to turn on verbose mode.
9 #export DH_VERBOSE=1
10
11 # These are used for cross-compiling and for saving the configure script
12 # from having to guess our platform (since we know it already)
13 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
14 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
15
16 PKG_SUFFIX = -dev
17
18 PACKAGE := $(shell dpkg-parsechangelog| \
19 sed -n 's/^Source: \(.*\)$$/\1/p')
20
21 docdir := /usr/share/doc/$(PACKAGE)
22 helpdir := $(docdir)/help_dir
23
24 DSTDIR := $(CURDIR)/debian/$(PACKAGE)
25 DOCDIR := $(DSTDIR)$(docdir)
26
27 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
28 DEBOP=--enable-debug
29 else
30 DEBOP=
31 endif
32
33 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
34 CFLAGS += -O0
35 else
36 CFLAGS += -O2
37 endif
38 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
39 INSTALL_PROGRAM += -s
40 endif
41
42 # This package adds the following not in Debian lynx-cur:
43 # --enable-htmlized-cfg
44 # --enable-local-docs
45 # --with-cfg-path
46
47 configure: configure-stamp
48 configure-stamp:
49 dh_testdir
50
51 CPPFLAGS="$(CPPFLAGS)" \
52 CFLAGS="$(CFLAGS)" \
53 LDFLAGS="$(LDFLAGS)" \
54 env cf_cv_SYSTEM_MAIL=/usr/sbin/sendmail \
55 COMPRESS=/usr/bin/compress \
56 BZIP2=/bin/bzip2 \
57 UNZIP=/usr/bin/unzip \
58 ZIP=/usr/bin/zip \
59 LIBS="-lbsd" \
60 ./configure \
61 --host=$(DEB_HOST_GNU_TYPE) \
62 --build=$(DEB_BUILD_GNU_TYPE) \
63 --program-suffix=$(PKG_SUFFIX) \
64 --prefix=/usr \
65 --libexecdir=\$${prefix}/lib \
66 --mandir=\$${prefix}/share/man \
67 --sysconfdir=/etc/$(PACKAGE) \
68 --with-cfg-path=/etc/$(PACKAGE):$(docdir)/samples \
69 --localstatedir=/var \
70 --disable-rpath-hack \
71 --libdir=/etc/$(PACKAGE) \
72 --enable-8bit-toupper \
73 --enable-cgi-links \
74 --enable-change-exec \
75 --enable-charset-choice \
76 --enable-cjk \
77 --enable-default-colors \
78 --enable-exec-links \
79 --enable-exec-scripts \
80 --enable-externs \
81 --enable-font-switch \
82 --enable-forms-options \
83 --enable-gzip-help \
84 --enable-htmlized-cfg \
85 --enable-internal-links \
86 --enable-ipv6 \
87 --enable-chinese-utf8 \
88 --enable-japanese-utf8 \
89 --enable-justify-elts \
90 --enable-kbd-layout \
91 --enable-local-docs \
92 --enable-nested-tables \
93 --enable-nls \
94 --enable-nsl-fork \
95 --enable-partial \
96 --enable-persistent-cookies \
97 --enable-prettysrc \
98 --enable-read-eta \
99 --enable-scrollbar \
100 --enable-source-cache \
101 --enable-syslog \
102 --enable-warnings \
103 --with-gnutls=/usr \
104 --with-screen=ncursesw6td \
105 --with-textdomain=$(PACKAGE) \
106 --without-included-gettext \
107 ${DEBOP}
108
109 $(MAKE) preinstall \
110 docdir=$(docdir) \
111 helpdir=$(helpdir)
112
113 touch configure-stamp
114
115 build: build-stamp
116 build-stamp: configure-stamp
117 dh_testdir
118
119 $(MAKE) \
120 docdir=$(docdir) \
121 helpdir=$(helpdir)
122
123 touch build-stamp
124
125 clean:
126 dh_testdir
127 dh_testroot
128
129 [ ! -f Makefile ] || $(MAKE) clean
130
131 rm -f configure-stamp build-stamp install-stamp \
132 config.cache config.h config.status config.log makefile
133
134 rm -f *.o lynx
135
136 dh_clean
137
138 install: install-stamp
139 install-stamp: build-stamp
140 dh_testdir
141 dh_testroot
142 dh_prep
143 dh_installdirs
144
145 $(MAKE) install \
146 DESTDIR=$(CURDIR)/debian/$(PACKAGE) \
147 docdir=$(docdir) \
148 helpdir=$(helpdir)
149
150 touch install-stamp
151
152 install: install-indep install-arch
153 install-indep:
154
155 install-arch:
156 dh_testdir
157 dh_testroot
158 dh_prep -a
159 dh_installdirs -a
160
161 $(MAKE) install-full \
162 DESTDIR=$(DSTDIR) \
163 docdir=$(docdir) \
164 helpdir=$(helpdir)
165
166 cd $(DOCDIR) && rm -f COPY*.asc CHANGES
167
168 # Build architecture-independent files here.
169 binary-indep: build install
170 # No binary-indep target.
171
172 # Build architecture-dependent files here.
173 binary-arch: build install
174 dh_testdir
175 dh_testroot
176 dh_lintian
177 dh_installdebconf
178 dh_installdocs
179 dh_installmenu
180 dh_installmime
181 dh_installexamples
182 dh_installchangelogs CHANGES
183 dh_install
184 dh_link
185 dh_strip
186 dh_compress -XCOPY -X.lss
187 dh_fixperms
188 dh_installdeb
189 dh_shlibdeps
190 dh_gencontrol
191 dh_md5sums
192 dh_builddeb
193
194 binary: binary-indep binary-arch
195 .PHONY: build clean binary-indep binary-arch binary install install-stamp