github.com/confluentinc/cli@v1.100.0/debian/confluent-cli.spec.in (about)

     1  Summary: Command Line Interface for managing Confluent Platform
     2  Name: confluent-cli
     3  Version: ##RPMVERSION##
     4  Release: ##RPMRELEASE##
     5  Group: Applications/Internet
     6  License: Confluent License Agreement
     7  Source0: confluent-cli-%{version}.tar.gz
     8  URL: http://confluent.io
     9  BuildRoot: %{_tmppath}/%{name}-%{version}-root
    10  Vendor: Confluent, Inc.
    11  Packager: Confluent Packaging <packages@confluent.io>
    12  BuildArch: noarch
    13  
    14  Requires: confluent-rest-utils
    15  
    16  %description
    17  You can use the Confluent command line interface (CLI) to manage Confluent Platform, including RBAC, secrets, and the ability to deploy a single-node Confluent Platform instance.
    18  
    19  %define __jar_repack %{nil}
    20  %define _binaries_in_noarch_packages_terminate_build 0
    21  
    22  %pre
    23  _group=confluent
    24  getent group $_group 2>&1 >/dev/null || groupadd -r $_group
    25  _user=cp-cli
    26  getent passwd $_user 2>&1 >/dev/null || useradd -r -g $_group --home-dir /tmp --no-create-home -s /sbin/nologin -c "Confluent CLI" $_user
    27  
    28  _permwarn=
    29  for dir in /var/log/confluent ; do
    30      if [ $dir = /var/log/confluent ]; then
    31          # Confluent log directory should be writable by group
    32          _perm="chown ${_user}:${_group} $dir && chmod u+wx,g+wx,o= $dir"
    33      else
    34          # Other dirs are only readable by group
    35          _perm="chown ${_user}:${_group} $dir && chmod u+wx,g+r,o= $dir"
    36      fi
    37  
    38      if [ ! -d $dir ]; then
    39          echo "Creating directory $dir with owner $_user:$_group"
    40          mkdir -p $dir
    41          eval $_perm
    42      else
    43          echo "Notice: Not creating existing directory $dir, ensure proper permissions for user $_user group $_group"
    44          _permwarn="${_permwarn}${_perm}\n"
    45      fi
    46  done
    47  
    48  if [ -n "$_permwarn" ]; then
    49      echo "Notice: If you are planning to use the provided systemd service units for"
    50      echo "Notice: confluent-cli, make sure that read-write permissions"
    51      echo "Notice: for user $_user and group $_group are set up according to the"
    52      echo "Notice: following commands:"
    53      /bin/echo -e "$_permwarn"
    54  fi
    55  
    56  %post
    57  
    58  %preun
    59  
    60  %postun
    61  
    62  %prep
    63  
    64  %setup
    65  
    66  %build
    67  
    68  %install
    69  # Clean out any previous builds not on slash
    70  [ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
    71  %{__mkdir_p} %{buildroot}
    72  %{__cp} -R * %{buildroot}
    73  # The spec file gets included, get rid of it
    74  %{__rm} %{buildroot}/confluent-cli.spec
    75  
    76  %files
    77  %defattr(-,root,root)
    78  /lib/systemd/system/
    79  /usr/bin/
    80  /usr/libexec/cli/
    81  %doc
    82  /usr/share/doc/cli/
    83  
    84  %clean
    85  #used to cleanup things outside the build area and possibly inside.
    86  [ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
    87  
    88  %changelog
    89  * Fri Jul 24 2020 Confluent Packaging <packages@confluent.io>
    90  - Initial import