summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules78
1 files changed, 78 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..029e492
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,78 @@
+#!/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
+
+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)
+
+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
+ rm -f debian/flex/usr/share/doc/flex/flex.pdf
+ifneq (,$(filter libfl-dev, $(shell dh_listpackages)))
+ $(make_directory) debian/libfl-dev/usr/lib
+ sed -e 's,#DEB_HOST_MULTIARCH#,$(DEB_HOST_MULTIARCH),' \
+ debian/libfl.shared_object > debian/libfl-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libfl.so
+ ln -s libfl.a debian/libfl-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libl.a
+endif
+ifneq (,$(filter flex, $(shell dh_listpackages)))
+ test ! -f debian/flex/usr/share/doc/flex/COPYING || rm -f debian/flex/usr/share/doc/flex/COPYING
+endif
+ dh_link
+
+
+override_dh_installdocs:
+ dh_installdocs
+ifneq (,$(filter flex-doc, $(shell dh_listpackages)))
+ mv debian/flex-doc/usr/share/doc/flex-doc/flex.html debian/flex-doc/usr/share/doc/flex-doc/html
+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
+
+#Local variables:
+#mode: makefile
+#End: