From: Kefu Chai Date: Fri, 20 May 2016 15:45:20 +0000 (+0800) Subject: debian/rules: package in a more debhelper way X-Git-Tag: ses5-milestone5~570^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=457ddea9c8b0f000476798e99ee0aaeb003402c9;p=ceph.git debian/rules: package in a more debhelper way this helps to keep the build rule simpler, and easier to customize * -j$(NUMJOBS) is taken care of by 'dh --parallel' * use 'autoreconf' dh add-on to autoconf cleanup * add dh-autoreconf to Build-Depends * bump debhelper compatibility level to 8, as jewel's supported debian based distro is jessie (with debhelper 9.20150101), ubuntu trusty (with debhelper 9.20131227ubuntu1) Signed-off-by: Kefu Chai --- diff --git a/debian/compat b/debian/compat index 1e8b31496214..45a4fb75db86 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -6 +8 diff --git a/debian/control b/debian/control index 0bc06810af2f..14198f6b12a9 100644 --- a/debian/control +++ b/debian/control @@ -15,7 +15,9 @@ Build-Depends: autoconf, cpio, cryptsetup-bin | cryptsetup, cython, - debhelper (>= 6.0.7~), + debhelper (>= 8), + dh-autoreconf, + dh-python, dh-systemd, default-jdk, git, diff --git a/debian/rules b/debian/rules index 1213ee5ded19..9995e971f869 100755 --- a/debian/rules +++ b/debian/rules @@ -3,21 +3,6 @@ export DH_VERBOSE=1 export DESTDIR=$(CURDIR)/debian/tmp -ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - MAKEFLAGS += -j$(NUMJOBS) -endif - -export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) - -# Recommended snippet for Autoconf 2.52 or later -ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) - confflags += --build $(DEB_HOST_GNU_TYPE) -else - confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) -endif - export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) extraopts += --with-ocf --with-nss @@ -33,90 +18,48 @@ ifeq ($(DEB_HOST_ARCH), armel) extraopts += --without-libatomic-ops endif -configure: configure-stamp -configure-stamp: - dh_testdir - ./autogen.sh - ./configure --prefix=/usr --localstatedir=/var \ - --sysconfdir=/etc --libexecdir=/usr/lib $(extraopts) $(confflags) \ - $(CEPH_EXTRA_CONFIGURE_ARGS) - touch $@ - -build-arch: build -build-indep: build +%: + dh $@ --with javahelper,python2,autoreconf,systemd --parallel -build: build-stamp -build-stamp: configure-stamp - dh_testdir +override_dh_autoreconf: + dh_autoreconf ./autogen.sh - $(MAKE) +override_dh_auto_configure: + dh_auto_configure -- $(extraopts) $(CEPH_EXTRA_CONFIGURE_ARGS) +override_dh_auto_build: + dh_auto_build cp src/init-ceph debian/ceph-base.ceph.init cp src/init-radosgw debian/radosgw.init cp src/logrotate.conf debian/ceph.logrotate - touch $@ - -clean: - dh_testdir - dh_testroot +override_dh_auto_clean: + dh_auto_clean rm -f build-stamp configure-stamp - - [ ! -f Makefile ] || $(MAKE) distclean rm -f aclocal.m4 compile config.sub config.guess depcomp install-sh \ ltmain.sh missing rm -f configure Makefile.in man/Makefile.in src/Makefile.in rm -f src/acconfig.h.in - rm -f debian/ceph-base.ceph.init debian/radosgw.init debian/ceph.logrotate debian/radosgw.logrotate + rm -f debian/ceph-base.ceph.init debian/radosgw.init debian/ceph.logrotate - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - $(MAKE) DESTDIR=$(DESTDIR) install +override_dh_auto_install: + dh_auto_install --destdir=$(DESTDIR) install -D -m 644 udev/50-rbd.rules $(DESTDIR)/lib/udev/rules.d/50-rbd.rules install -D -m 644 udev/95-ceph-osd.rules $(DESTDIR)/lib/udev/rules.d/95-ceph-osd.rules install -D -m 644 src/etc-rbdmap $(DESTDIR)/etc/ceph/rbdmap install -D -m 755 src/init-rbdmap $(DESTDIR)/etc/init.d/rbdmap -# Add here commands to install the package into debian/testpack. -# Build architecture-independent files here. -binary-indep: build install - dh_testdir - dh_testroot - jh_installlibs -v -i - jh_depends -i - dh_installchangelogs -i - dh_installdocs -i --all ChangeLog - dh_installexamples -i - dh_install -i --sourcedir=$(DESTDIR) --list-missing - dh_installman -i - dh_lintian -i - dh_link -i - dh_compress -i - dh_fixperms -i - dh_python2 -i - dh_installdeb -i - dh_gencontrol -i - dh_md5sums -i - dh_builddeb -i - -# We have nothing to do by default. -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs -a +# doc/changelog is a directory, which confuses dh_installchangelogs +override_dh_installchangelogs: + dh_installchangelogs --exclude doc/changelog + +override_dh_installdocs: dh_installdocs -a --all ChangeLog - dh_installexamples -a - dh_install -a --sourcedir=$(DESTDIR) --list-missing - install -d -m0755 debian/ceph-base/etc/logrotate.d - install -m0644 debian/ceph.logrotate debian/ceph-base/etc/logrotate.d +override_dh_installlogrotate: + dh_installlogrotate -pceph-base --name ceph + +override_dh_installinit: # dh_installinit is only set up to handle one upstart script # per package, so do this ourselves install -d -m0755 debian/ceph-base/etc/init @@ -172,15 +115,13 @@ binary-arch: build install sed -i s./etc/sysconfig/./etc/default/.g debian/rbd-mirror/lib/systemd/system/ceph-rbd-mirror@.service install -m0644 systemd/ceph-rbd-mirror.target debian/rbd-mirror/lib/systemd/system - dh_systemd_enable dh_installinit -p ceph-base --name ceph --no-start dh_installinit -p radosgw --no-start - dh_systemd_start --no-restart-on-upgrade - dh_installman -a - dh_lintian -a - dh_link -a +override_dh_systemd_start: + dh_systemd_start --no-restart-on-upgrade +override_dh_strip: dh_strip -pceph-mds --dbg-package=ceph-mds-dbg dh_strip -pceph-mon --dbg-package=ceph-mon-dbg dh_strip -pceph-osd --dbg-package=ceph-osd-dbg @@ -198,15 +139,10 @@ binary-arch: build install dh_strip -pradosgw --dbg-package=radosgw-dbg dh_strip -pceph-test --dbg-package=ceph-test-dbg - dh_compress -a - dh_fixperms -a - dh_makeshlibs -a - dh_python2 -a - dh_installdeb -a +override_dh_shlibdeps: dh_shlibdeps -a --exclude=erasure-code --exclude=rados-classes --exclude=compressor - dh_gencontrol -a - dh_md5sums -a - dh_builddeb -a -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure +# do not run tests +override_dh_auto_test: + +.PHONY: override_dh_autoreconf override_dh_auto_configure override_dh_auto_build override_dh_auto_clean override_dh_auto_install override_dh_installdocs override_dh_installlogrotate override_dh_installinit override_dh_systemd_start override_dh_strip override_dh_auto_test