Print this page
NEX-9559 remove nza-closed cruft
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
Reviewed by: Steve Peng <steve.peng@nexenta.com>
NEX-5206 pkg should use the adjunct for dependency resolution
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
NEX-3128 remove dependency on sysidtool
Reviewed by: Gordon Ross <gwr@nexenta.com>
Reviewed by: Jean McCormack <jean.mccormack@nexenta.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
NEX-3127 nza-kernel can't be built with fresh perl versions
Reviewed by: Gordon Ross <gwr@nexenta.com>
Reviewed by: Jean McCormack <jean.mccormack@nexenta.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
NEX-3124 Disable IPP printing like SMB printing can be disabled
Reviewed by: Gordon Ross <gwr@nexenta.com>
Reviewed by: Jean McCormack <jean.mccormack@nexenta.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
NEX-1666 More maintainable ips2deb
4463 NLM fails wrongly on clnt_control().
Reviewed by: Marcel Telka <marcel@telka.sk>
Reviewed by: Jason King <jason.brian.king@gmail.com>
Approved by: Garrett D'Amore <garrett@damore.org>
4413 repository-metadata target should use "pkgrepo refresh" instead of "pkg.depotd"
Reviewed by: Gordon Ross <gordon.w.ross@gmail.com>
Reviewed by: Alexander Pyhalov <alp@rsu.ru>
Reviewed by: Richard PALO <richard.palo@free.fr>
Approved by: Richard Lowe <richlowe@richlowe.net>
re #13842 make clobber leaves trash
re #13468 rb4431 ACPI CA could be less verbose in release builds
re #12731 rb4460 Integrate ISA-L kernel module into nza-closed
Adding AoE support to nza-kernel

Split Close
Expand all
Collapse all
          --- old/usr/src/pkg/Makefile
          +++ new/usr/src/pkg/Makefile
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14  # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15  # If applicable, add the following below this CDDL HEADER, with the
  16   16  # fields enclosed by brackets "[]" replaced with your own identifying
  17   17  # information: Portions Copyright [yyyy] [name of copyright owner]
  18   18  #
  19   19  # CDDL HEADER END
  20   20  #
  21   21  
  22   22  #
  23   23  # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
       24 +# Copyright 2014 Nexenta Systems, Inc. All rights reserved.
  24   25  # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
  25   26  # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
  26   27  #
  27   28  
  28   29  include $(SRC)/Makefile.master
  29   30  include $(SRC)/Makefile.buildnum
  30   31  
  31   32  #
  32   33  # Make sure we're getting a consistent execution environment for the
  33   34  # embedded scripts.
↓ open down ↓ 201 lines elided ↑ open up ↑
 235  236  #
 236  237  # Track the synthetic manifests separately so we can properly express
 237  238  # build rules and dependencies.  The synthetic and real packages use
 238  239  # different sets of transforms and macros for pkgmogrify.
 239  240  #
 240  241  SYNTH_PKGS= osnet-incorporation osnet-redist
 241  242  DEP_SYNTH_PKGS= $(SYNTH_PKGS:%=$(PDIR)/%.dep)
 242  243  PROC_SYNTH_PKGS= $(SYNTH_PKGS:%=$(PDIR)/%.mog)
 243  244  
 244  245  #
 245      -# Root of pkg image to use for dependency resolution
 246      -# Normally / on the machine used to build the binaries
      246 +# Root of pkg image to use for dependency resolution Normally / on the machine
      247 +# used to build the binaries, or the ADJUNCT_PROTO
 247  248  #
 248      -PKGDEP_RESOLVE_IMAGE = /
      249 +PKG_ADJUNCT.cmd= AP=$${ADJUNCT_PROTO:-/}; if [[ -d $${AP}/var/pkg ]]; then \
      250 +                echo $$AP; \
      251 +        else    \
      252 +                echo /; \
      253 +        fi
 249  254  
      255 +PKGDEP_RESOLVE_IMAGE = $(PKG_ADJUNCT.cmd:sh)
      256 +
 250  257  #
 251  258  # For each package, we determine the target repository based on
 252  259  # manifest-embedded metadata.  Because we make that determination on
 253  260  # the fly, the publication target cannot be expressed as a
 254  261  # subdirectory inside the unknown-by-the-makefile target repository.
 255  262  #
 256  263  # In order to limit the target set to real files in known locations,
 257  264  # we use a ".pub" file in $(PDIR) for each processed manifest, regardless
 258  265  # of content or target repository.
 259  266  #
↓ open down ↓ 93 lines elided ↑ open up ↑
 353  360  # create-repository                     |
 354  361  #                |              generated dependencies
 355  362  #        repo directories               |
 356  363  #                                       | pkgdepend
 357  364  #                                       |
 358  365  #                               processed manifests
 359  366  # 
 360  367  
 361  368  ALL_TARGETS= $(PROC_SYNTH_PKGS) proto_list_$(PKGMACH)
 362  369  
      370 +# This may be empty, or set to "ips", or "deb"
      371 +PKGTYPE=ips
      372 +include Makefile.$(PKGTYPE)
      373 +
 363  374  all: $(ALL_TARGETS)
 364  375  
 365  376  #
 366  377  # This will build the directory to contain the processed manifests
 367  378  # and the metadata symlinks.
 368  379  #
 369  380  $(PDIR):
 370  381          @print "Creating $(@)"
 371  382          $(PKGDEBUG)$(INS.dir)
 372  383  
↓ open down ↓ 5 lines elided ↑ open up ↑
 378  389  # with an error.
 379  390  #
 380  391  $(PDIR)/gendeps: $(DEP_SYNTH_PKGS) $(DEP_PKGS)
 381  392          -$(PKGDEBUG)if [ "$(SUPPRESSPKGDEP)" = "true" ]; then \
 382  393                  print "Suppressing dependency resolution"; \
 383  394                  for p in $(DEP_PKGS:%.dep=%); do \
 384  395                          $(CP) $$p.dep $$p.res; \
 385  396                  done; \
 386  397          else \
 387  398                  print "Resolving dependencies"; \
 388      -                pkgdepend -R $(PKGDEP_RESOLVE_IMAGE) resolve \
 389      -                    -m $(DEP_SYNTH_PKGS) $(DEP_PKGS); \
      399 +                pkgdepend $(PKGDEP_FLAGS) resolve \
      400 +                    $(PKGRES_FLAGS) $(DEP_SYNTH_PKGS) $(DEP_PKGS); \
 390  401                  for p in $(DEP_SYNTH_PKGS:%.dep=%) $(DEP_PKGS:%.dep=%); do \
 391  402                          if [ "$$(print $$p.metadata.*)" = \
 392  403                               "$$(print $$p.metadata.noincorp.*)" ]; \
 393  404                          then \
 394  405                                  print "Removing dependency versions from $$p"; \
 395  406                                  $(PKGMOGRIFY) $(PKGMOG_VERBOSE) \
 396  407                                      -O $$p.res -I transforms \
 397  408                                      strip_versions $$p.dep.res; \
 398  409                                  $(RM) $$p.dep.res; \
 399  410                          else \
 400  411                                  $(MV) $$p.dep.res $$p.res; \
 401  412                          fi; \
 402  413                  done; \
 403  414          fi
 404  415          $(PKGDEBUG)$(TOUCH) $(@)
 405  416  
 406      -install: $(ALL_TARGETS) repository-metadata
 407      -
 408      -repository-metadata: publish_pkgs
 409      -        $(PKGDEBUG)for r in $(REPOS); do \
 410      -                pkgrepo refresh -s $(PKGDEST)/repo.$$r; \
 411      -        done
 412      -
 413  417  #
 414      -# Since we create zero-length processed manifests for a graceful abort
 415      -# from pkgmogrify, we need to detect that here and make no effort to
 416      -# publish the package.
 417      -#
 418      -# For all other packages, we publish them regardless of status.  We
 419      -# derive the target repository as a component of the metadata-derived
 420      -# symlink for each package.
 421      -#
 422      -publish_pkgs: $(REPOS:%=$(PKGDEST)/repo.%) $(PDIR)/gendeps .WAIT $(PUB_PKGS)
 423      -
 424      -#
 425      -# Before publishing, we want to pull the license files from $CODEMGR_WS
 426      -# into the proto area.  This allows us to NOT pass $SRC (or
 427      -# $CODEMGR_WS) as a basedir for publication.
 428      -#
 429      -$(PUB_PKGS): stage-licenses
 430      -
 431      -#
 432      -# Initialize the empty on-disk repositories
 433      -#
 434      -$(REPOS:%=$(PKGDEST)/repo.%):
 435      -        @print "Initializing $(@F)"
 436      -        $(PKGDEBUG)$(INS.dir)
 437      -        $(PKGDEBUG)pkgsend -s file://$(@) create-repository \
 438      -                --set-property publisher.prefix=$(PKGPUBLISHER)
 439      -
 440      -#
 441  418  # rule to process real manifests
 442  419  #
 443  420  # To allow redistributability and package status to change, we must
 444  421  # remove not only the actual build target (the processed manifest), but
 445  422  # also the incidental ones (the metadata-derived symlinks).
 446  423  #
 447  424  # If pkgmogrify exits cleanly but fails to create the specified output
 448  425  # file, it means that it encountered an abort directive.  That means
 449  426  # that this package should not be published for this particular build
 450  427  # environment.  Since we can't prune such packages from $(PKGS)
↓ open down ↓ 40 lines elided ↑ open up ↑
 491  468  #   every time it encounters it as a dependency.  Hence the "touch"
 492  469  #   statement to ensure that the target is created, even when
 493  470  #   pkgmogrify encounters an abort in the publish transforms.
 494  471  #
 495  472  
 496  473  .SUFFIXES: .mf .mog .dep .res .pub
 497  474  
 498  475  $(PDIR)/%.mog: manifests/%.mf
 499  476          @print "Processing manifest $(<F)"
 500  477          @env PKGFMT_OUTPUT=v1 pkgfmt -c $<
 501      -        $(PKGDEBUG)$(RM) $(@) $(@:%.mog=%) $(@:%.mog=%.nodepend) \
      478 +        $(PKGDEBUG)$(RM) -r $(@) $(@:%.mog=%) $(@:%.mog=%.nodepend) \
 502  479                  $(@:%.mog=%.lics) $(PDIR)/$(@F:%.mog=%).metadata.* $(@).vars
 503  480          $(PKGDEBUG)$(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) \
 504  481                  $(PKGMOG_DEFINES:%=-D %) -P $(@).vars -O $(@) \
 505  482                  $(<) $(PM_TRANSFORMS)
 506  483          $(PKGDEBUG)eval REPO=redist PKGSTAT=current NODEPEND=$(SUPPRESSPKGDEP) \
 507  484                  `$(CAT) -s $(@).vars`; \
 508  485          if [ -f $(@) ]; then \
 509  486                  if [ "$$NODEPEND" != "false" ]; then \
 510  487                           $(TOUCH) $(@:%.mog=%.nodepend); \
 511  488                  fi; \
↓ open down ↓ 13 lines elided ↑ open up ↑
 525  502          @print "Generating dependencies for $(<F)"
 526  503          $(PKGDEBUG)$(RM) $(@)
 527  504          $(PKGDEBUG)if [ ! -f $(@:%.dep=%.nodepend) ]; then \
 528  505                  pkgdepend generate -m $(PKGDEP_TOKENS:%=-D %) $(<) \
 529  506                          $(PKGROOT) > $(@); \
 530  507          else \
 531  508                  $(CP) $(<) $(@); \
 532  509          fi
 533  510  
 534  511  #
 535      -# The full chain implies that there should be a .dep.res suffix rule,
 536      -# but dependency generation is done on a set of manifests, rather than
 537      -# on a per-manifest basis.  Instead, see the gendeps rule above.
 538      -#
 539      -
 540      -$(PDIR)/%.pub: $(PDIR)/%.res
 541      -        $(PKGDEBUG)m=$$(basename $(@:%.pub=%).metadata.*); \
 542      -        r=$${m#$(@F:%.pub=%.metadata.)+(?).}; \
 543      -        if [ -s $(<) ]; then \
 544      -                print "Publishing $(@F:%.pub=%) to $$r repository"; \
 545      -                pkgsend -s file://$(PKGDEST)/repo.$$r publish \
 546      -                    -d $(PKGROOT) -d $(TOOLSROOT) \
 547      -                    -d license_files -d $(PKGROOT)/licenses \
 548      -                    --fmri-in-manifest --no-index --no-catalog $(<) \
 549      -                    > /dev/null; \
 550      -        fi; \
 551      -        $(TOUCH) $(@);
 552      -
 553      -#
 554  512  # rule to build the synthetic manifests
 555  513  #
 556  514  # This rule necessarily has PKGDEP_TYPE that changes according to
 557  515  # the specific synthetic manifest.  Rather than escape command
 558  516  # dependency checking for the real manifest processing, or failing to
 559  517  # express the (indirect) dependency of synthetic manifests on real
 560  518  # manifests, we simply split this rule out from the one above.
 561  519  #
 562  520  # The implementation notes from the previous rule are applicable
 563  521  # here, too.
↓ open down ↓ 137 lines elided ↑ open up ↑
 701  659  # When processing a manifest, use the basename (without extension) of
 702  660  # the package.  When publishing, use the basename with a ".pub"
 703  661  # extension.
 704  662  #
 705  663  # Other than during manifest development, the preferred usage is to
 706  664  # avoid these targets and override PKGS on the make command line and
 707  665  # use the provided all and install targets.
 708  666  #
 709  667  $(PKGS) $(SYNTH_PKGS): $(PDIR)/$$(@:%=%.mog)
 710  668  
 711      -$(PKGS:%=%.pub) $(SYNTH_PKGS:%=%.pub): $(PDIR)/$$(@)
 712  669  
 713  670  #
 714  671  # This is a convenience target to resolve dependencies without publishing
 715  672  # packages.
 716  673  #
 717  674  gendeps: $(PDIR)/gendeps
 718  675  
 719  676  #
 720  677  # These are convenience targets for cross-platform packaging.  If you
 721  678  # want to build any of "the normal" targets for a different
↓ open down ↓ 11 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX