Source

CDBStore / tinycdb-0.76 / debian / rules

#!/usr/bin/make -f
# -*- makefile -*-

export DH_COMPAT=4

CFLAGS = -Wall -W -g
# can't use -Wmissing-prototypes due to nss routines

INSTALL = install
INSTALL_PROGRAM = $(INSTALL) -p
INSTALL_DATA = $(INSTALL) -p -m0644

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif
ifeq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CDEFS += -DNDEBUG
endif

SOVER = 1

configure:	# nothing
	dh_testdir

build:	build-stamp
build-stamp:
	dh_testdir
	$(MAKE) CFLAGS="$(CFLAGS)" \
		staticlib sharedlib cdb-shared nss
	cp -pf cdb-shared cdb
	cp -pf nss_cdb-Makefile cdb-Makefile
	touch $@

clean:
	dh_testdir
	rm -f build-stamp cdb-Makefile
	$(MAKE) distclean
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs
	dh_installdocs -A NEWS

# libcdb$(SOVER)
	dh_install -plibcdb$(SOVER) libcdb.so.$(SOVER) usr/lib

# libcdb-dev
	dh_install -plibcdb-dev libcdb.a libcdb_pic.a libcdb.so usr/lib
	dh_install -plibcdb-dev cdb.h usr/include
	dh_installman -plibcdb-dev cdb.3
#	dh_installdocs -plibcdb-dev TODO

# tinycdb
	dh_install -ptinycdb cdb usr/bin
	dh_installman -ptinycdb cdb.1 cdb.5

# libnss-cdb
#	dh_install -plibnss-cdb cdb-Makefile etc
#	dh_install -plibnss-cdb libnss_cdb.so.2 lib

binary-indep: build install

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps -L libcdb$(SOVER) -l debian/libcdb$(SOVER)/usr/lib
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure