kind: manual
depends:
- erlang.bst
- unmaintained/django.bst
- unmaintained/xstatic.bst
- openstack-clients.bst
- unmaintained/test-tools.bst
- python-tools.bst
sources:
- kind: git
  url: upstream:open-iscsi
  track: master
  ref: 8da14e6f9eeeb4fd03938d40fe1126fe0d110b68
config:
  build-commands:
  - make
  install-commands:
  - make prefix="%{prefix}" exec_prefix="%{prefix}" DESTDIR="%{install-root}" install
  - make prefix="%{prefix}" exec_prefix="%{prefix}" DESTDIR="%{install-root}" PROGRAMS="usr/iscsistart"
    install
  - |
    sed -i -e "s|iscsid.startup = \/sbin\/iscsid|iscsid.startup = "%{prefix}"/sbin/iscsid|" \
              etc/iscsid.conf
  - sed -i -e 's|node.startup = manual|node.startup = automatic|' etc/iscsid.conf
  - install -D -m 644 etc/iscsid.conf "%{install-root}"/etc/iscsi
  - |
    install -D -m 644 /proc/self/fd/0 << 'EOF' "%{install-root}%{prefix}"/lib/systemd/system/iscsid.service
    [Unit]
    Description=Open iSCSI Daemon
    After=network.target

    [Service]
    Type=forking
    ExecStart=/usr/sbin/iscsid

    [Install]
    WantedBy=multi-user.target
    EOF
  - |
    install -D -m 644 /proc/self/fd/0 << 'EOF' "%{install-root}%{prefix}"/lib/systemd/system/iscsid.socket
    [Unit]
    Description=Open-iSCSI iscsid Socket

    [Socket]
    ListenStream=@ISCSIADM_ABSTRACT_NAMESPACE

    [Install]
    WantedBy=sockets.target
    EOF
