#!/usr/bin/make -f # Copyright 2003-2005 Anibal Monsalve Salazar export DH_VERBOSE=1 CURDIR := $(shell pwd) D := $(CURDIR)/debian/flow-tools DCF := $(CURDIR)/debian/libcflow-perl CF := contrib/Cflow-1.051 DEV := $(CURDIR)/debian/flow-tools-dev CFLAGS := -g -Wall ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif CCFLAGS := -g # Include dpatch include /usr/share/dpatch/dpatch.make ifndef PERL PERL := /usr/bin/perl endif clean: clean1 unpatch clean1: dh_testroot dh_testdir dh_clean rm -rf configure-stamp build-stamp confdefs.h $(CF) [ ! -f Makefile ] || $(MAKE) distclean unpack-cflow: $(CF)/Cflow.xs $(CF)/Cflow.xs: contrib/Cflow-1.051.tar.gz cd contrib/ && tar xzmf Cflow-1.051.tar.gz cd $(CF) && patch -p1 < ../Cflow-debian.diff cd $(CF) && patch -p1 < ../Cflow-ccflags.diff configure: config-stamp configure-stamp: $(CF)/Cflow.xs dh_testdir ./configure --prefix=/usr --exec-prefix=\$${prefix} \ --mandir=\$${prefix}/share/man --sysconfdir=/etc/flow-tools \ --localstatedir=/etc/flow-tools \ --with-mysql --with-pgsql CFLAGS="$(CFLAGS)" cd $(CF) && $(PERL) Makefile.PL INSTALLDIRS=vendor touch $@ build: patch build-stamp build-stamp: configure-stamp dh_testdir $(MAKE) cd $(CF) && $(PERL) Makefile.PL INSTALLDIRS=vendor echo "#define FT_PROG_BUILD \"debian $(shell dpkg-parsechangelog -SVersion)\"" > src/ftbuild.h cd $(CF) && $(MAKE) OPTIMIZE="$(CFLAGS)" touch $@ install: build dh_testroot dh_testdir dh_clean $(MAKE) install DESTDIR=$D # rm -rf $D/usr/lib/ $D/usr/include/ mkdir -p $(DEV)/usr/ mv $D/usr/lib/ $(DEV)/usr/ mv $D/usr/include/ $(DEV)/usr/ cd $(CF) && $(MAKE) install DESTDIR=$(DCF) PREFIX=/usr # As this is an architecture dependent package, we are not supposed # to install stuff to /usr/share/perl5. MakeMaker creates the # directories, we delete them from the deb. [ ! -d $(DCF)/usr/share/perl5 ] || rmdir --ignore-fail-on-non-empty --parents --verbose $(DCF)/usr/share/perl5 cp debian/flow-capture.conf $D/etc/flow-tools/ binary-arch: install dh_installinit --name=flow-capture dh_installdocs --package=flow-tools SECURITY TODO dh_installdocs --package=flow-tools-dev dh_installdocs --package=libcflow-perl $(CF)/README dh_installchangelogs --package=flow-tools ChangeLog dh_installchangelogs --package=flow-tools-dev ChangeLog dh_installchangelogs --package=libcflow-perl $(CF)/Changes ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) dh_strip endif dh_compress dh_fixperms dh_perl dh_shlibdeps dh_gencontrol dh_installdeb dh_builddeb binary: binary-arch .PHONY: clean build install binary-indep binary-arch binary patch unpatch