diff --git a/Makefile b/Makefile index 5d96f96..36bd170 100644 --- a/Makefile +++ b/Makefile @@ -178,28 +178,42 @@ $(MPITSTDIR)/% : test/mpi/%.cu $(TSTDEP) #### PACKAGING #### -DEB_GEN_IN := $(shell ls debian/*.in) -DEB_GEN := $(DEB_GEN_IN:.in=) +DEBIANDIR := $(BUILDDIR)/debian + +DEBGEN_IN := $(shell (cd debian ; ls *.in)) +DEBGEN := $(DEBGEN_IN:.in=) +DEBFILES := compat copyright libnccl-dev.install libnccl-dev.manpages nccl.7 rules $(DEBGEN) +DEBTARGETS := $(patsubst %, $(DEBIANDIR)/%, $(DEBFILES)) DEB_REVISION ?= 1 DEB_TIMESTAMP := $(shell date -R) +DEB_ARCH ?= amd64 -deb : lib $(DEB_GEN) +debian : $(DEBTARGETS) + +deb : lib debian @printf "Building Debian package\n" - debuild -eBUILDDIR -eLD_LIBRARY_PATH -uc -us -d -b + (cd $(BUILDDIR); debuild -eLD_LIBRARY_PATH -uc -us -d -b) mkdir -p $(BUILDDIR)/deb/ - mv ../libnccl*.deb $(BUILDDIR)/deb/ + mv $(BUILDDIR)/../libnccl*.deb $(BUILDDIR)/deb/ debclean : - rm -f $(DEB_GEN) + rm -Rf $(DEBIANDIR) -debian/% : debian/%.in +$(DEBIANDIR)/% : debian/%.in @printf "Generating %-25s > %-24s\n" $< $@ sed -e "s/\$${nccl:Major}/$(NCCL_MAJOR)/g" \ -e "s/\$${nccl:Minor}/$(NCCL_MINOR)/g" \ -e "s/\$${nccl:Patch}/$(NCCL_PATCH)/g" \ -e "s/\$${cuda:Major}/$(CUDA_MAJOR)/g" \ -e "s/\$${cuda:Minor}/$(CUDA_MINOR)/g" \ - -e "s/\$${nccl:Debian}/$(DEB_REVISION)/g" \ - -e "s/\$${nccl:Timestamp}/$(DEB_TIMESTAMP)/g" \ + -e "s/\$${deb:Revision}/$(DEB_REVISION)/g" \ + -e "s/\$${deb:Timestamp}/$(DEB_TIMESTAMP)/g" \ + -e "s/\$${deb:Arch}/$(DEB_ARCH)/g" \ $< > $@ + +$(DEBIANDIR)/% : debian/% + @printf "Grabbing %-25s > %-25s\n" $< $@ + mkdir -p $(DEBIANDIR) + cp -f $< $@ + diff --git a/debian/changelog.in b/debian/changelog.in index 76ecfd1..ad569a0 100644 --- a/debian/changelog.in +++ b/debian/changelog.in @@ -1,5 +1,5 @@ -nccl (${nccl:Major}.${nccl:Minor}.${nccl:Patch}-${nccl:Debian}+cuda${cuda:Major}.${cuda:Minor}) trusty; urgency=medium +nccl (${nccl:Major}.${nccl:Minor}.${nccl:Patch}-${deb:Revision}+cuda${cuda:Major}.${cuda:Minor}) trusty; urgency=medium * Automatic Debian package from build - -- cudatools ${nccl:Timestamp} + -- cudatools ${deb:Timestamp} diff --git a/debian/control.in b/debian/control.in index edfc0ff..e5ca48e 100644 --- a/debian/control.in +++ b/debian/control.in @@ -7,7 +7,7 @@ Standards-Version: 3.9.5 Package: libnccl${nccl:Major} Section: libs -Architecture: amd64 +Architecture: ${deb:Arch} Depends: ${misc:Depends}, ${shlibs:Depends} Description: NVIDIA Collectives Communication Library (NCCL) Runtime NCCL (pronounced "Nickel") is a stand-alone library of standard collective @@ -18,7 +18,7 @@ Description: NVIDIA Collectives Communication Library (NCCL) Runtime Package: libnccl-dev Section: libdevel -Architecture: amd64 +Architecture: ${deb:Arch} Depends: ${misc:Depends}, ${shlibs:Depends}, libnccl${nccl:Major} (= ${binary:Version}) Description: NVIDIA Collectives Communication Library (NCCL) Development Files NCCL (pronounced "Nickel") is a stand-alone library of standard collective