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
|
#!/usr/bin/make -f
# Derived from dh_make example.
#export DH_VERBOSE=1
export DH_COMPAT=2
export DH_OPTIONS
version := $(shell cat VERSION)
tmp := $(CURDIR)/debian/libnasl
CFLAGS := -g -Wall -D_REENTRANT -DSYSTEM_PCAP
ifneq "$(findstring noopt,$(DEB_BUILD_OPTIONS))" ""
CFLAGS += -O0
else
CFLAGS += -O2
endif
build: build-stamp
build-stamp: config.status
dh_testdir
$(MAKE)
touch $@
config.status: configure
CFLAGS="$(CFLAGS)" ./configure --prefix=/usr \
--mandir='$${prefix}/share/man' --enable-static --enable-debug \
--localstatedir='/var/lib/'
clean:
dh_testdir
dh_testroot
touch nasl.tmpl
[ ! -f Makefile ] || $(MAKE) distclean
dh_clean build-stamp nasl/strutils.h
install: DH_OPTIONS=
install: build-stamp
dh_testdir
dh_testroot
dh_clean -k
$(MAKE) install DESTDIR=$(tmp)2/
cd doc && $(MAKE) install DESTDIR=$(tmp)2/
dh_movefiles --sourcedir=debian/libnasl2 -plibnasl-dev \
usr/lib/*.so usr/lib/*.a usr/lib/*.la usr/bin usr/include \
usr/share/man usr/share/doc/libnasl
cd $(tmp)-dev/usr/share/doc && mv libnasl libnasl2
find $(tmp)2/usr -type d -empty | xargs -r rmdir -p --ignore-fail-on-non-empty
binary-indep:
# Nothing.
binary-arch: DH_OPTIONS=-a
binary-arch: install
dh_testdir
dh_testroot
dh_installdocs
rm -rf $(tmp)-dev/usr/share/doc/libnasl-dev
ln -s libnasl2 $(tmp)-dev/usr/share/doc/libnasl-dev
DH_OPTIONS=-plibnasl2 dh_installchangelogs
ifeq "$(findstring nostrip,$(DEB_BUILD_OPTIONS))" ""
dh_strip
endif
dh_compress
dh_fixperms
dh_makeshlibs -V "libnasl2 (>= $(version))"
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
|