github.com/whamcloud/lemur@v0.0.0-20190827193804-4655df8a52af/packaging/rpm/lemur.spec (about)

     1  %global debug_package %{nil}
     2  %define pkg_prefix %{?PACKAGE_PREFIX}%{!?PACKAGE_PREFIX:lemur}
     3  %define plugin_dir %{?PLUGIN_DIR}%{!?PLUGIN_DIR:%{_libexecdir}/lhsmd}
     4  
     5  Name: %{pkg_prefix}-hsm-agent
     6  Version: %{?_gitver}%{!?_gitver:0.0.1}
     7  Release: %{?dist}%{!?dist:1}
     8  
     9  Vendor: Intel Corporation
    10  Source: %{pkg_prefix}-%{version}.tar.gz
    11  Source1: lhsmd.conf
    12  Source2: lhsmd.service
    13  License: GPLv2
    14  Summary: Lustre HSM Tools - Lustre HSM Agent
    15  BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
    16  
    17  BuildRequires: golang >= 1.6
    18  BuildRequires: pandoc
    19  Requires: lustre-client >= %{?MIN_LUSTRE_VERSION}%{?!MIN_LUSTRE_VERSION:2.6.0}
    20  %{?systemd_requires}
    21  
    22  %description
    23  The Lustre HSM Agent provides a backend-agnostic HSM Agent for brokering
    24  communications between a Lustre filesystem's HSM coordinator and
    25  backend-specific data movers.
    26  
    27  %package -n %{pkg_prefix}-data-movers
    28  Summary: Lustre HSM Tools - HSM Data Movers
    29  License: Apache
    30  Requires: %{pkg_prefix}-hsm-agent = %{version}
    31  
    32  %description -n %{pkg_prefix}-data-movers
    33  These data movers are designed to implement the Lustre HSM Agent's data
    34  movement protocol. When associated with an HSM archive number, a data
    35  mover fulfills data movement requests on behalf of the HSM Agent.
    36  
    37  # Links against liblustreapi.
    38  %package -n %{pkg_prefix}-testing
    39  Summary: Lustre HSM Tools - Testing Collateral
    40  License: GPLv2
    41  Requires: %{pkg_prefix}-hsm-agent = %{version} %{pkg_prefix}-data-movers = %{version}
    42  
    43  %description -n %{pkg_prefix}-testing
    44  Contains testing collateral for the product. Not intended for production
    45  installations.
    46  
    47  # TODO: This has to be GPL because it links against liblustreapi. Can we
    48  # fix that?
    49  %package -n lhsm
    50  Summary: Lustre HSM Tools - Data Movement Control
    51  License: GPLv2
    52  Requires: lustre-client >= %{?MIN_LUSTRE_VERSION}%{?!MIN_LUSTRE_VERSION:2.6.0}
    53  
    54  %description -n lhsm
    55  CLI for Lustre data movement control.
    56  
    57  %prep
    58  
    59  %setup -n %{pkg_prefix}-%{version}
    60  # ohhh myyyy...
    61  cd ..
    62  mkdir -p src/github.com/intel-hpdd
    63  mv %{pkg_prefix}-%{version} src/github.com/intel-hpdd/%{pkg_prefix}
    64  mkdir %{pkg_prefix}-%{version}
    65  mv src %{pkg_prefix}-%{version}
    66  
    67  %install
    68  export GOPATH=$PWD:$GOPATH
    69  cd src/github.com/intel-hpdd/%{pkg_prefix}
    70  %{__make} install PREFIX=%{buildroot}/%{_prefix}
    71  %{__make} install-example PREFIX=%{buildroot}/
    72  %{__make} uat-install PREFIX=%{buildroot}/%{_prefix} BUILDROOT=%{buildroot}/
    73  
    74  # move datamover plugins to plugin dir
    75  install -d %{buildroot}%{plugin_dir}
    76  for plugin in %{buildroot}/%{_bindir}/lhsm-plugin-*; do
    77      mv $plugin %{buildroot}/%{plugin_dir}/$(basename $plugin)
    78  done
    79  
    80  # move lhsmd to /sbin
    81  install -d %{buildroot}%{_sbindir}
    82  mv %{buildroot}/%{_bindir}/lhsmd %{buildroot}/%{_sbindir}
    83  
    84  %if 0%{?el6}
    85    install -m 700 -d %{buildroot}/%{_localstatedir}/run/lhsmd
    86    install -d %{buildroot}%{_sysconfdir}/init
    87    install -p -m 0644 %SOURCE1 %{buildroot}%{_sysconfdir}/init/lhsmd.conf
    88  %endif
    89  
    90  %if 0%{?el7}
    91    install -d %{buildroot}%{_unitdir}
    92    install -p -m 0644 %SOURCE2 %{buildroot}%{_unitdir}/lhsmd.service
    93  %endif
    94  
    95  %post
    96  %if 0%{?el7}
    97    %systemd_post lhsmd.service
    98  %endif
    99  
   100  %preun
   101  %if 0%{?el7}
   102    %systemd_preun lhsmd.service
   103  %endif
   104  
   105  %postun
   106  %if 0%{?el7}
   107    %systemd_postun_with_restart lhsmd.service
   108  %endif
   109  
   110  %files
   111  %defattr(-,root,root)
   112  %{_sbindir}/lhsmd
   113  %{_mandir}/man1/lhsmd.1.gz
   114  %{_sysconfdir}/lhsmd/agent.example
   115  %if 0%{?el6}
   116    %config %{_sysconfdir}/init/lhsmd.conf
   117    %{_localstatedir}/run/lhsmd
   118  %endif
   119  %if 0%{?el7}
   120    %{_unitdir}/lhsmd.service
   121  %endif
   122  
   123  %files -n %{pkg_prefix}-data-movers
   124  %defattr(-,root,root)
   125  %{plugin_dir}/lhsm-plugin-posix
   126  %{plugin_dir}/lhsm-plugin-s3
   127  %{_mandir}/man1/lhsm-plugin-s3.1.gz
   128  %{_mandir}/man1/lhsm-plugin-posix.1.gz
   129  %{_sysconfdir}/lhsmd/lhsm-plugin-posix.example
   130  %{_sysconfdir}/lhsmd/lhsm-plugin-s3.example
   131  
   132  %files -n %{pkg_prefix}-testing
   133  %defattr(-,root,root)
   134  %{plugin_dir}/lhsm-plugin-noop
   135  %{_libexecdir}/%{pkg_prefix}-testing/*.race
   136  %{_libexecdir}/%{pkg_prefix}-testing/%{pkg_prefix}-uat-runner
   137  %{_datarootdir}/%{pkg_prefix}/test/features/*.feature
   138  
   139  %files -n lhsm
   140  %defattr(-,root,root)
   141  %{_bindir}/lhsm