kind: manual

sources:
- kind: git
  url: baserock:baserock/fhs-dirs
  track: baserock/usr_merge
  ref: 9fafca436000bb57ddd5c498f8a75ea7b274f6c5

depends:
- filename: gnu-toolchain/stage2.bst
  type: build

environment:
  PATH: /usr/bin:/bin:/usr/sbin:/sbin:/tools/bin:/tools/sbin

config:
  install-commands:
  - sh ./create-fhs-dirs "%{install-root}"
  - install -m 644 passwd "%{install-root}/etc/passwd"
  - install -m 600 shadow "%{install-root}/etc/shadow"
  - install -m 644 interfaces "%{install-root}/etc/network/interfaces"
  - install -m 644 group "%{install-root}/etc/group"
  - install -m 644 issue "%{install-root}/etc/issue"
  - install -m 644 services "%{install-root}/etc/services"
  - install -m 644 protocols "%{install-root}/etc/protocols"
  - echo baserock > "%{install-root}/etc/hostname"

  # Most 64 bit architectures need a /lib64 symlink as well as /lib.
  # FIXME: the create-fhs-dirs script should probably handle this...
  (?):
    - arch in ["armv8b64", "armv8l64", "ppc64l", "ppc64b", "x86_64"]:
        install-commands:
          (>):
          - mkdir -p "%{install-root}/usr/lib64"
          - ln -s  "./usr/lib64" "%{install-root}/lib64"

  strip-commands:
  - |
    %{stage3-strip-binaries}
