m0n0lithic

ceph 0.48-argonaut debian/rules

Nov 19th, 2012
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.30 KB | None | 0 0
  1. #!/usr/bin/make -f
  2. # -*- makefile -*-
  3. export DH_VERBOSE=1
  4. export DESTDIR=$(CURDIR)/debian/tmp
  5.  
  6. ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
  7.   NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
  8.   MAKEFLAGS += -j$(NUMJOBS)
  9. endif
  10.  
  11. export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
  12. export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
  13.  
  14. # Recommended snippet for Autoconf 2.52 or later
  15. ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  16.   confflags += --build $(DEB_HOST_GNU_TYPE)
  17. else
  18.   confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
  19. endif
  20.  
  21. export DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
  22.  
  23. extraopts += --with-ocf --with-rest-bench --with-nss
  24.  
  25. ifeq ($(DEB_HOST_ARCH), armel)
  26.   # armel supports ARMv4t or above instructions sets.
  27.   # libatomic-ops is only usable with Ceph for ARMv6 or above.
  28.   extraopts += --without-libatomic-ops
  29. endif
  30.  
  31. ifneq ($(DEB_HOST_ARCH), i386)
  32. ifneq ($(DEB_HOST_ARCH), amd64)
  33.   # libgoogle-perftools-dev is only available on i386 and amd64
  34.   extraopts += --without-tcmalloc
  35. endif
  36. endif
  37.  
  38. ifeq ($(shell grep -c -E '^Build-Depends:(.*,)?[[:space:]]*libgoogle-perftools-dev([[:space:]]|,|$$)' debian/control),0)
  39.   # if Build-Deps have been edited to skip libgoogle-perftools-dev (as
  40.   # we do for Debian lenny), tell configure it's ok to not have
  41.   # tcmalloc.
  42.   extraopts += --without-tcmalloc
  43. endif
  44.  
  45. configure: configure-stamp
  46. configure-stamp:
  47.     dh_testdir
  48.     ./autogen.sh
  49.     ./configure --prefix=/usr --sbindir=/sbin --localstatedir=/var \
  50.       --sysconfdir=/etc $(extraopts) $(confflags)
  51.     touch $@
  52.  
  53. build-arch: build
  54. build-indep: build
  55.  
  56. build: build-stamp
  57. build-stamp: configure-stamp
  58.     dh_testdir
  59.  
  60.     $(MAKE)
  61.  
  62.     cp src/init-ceph debian/ceph.init
  63.     cp src/init-radosgw debian/radosgw.init
  64.     cp src/logrotate.conf debian/ceph.logrotate
  65.  
  66.     touch $@
  67.  
  68. clean:
  69.     dh_testdir
  70.     dh_testroot
  71.     rm -f build-stamp configure-stamp
  72.  
  73.     [ ! -f Makefile ] || $(MAKE) distclean
  74.     rm -f aclocal.m4 compile config.sub config.guess depcomp install-sh \
  75.       ltmain.sh missing
  76.     rm -f configure Makefile.in man/Makefile.in src/Makefile.in
  77.     rm -f src/acconfig.h.in
  78.     rm -f debian/ceph.init debian/radosgw.init debian/ceph.logrotate
  79.  
  80.     dh_clean
  81.  
  82. install: build
  83.     dh_testdir
  84.     dh_testroot
  85.     dh_clean -k
  86.     dh_installdirs
  87.  
  88.     $(MAKE) DESTDIR=$(DESTDIR) install
  89.     sed -i "/dependency_libs/ s/'.*'/''/" `find . -name '*.la'`
  90.     install -D -m 644 udev/50-rbd.rules $(DESTDIR)/lib/udev/rules.d/50-rbd.rules
  91.  
  92. # Add here commands to install the package into debian/testpack.
  93. # Build architecture-independent files here.
  94. binary-indep: build install
  95.  
  96. # We have nothing to do by default.
  97. # Build architecture-dependent files here.
  98. binary-arch: build install
  99.     dh_testdir
  100.     dh_testroot
  101.     dh_installchangelogs
  102.     dh_installdocs --all ChangeLog
  103.     dh_installexamples
  104.     dh_install --sourcedir=$(DESTDIR) --list-missing
  105.     dh_installlogrotate
  106.     dh_installinit --no-start
  107.     # dh_installinit is only set up to handle one upstart script
  108.     # per package, so do this ourselves
  109.     install -d -m0755 debian/ceph/etc/init
  110.     install -m0644 src/upstart/ceph*.conf debian/ceph/etc/init
  111.     install -d -m0755 debian/radosgw/etc/init
  112.     install -m0644 src/upstart/radosgw*.conf debian/radosgw/etc/init
  113.     dh_installman
  114.     dh_lintian
  115.     dh_link
  116.  
  117.     dh_strip -pceph --dbg-package=ceph-dbg -k --exclude=libcls_
  118.     dh_strip -pceph-mds --dbg-package=ceph-mds-dbg
  119.     dh_strip -pceph-fuse --dbg-package=ceph-fuse-dbg
  120.     dh_strip -pceph-common --dbg-package=ceph-common-dbg
  121.     dh_strip -pceph-fs-common --dbg-package=ceph-fs-common-dbg
  122.     dh_strip -plibrados2 --dbg-package=librados2-dbg
  123.     dh_strip -plibrbd1 --dbg-package=librbd1-dbg
  124.     dh_strip -plibcephfs1 --dbg-package=libcephfs1-dbg
  125.     dh_strip -pradosgw --dbg-package=radosgw-dbg
  126.     dh_strip -prest-bench --dbg-package=rest-bench-dbg
  127.  
  128.     dh_compress
  129.     dh_fixperms
  130.     dh_makeshlibs -n  # we do the postinst/postrm scripts manually
  131.     dh_python2
  132.     dh_installdeb
  133.     dh_shlibdeps
  134.     dh_gencontrol
  135.     dh_md5sums
  136.     dh_builddeb
  137.  
  138. binary: binary-indep binary-arch
  139. .PHONY: build clean binary-indep binary-arch binary install configure
Advertisement
Add Comment
Please, Sign In to add comment