1 #
   2 # This file and its contents are supplied under the terms of the
   3 # Common Development and Distribution License ("CDDL"), version 1.0.
   4 # You may only use this file in accordance with the terms of version
   5 # 1.0 of the CDDL.
   6 #
   7 # A full copy of the text of the CDDL should have accompanied this
   8 # source.  A copy of the CDDL is also available via the Internet at
   9 # http://www.illumos.org/license/CDDL.
  10 #
  11 
  12 # Copyright (c) 2014, Nexenta Systems, Inc. All rights reserved.
  13 
  14 PKGDEP_FLAGS=
  15 PKGRES_FLAGS=-mvS
  16 
  17 DEB_MAINTAINER= "Nexenta Systems <maintainer@nexenta.com>"
  18 DEB_VERSION= 40-0-0
  19 
  20 $(NOT_RELEASE_BUILD)DEB_DEBUG= d
  21 $(RELEASE_BUILD)DEB_DEBUG=
  22 
  23 IPS2DEB= $(ONBLD_TOOLS)/bin/ips2deb
  24 
  25 # No source packages, no signing
  26 DPKG_BUILD_FLAGS= -b -us -uc
  27 
  28 # APT repository
  29 APTDIR= $(PKGDEST)/apt
  30 
  31 PKGNAMES= $(PROC_PKGS:%.mog=%)
  32 PKGRES= $(PKGNAMES:%=-p%.res)
  33 PKGDEP= $(PKGNAMES:%=%.dep)
  34 PKGBLD= $(PKGNAMES:%=%.deb)
  35 
  36 install: $(ALL_TARGETS) debres
  37 
  38 debres: $(PKGBLD) $(APTDIR)/conf/distributions
  39         for p in $(PDIR)/*.deb; do \
  40                 echo "processing $$p"; \
  41                 /usr/bin/reprepro -b $(APTDIR) includedeb nza-kernel $$p ; \
  42         done
  43         /usr/bin/reprepro -b $(APTDIR) export
  44         touch $@
  45 
  46 $(PKGBLD): convert
  47         d=$(@F:%.deb=%) ; \
  48         if [ -d "$(PDIR)/$$d" ]; then \
  49                 echo "Building pkg: $$d" ; cd "$(PDIR)/$$d" ; \
  50                 PATH=/usr/gnu/bin:/usr/bin:$(GCC_ROOT)/bin:$$PATH \
  51                     fakeroot dpkg-buildpackage $(DPKG_BUILD_FLAGS) ; \
  52         fi
  53 
  54 .PARALLEL: $(PKGBLD)
  55 
  56 convert: $(PDIR) gendeps
  57         # The following is a crude hack to make sure SUNWcsd has no dependencies.
  58         # This is needed to make the apt-clone and onu-deb upgrade procedures work,
  59         # although the right(TM) fix would be in our handling of name_to_major and
  60         # minor_perm in the postinst/prerm scripts created by ips2deb.
  61         cp $(PDIR)/SUNWcsd.mog $(PDIR)/SUNWcsd.res
  62         $(IPS2DEB) -v $(PKGRES) -d $(PKGROOT) -d $(TOOLSROOT) -o $(PDIR) \
  63                 --mfg $(PDIR) --mfe res --maintainer $(DEB_MAINTAINER) \
  64                 --pv $(DEB_VERSION)$(DEB_DEBUG) -s "illumos"
  65 
  66 
  67 $(APTDIR)/conf:
  68         $(INS.dir)
  69 
  70 $(APTDIR)/conf/%: $(APTDIR)/conf
  71         rm -f $@
  72         echo "Origin: Kernel APT" >> $@
  73         echo "Codename: nza-kernel" >> $@
  74         echo "Architectures: solaris-i386" >> $@
  75         echo "Components: main" >> $@
  76         echo "DebIndices: Packages Release . .gz .bz2" >> $@
  77         echo "Description: Kernel repository" >> $@