]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
debian/rules: package in a more debhelper way
authorKefu Chai <kchai@redhat.com>
Fri, 20 May 2016 15:45:20 +0000 (23:45 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 29 Jun 2016 08:12:24 +0000 (16:12 +0800)
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 <kchai@redhat.com>
debian/compat
debian/control
debian/rules

index 1e8b314962144c26d5e0e50fd29d2ca327864913..45a4fb75db864000d01701c0f7a51864bd4daabf 100644 (file)
@@ -1 +1 @@
-6
+8
index 0bc06810af2f4ffee647d882284636f81b279d68..14198f6b12a94fe54e03b548548aba3434cc2f5f 100644 (file)
@@ -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,
index 1213ee5ded19b16ef7af98eb746b2ab67d5def99..9995e971f86944abc33ad97b9ac11c5555af9eb9 100755 (executable)
@@ -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