File: rules

package info (click to toggle)
flex 2.6.4-6.2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 7,168 kB
  • sloc: ansic: 12,044; sh: 5,363; lex: 3,699; yacc: 990; makefile: 712; perl: 238; awk: 72; cpp: 25; sed: 16
file content (113 lines) | stat: -rwxr-xr-x 4,608 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
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1
package:=flex
SRCTOP:= $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
INSTALL = install
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
    INSTALL_PROGRAM += -s
endif

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

install_file	= $(INSTALL) -p	   -o root -g root  -m	644
install_program = $(INSTALL) -p	   -o root -g root  -m	755
install_script	= $(INSTALL) -p	   -o root -g root  -m	755
make_directory	= $(INSTALL) -p -d -o root -g root  -m	755

DPKG_ARCH := dpkg-architecture
export DEB_HOST_MULTIARCH   := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_MULTIARCH)
export DEB_BUILD_MULTIARCH  := $(shell $(DPKG_ARCH) $(ha) -qDEB_BUILD_MULTIARCH)

# Common useful variables
DEB_SOURCE_PACKAGE   := $(strip $(shell egrep '^Source: ' $(SRCTOP)/debian/control | \
                                        cut -f 2 -d ':'))
DEB_VERSION          := $(strip $(shell LC_ALL=C dpkg-parsechangelog               | \
                                        egrep '^Version:' | cut -f 2 -d ' '))
DEB_NOEPOCH_VERSION  := $(shell echo $(DEB_VERSION) | cut -d: -f2-)
DEB_REVISION         := $(strip $(shell echo $(DEB_NOEPOCH_VERSION)                | \
                                        perl  -ple 's/.+\-(.+)$$/$$1/msxg'))
DEB_UPSTREAM_VERSION := $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//')

confflags = ac_cv_lib_util_getloadavg=no
ifneq ($(DEB_BUILD_MULTIARCH),$(DEB_HOST_MULTIARCH))
  confflags += ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes
endif


%:
	dh $@  --with autoreconf

override_dh_auto_configure:
	if ! which flex >/dev/null 2>&1; then				   \
	   if [ -e debian/scan.l.md5sum ] &&				   \
	      [ "`md5sum scan.l`" = "`cat debian/scan.l.md5sum`" ]; then   \
		if [ scan.l -nt scan.c ]; then				   \
		   echo "scan.l newer than scan.c";			   \
		fi;							   \
		touch scan.c;						   \
	   fi;								   \
	fi
	dh_auto_configure -- --prefix=$(PREFIX) $(confflags)
	sed -i -e 's/^dist_doc_DATA[[:space:]]*=.*/dist_doc_DATA=/' doc/Makefile

override_dh_install:
	test ! -d debian/tmp/lib/$(DEB_HOST_MULTIARCH) ||                \
            find debian/tmp/lib/$(DEB_HOST_MULTIARCH) -type f            \
               -name \*.la -exec rm {} \;
	dh_install
	test ! -f debian/libfl2/usr/lib/$(DEB_HOST_MULTIARCH)/libfl.so    || \
            rm -f debian/libfl2/usr/lib/$(DEB_HOST_MULTIARCH)/libfl.so
	test ! -f debian/libfl2/usr/lib/$(DEB_HOST_MULTIARCH)/libfl.a    || \
            rm -f debian/libfl2/usr/lib/$(DEB_HOST_MULTIARCH)/libfl.a
	test ! -d debian/libfl2/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig  || \
            rm -rf debian/libfl2/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig
	test ! -d debian/libfl-dev/usr/lib/$(DEB_HOST_MULTIARCH)         || \
            find debian/libfl-dev/usr/lib/$(DEB_HOST_MULTIARCH)             \
               -name libfl.so.\* -exec rm {} \;
	test ! -f debian/libfl-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libfl.a || \
            ln -s libfl.a                                                   \
                  debian/libfl-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libl.a
	rm -f debian/flex/usr/share/doc/flex/flex.pdf
	test ! -f debian/flex/usr/share/doc/flex/COPYING ||              \
            rm -f debian/flex/usr/share/doc/flex/COPYING
	if [ -d debian/flex/usr/share/locale ] ; then \
	  find debian/flex/usr/share/locale  -type d -empty -delete ; \
	fi
	dh_link


override_dh_installdocs:
	dh_installdocs
ifneq (,$(filter flex-doc, $(shell dh_listpackages)))
	mv debian/flex-doc/usr/share/doc/flex/flex.html/    \
           debian/flex-doc/usr/share/doc/flex-doc/html
	mv debian/flex-doc/usr/share/doc/flex/flex.pdf      \
           debian/flex-doc/usr/share/doc/flex-doc/
	mv debian/flex-doc/usr/share/doc/flex/README.md     \
           debian/flex-doc/usr/share/doc/flex-doc/
endif

override_dh_auto_build:
	dh_auto_build
ifneq (,$(filter flex-doc, $(shell dh_listpackages)))
	$(MAKE) -C doc flex.html flex.pdf
endif
	bash -n debian/flex-doc.postinst
	bash -n debian/flex-doc.prerm
	bash -n debian/flex.postinst
	bash -n debian/flex.prerm

.PHONY: get-orig-source
## http://wiki.debian.org/onlyjob/get-orig-source
get-orig-source:  $(info I: $(package)_$(DEB_UPSTREAM_VERSION))
	@echo "Downloading $(package) $(DEB_UPSTREAM_VERSION)"
	uscan --noconf --verbose --rename --destdir=$(CURDIR) \
              --check-dirname-level=0 --force-download        \
             --download-version $(DEB_UPSTREAM_VERSION) $(SRCTOP)

#Local variables:
#mode: makefile
#End: