kind: manual

sources:
- kind: git
  url: upstream:glibc
  track: release/2.25/master
  ref: db0242e3023436757bbc7c488a779e6e3343db04

depends:
- filename: gnu-toolchain/stage2.bst
  type: build
- gnu-toolchain/fhs-dirs.bst
- gnu-toolchain/linux-api-headers.bst

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

config:

  configure-commands:
  - mkdir o

  - |
    case "%{bst-arch}" in
        armv7*)
            ARCH_FLAGS="--without-fp" ;;
    esac

    export CFLAGS="-O2 $CFLAGS";
    cd o && ../configure \
      $ARCH_FLAGS \
      --prefix="%{prefix}" \
      --disable-profile \
      --enable-kernel=3.0.0 \
      --without-cvs \
      --without-selinux \
      --enable-obsolete-rpc

  build-commands:
  - cd o && make localtime=UTC

  install-commands:
  - cd o && make install_root="%{install-root}" localtime=UTC install
  - cd o && make install_root="%{install-root}" localtime=UTC localedata/install-locales
  - mkdir -p "%{install-root}/etc"
  - mkdir -p "%{install-root}/etc/ld.so.conf.d"
  - |
    cat <<EOF > nsswitch.conf
    passwd: compat
    group: compat
    shadow: compat

    hosts: files myhostname mdns4_minimal [NOTFOUND=return] dns mdns4
    networks: files

    protocols: db files
    services: db files
    ethers: db files
    rpc: db files

    netgroup: nis
    EOF
  - install -m 644 -o root -g root nsswitch.conf "%{install-root}/etc/nsswitch.conf"
  - |
    cat <<EOF > ld.so.conf
    /lib
    /usr/lib
    /usr/local/lib
    include /etc/ld.so.conf.d/*.conf
    EOF
  - install -m 644 -o root -g root ld.so.conf "%{install-root}/etc/ld.so.conf"
