File: rules

package info (click to toggle)
elinks 0.12~pre6-5
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 19,808 kB
  • ctags: 11,372
  • sloc: ansic: 96,761; sh: 5,272; python: 3,878; perl: 2,175; makefile: 1,059; pascal: 924; yacc: 295; lisp: 125; ruby: 70; awk: 65
file content (170 lines) | stat: -rwxr-xr-x 5,767 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
169
170
#!/usr/bin/make -f

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

# This has to be exported to make some magic below work.
export DH_OPTIONS

export DH_ALWAYS_EXCLUDE=.gitignore
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

version=`dpkg-parsechangelog -ldebian/changelog | grep 'Version: ' | sed 's/Version: //g'`

# 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)

CFLAGS_COMMON=-g
CFLAGS_COMMON += `dpkg-buildflags --get CFLAGS`

LDFLAGS_COMMON="-Wl,-z,defs"
LDFLAGS_COMMON += `dpkg-buildflags --get LDFLAGS`

CPPFLAGS_COMMON = `dpkg-buildflags --get CPPFLAGS`

confopts = --prefix=/usr \
	--mandir=\$${prefix}/share/man \
	--infodir=\$${prefix}/share/info \
	--sysconfdir=/etc/elinks \
	--without-lzma \
	--without-openssl \
	--without-x \
	--enable-finger \
	--with-gnutls=/usr \
	--disable-nntp \
	--enable-88-colors \
	--enable-256-colors \
	--enable-leds \
	--enable-html-highlight \
	--enable-fsp \
	--disable-smb \
	--with-perl \
	--without-guile \
	--without-python \
	--without-ruby \
	--with-gssapi \
	--enable-cgi \
	--disable-exmode \
	--disable-bittorrent \
	--disable-debug \
	--without-spidermonkey

save-upstream: save-stamp

save-stamp:
	dh_testdir
	rm -f debian/elinks.conf
	cat debian/elinks.config | sed "s/%v/$(version)/g" > debian/elinks.conf
	# Add here commands to configure the package.
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
	[ ! -f config/config.sub ] || mv -f config/config.sub config/config.sub.ups
	cp -f /usr/share/misc/config.sub config/config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
	[ ! -f config/config.guess ] || mv -f config/config.guess config/config.guess.ups
	cp -f /usr/share/misc/config.guess config/config.guess
endif
	[ ! -f config.h ] || mv -f config.h config.h.ups
	[ ! -f Makefile.config ] || mv -f Makefile.config Makefile.config.ups
	[ ! -f doc/man/man1/elinks.1.in ] || cp -af doc/man/man1/elinks.1.in doc/man/man1/elinks.1.in.ups
	[ ! -f doc/man/man5/elinks.conf.5 ] || cp -af doc/man/man5/elinks.conf.5 doc/man/man5/elinks.conf.5.ups
	[ ! -f doc/man/man5/elinkskeys.5 ] || cp -af doc/man/man5/elinkskeys.5 doc/man/man5/elinkskeys.5.ups
	touch $@

#Architecture 
build: build-arch build-indep

build-arch: build-arch-stamp
build-arch-stamp: save-stamp
	mkdir $(CURDIR)/build-main && cd $(CURDIR)/build-main && \
		$(CURDIR)/configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
		$(confopts) CPPFLAGS="$(CPPFLAGS_COMMON)" CFLAGS="$(CFLAGS_COMMON)" LDFLAGS="$(LDFLAGS_COMMON)"
	$(MAKE) -C $(CURDIR)/build-main V=1
	touch $@

build-indep: build-indep-stamp
build-indep-stamp: save-stamp
	$(MAKE) -C $(CURDIR)/build-main/doc all-docs
	touch $@

clean: clean-patched
clean-patched:
	dh_testdir
	dh_testroot
	rm -f build-arch-stamp build-indep-stamp save-stamp
	rm -rf build-main
	[ ! -f doc/man/man5/elinkskeys.5.ups ] || mv -f doc/man/man5/elinkskeys.5.ups doc/man/man5/elinkskeys.5
	[ ! -f doc/man/man5/elinks.conf.5.ups ] || mv -f doc/man/man5/elinks.conf.5.ups doc/man/man5/elinks.conf.5
	[ ! -f doc/man/man1/elinks.1.in.ups ] || mv -f doc/man/man1/elinks.1.in.ups doc/man/man1/elinks.1.in
	[ ! -f Makefile.config.ups ] || mv -f Makefile.config.ups Makefile.config
	[ ! -f config.h.ups ] || mv -f config.h.ups config.h
	[ ! -f config/config.guess.ups ] || mv -f config/config.guess.ups config/config.guess
	[ ! -f config/config.sub.ups ] || mv -f config/config.sub.ups config/config.sub
	rm -f debian/elinks.conf
	rm -rf debian/tmp.elinks-data
	rm -rf docbook2html-dir
	dh_clean 

install: install-indep install-arch
install-indep:
	dh_testdir
	dh_testroot
	dh_clean -k -i 
	dh_installdirs -i
	# Move elinks arch-indep from temp location to elinks-data
	mv -f $(CURDIR)/debian/tmp.elinks-data/usr $(CURDIR)/debian/elinks-data/
	# Install elinks documentation, remove manpages (already installed in
	# elinks-data)
	$(MAKE) -C build-main/doc DESTDIR=$(CURDIR)/debian/elinks-doc install-doc
	mv -f $(CURDIR)/debian/elinks-doc/usr/share/doc/elinks $(CURDIR)/debian/elinks-doc/usr/share/doc/elinks-doc
	rm -rf $(CURDIR)/debian/elinks-doc/usr/share/man
	dh_install -i

install-arch:
	dh_testdir
	dh_testroot
	dh_clean -k -s 
	# Install elinks binaries and elinks.conf
	$(MAKE) -C build-main DESTDIR=$(CURDIR)/debian/elinks install
	install -o root -g root -p -D -m 0644 $(CURDIR)/debian/elinks.conf \
		$(CURDIR)/debian/elinks/etc/elinks/elinks.conf
	# Move elinks arch-indep parts to temp location for elinks-data
	mkdir -p $(CURDIR)/debian/tmp.elinks-data/usr/
	mv -f $(CURDIR)/debian/elinks/usr/share $(CURDIR)/debian/tmp.elinks-data/usr/
	rm -f $(CURDIR)/debian/tmp.elinks-data/usr/share/locale/locale.alias
	dh_link -pelinks usr/share/doc/elinks-data usr/share/doc/elinks
	dh_install -s
	dh_lintian -s

# Must not depend on anything. This is to be called by
# binary-arch/binary-indep
# in another 'make' thread.
binary-common:
	dh_testdir
	dh_testroot
	dh_installchangelogs -Nelinks NEWS
	dh_installdocs
	dh_installexamples
	dh_installmenu
	dh_installmime
	dh_strip
	dh_compress 
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture independant packages using the common target.
binary-indep: build-indep install-indep
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common

# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch 
	$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common

binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch save-upstream