| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
package:=flex |
| 5 |
SRCTOP:= $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) |
| 6 |
INSTALL = install |
| 7 |
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS))) |
| 8 |
INSTALL_PROGRAM += -s |
| 9 |
endif |
| 10 |
|
| 11 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 12 |
DPKG_EXPORT_BUILDFLAGS = 1 |
| 13 |
include /usr/share/dpkg/buildflags.mk |
| 14 |
|
| 15 |
install_file = $(INSTALL) -p -o root -g root -m 644 |
| 16 |
install_program = $(INSTALL) -p -o root -g root -m 755 |
| 17 |
install_script = $(INSTALL) -p -o root -g root -m 755 |
| 18 |
make_directory = $(INSTALL) -p -d -o root -g root -m 755 |
| 19 |
|
| 20 |
DPKG_ARCH := dpkg-architecture |
| 21 |
export DEB_HOST_MULTIARCH := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_MULTIARCH) |
| 22 |
export DEB_BUILD_MULTIARCH := $(shell $(DPKG_ARCH) $(ha) -qDEB_BUILD_MULTIARCH) |
| 23 |
|
| 24 |
|
| 25 |
DEB_SOURCE_PACKAGE := $(strip $(shell egrep '^Source: ' $(SRCTOP)/debian/control | \ |
| 26 |
cut -f 2 -d ':')) |
| 27 |
DEB_VERSION := $(strip $(shell LC_ALL=C dpkg-parsechangelog | \ |
| 28 |
egrep '^Version:' | cut -f 2 -d ' ')) |
| 29 |
DEB_NOEPOCH_VERSION := $(shell echo $(DEB_VERSION) | cut -d: -f2-) |
| 30 |
DEB_REVISION := $(strip $(shell echo $(DEB_NOEPOCH_VERSION) | \ |
| 31 |
perl -ple 's/.+\-(.+)$$/$$1/msxg')) |
| 32 |
DEB_UPSTREAM_VERSION := $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//') |
| 33 |
|
| 34 |
confflags = ac_cv_lib_util_getloadavg=no |
| 35 |
|
| 36 |
confflags += GREP=/bin/grep MKDIR_P="/bin/mkdir -p" SED=/bin/sed SHELL=/bin/bash |
| 37 |
ifneq ($(DEB_BUILD_MULTIARCH),$(DEB_HOST_MULTIARCH)) |
| 38 |
confflags += ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes |
| 39 |
endif |
| 40 |
|
| 41 |
|
| 42 |
%: |
| 43 |
dh $@ --with autoreconf |
| 44 |
|
| 45 |
override_dh_auto_configure: |
| 46 |
if ! which flex >/dev/null 2>&1; then \ |
| 47 |
if [ -e debian/scan.l.md5sum ] && \ |
| 48 |
[ "`md5sum scan.l`" = "`cat debian/scan.l.md5sum`" ]; then \ |
| 49 |
if [ scan.l -nt scan.c ]; then \ |
| 50 |
echo "scan.l newer than scan.c"; \ |
| 51 |
fi; \ |
| 52 |
touch scan.c; \ |
| 53 |
fi; \ |
| 54 |
fi |
| 55 |
dh_auto_configure -- --prefix=$(PREFIX) $(confflags) |
| 56 |
sed -i -e 's/^dist_doc_DATA[[:space:]]*=.*/dist_doc_DATA=/' doc/Makefile |
| 57 |
|
| 58 |
override_dh_install: |
| 59 |
test ! -d debian/tmp/lib/$(DEB_HOST_MULTIARCH) || \ |
| 60 |
find debian/tmp/lib/$(DEB_HOST_MULTIARCH) -type f \ |
| 61 |
-name \*.la -exec rm {} \; |
| 62 |
dh_install |
| 63 |
test ! -f debian/libfl2/usr/lib/$(DEB_HOST_MULTIARCH)/libfl.so || \ |
| 64 |
rm -f debian/libfl2/usr/lib/$(DEB_HOST_MULTIARCH)/libfl.so |
| 65 |
test ! -f debian/libfl2/usr/lib/$(DEB_HOST_MULTIARCH)/libfl.a || \ |
| 66 |
rm -f debian/libfl2/usr/lib/$(DEB_HOST_MULTIARCH)/libfl.a |
| 67 |
test ! -d debian/libfl2/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig || \ |
| 68 |
rm -rf debian/libfl2/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig |
| 69 |
test ! -d debian/libfl-dev/usr/lib/$(DEB_HOST_MULTIARCH) || \ |
| 70 |
find debian/libfl-dev/usr/lib/$(DEB_HOST_MULTIARCH) \ |
| 71 |
-name libfl.so.\* -exec rm {} \; |
| 72 |
test ! -f debian/libfl-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libfl.a || \ |
| 73 |
ln -s libfl.a \ |
| 74 |
debian/libfl-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libl.a |
| 75 |
rm -f debian/flex/usr/share/doc/flex/flex.pdf |
| 76 |
test ! -f debian/flex/usr/share/doc/flex/COPYING || \ |
| 77 |
rm -f debian/flex/usr/share/doc/flex/COPYING |
| 78 |
if [ -d debian/flex/usr/share/locale ] ; then \ |
| 79 |
find debian/flex/usr/share/locale -type d -empty -delete ; \ |
| 80 |
fi |
| 81 |
dh_link |
| 82 |
|
| 83 |
override_dh_installdocs: |
| 84 |
dh_installdocs |
| 85 |
ifneq (,$(filter flex-doc, $(shell dh_listpackages))) |
| 86 |
mv debian/flex-doc/usr/share/doc/flex/flex.html/ \ |
| 87 |
debian/flex-doc/usr/share/doc/flex-doc/html |
| 88 |
mv debian/flex-doc/usr/share/doc/flex/flex.pdf \ |
| 89 |
debian/flex-doc/usr/share/doc/flex-doc/ |
| 90 |
mv debian/flex-doc/usr/share/doc/flex/README.md \ |
| 91 |
debian/flex-doc/usr/share/doc/flex-doc/ |
| 92 |
endif |
| 93 |
|
| 94 |
override_dh_installexamples: |
| 95 |
dh_installexamples |
| 96 |
|
| 97 |
|
| 98 |
rm -f debian/flex/usr/share/doc/flex/examples/fastwc/Makefile |
| 99 |
rm -f debian/flex/usr/share/doc/flex/examples/manual/Makefile |
| 100 |
|
| 101 |
override_dh_auto_build: |
| 102 |
dh_auto_build |
| 103 |
ifneq (,$(filter flex-doc, $(shell dh_listpackages))) |
| 104 |
$(MAKE) -C doc flex.html flex.pdf |
| 105 |
endif |
| 106 |
bash -n debian/flex-doc.postinst |
| 107 |
bash -n debian/flex-doc.prerm |
| 108 |
bash -n debian/flex.postinst |
| 109 |
bash -n debian/flex.prerm |
| 110 |
|
| 111 |
.PHONY: get-orig-source |
| 112 |
|
| 113 |
get-orig-source: $(info I: $(package)_$(DEB_UPSTREAM_VERSION)) |
| 114 |
@echo "Downloading $(package) $(DEB_UPSTREAM_VERSION)" |
| 115 |
uscan --noconf --verbose --rename --destdir=$(CURDIR) \ |
| 116 |
--check-dirname-level=0 --force-download \ |
| 117 |
--download-version $(DEB_UPSTREAM_VERSION) $(SRCTOP) |
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|