github.com/skf/moby@v1.13.1/hack/make/.build-deb/rules (about)

     1  #!/usr/bin/make -f
     2  
     3  VERSION = $(shell cat VERSION)
     4  SYSTEMD_VERSION := $(shell dpkg-query -W -f='$${Version}\n' systemd | cut -d- -f1)
     5  SYSTEMD_GT_227 := $(shell [ '$(SYSTEMD_VERSION)' ] && [ '$(SYSTEMD_VERSION)' -gt 227 ] && echo true )
     6  
     7  override_dh_gencontrol:
     8  	# if we're on Ubuntu, we need to Recommends: apparmor
     9  	echo 'apparmor:Recommends=$(shell dpkg-vendor --is Ubuntu && echo apparmor)' >> debian/docker-engine.substvars
    10  	dh_gencontrol
    11  
    12  override_dh_auto_build:
    13  	./hack/make.sh dynbinary
    14  	# ./man/md2man-all.sh runs outside the build container (if at all), since we don't have go-md2man here
    15  
    16  override_dh_auto_test:
    17  	./bundles/$(VERSION)/dynbinary-daemon/dockerd -v
    18  	./bundles/$(VERSION)/dynbinary-client/docker -v
    19  
    20  override_dh_strip:
    21  	# Go has lots of problems with stripping, so just don't
    22  
    23  override_dh_auto_install:
    24  	mkdir -p debian/docker-engine/usr/bin
    25  	cp -aT "$$(readlink -f bundles/$(VERSION)/dynbinary-client/docker)" debian/docker-engine/usr/bin/docker
    26  	cp -aT "$$(readlink -f bundles/$(VERSION)/dynbinary-daemon/dockerd)" debian/docker-engine/usr/bin/dockerd
    27  	cp -aT /usr/local/bin/docker-proxy debian/docker-engine/usr/bin/docker-proxy
    28  	cp -aT /usr/local/bin/docker-containerd debian/docker-engine/usr/bin/docker-containerd
    29  	cp -aT /usr/local/bin/docker-containerd-shim debian/docker-engine/usr/bin/docker-containerd-shim
    30  	cp -aT /usr/local/bin/docker-containerd-ctr debian/docker-engine/usr/bin/docker-containerd-ctr
    31  	cp -aT /usr/local/bin/docker-runc debian/docker-engine/usr/bin/docker-runc
    32  	cp -aT /usr/local/bin/docker-init debian/docker-engine/usr/bin/docker-init
    33  	mkdir -p debian/docker-engine/usr/lib/docker
    34  
    35  override_dh_installinit:
    36  	# use "docker" as our service name, not "docker-engine"
    37  	dh_installinit --name=docker
    38  ifeq (true, $(SYSTEMD_GT_227))
    39  	$(warning "Setting TasksMax=infinity")
    40  	sed -i -- 's/#TasksMax=infinity/TasksMax=infinity/' debian/docker-engine/lib/systemd/system/docker.service
    41  endif
    42  
    43  override_dh_installudev:
    44  	# match our existing priority
    45  	dh_installudev --priority=z80
    46  
    47  override_dh_install:
    48  	dh_install
    49  	dh_apparmor --profile-name=docker-engine -pdocker-engine
    50  
    51  override_dh_shlibdeps:
    52  	dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
    53  
    54  %:
    55  	dh $@ --with=bash-completion $(shell command -v dh_systemd_enable > /dev/null 2>&1 && echo --with=systemd)