Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ RPM Build process:

The RPM has a few options to take into consideration:

--define "strict_checks no".................turns strict checks off, the default has strict checking set to yes. This options only takes in: no, No, or NO. If you want strict checks on, don't define it. It's set on by default.
--define "alt_givedir /my/givedir/".........allows you to set your own givedir location. Default is set to /usr/givedir
--without strict_checks............disables strict checks. The default has strict checking set to enabled.
--define "give_dir /my/givedir/".........allows you to set your own givedir location. Default is set to /usr/give

***the directory you provide as DIR must exist, be owned by root, and be mode 0755. If those conditions aren't met 'give' will complain and quit.

Expand All @@ -49,15 +49,15 @@ The RPM has a few options to take into consideration:

build with non-strict checks only:

from a tar: rpmbuild -ta give-3.1-1.tgz --define "strict_checks no"
from a tar: rpmbuild -ta give-3.1-1.tgz --without strict_checks

from a spec: rpmbuild -ba path_to_spec_file/give.spec --define "strict_checks no"
from a spec: rpmbuild -ba path_to_spec_file/give.spec --without strict_checks

with both options:

from a tar: rpmbuild -ta give-3.1-1.tgz --define "alt_givedir /desired/givedir" --define "strict_checks no"
from a tar: rpmbuild -ta give-3.1-1.tgz --define "give_dir /desired/givedir"

from a spec: rpmbuild -ba path_to_spec_file/give.spec --define "alt_givedir /desired/givedir" --define "strict_checks no"
from a spec: rpmbuild -ba path_to_spec_file/give.spec --define "give_dir /desired/givedir"

===============================================================================================================================================================================================================

Expand Down
74 changes: 28 additions & 46 deletions give.spec
Original file line number Diff line number Diff line change
@@ -1,63 +1,43 @@
%define realname give
%define realversion 3.1-5
# add --without strict_checks option (default is enable strict checks)
%bcond_without strict_checks

#don't strip binaries
# The default behavior of rpmbuild, depending on your OS, often is to strip
# binaries after installation in order to reduce file size. The two macros
# defined below override that behavior and compresses the man and info pages
# for debugging purposes. For more information:
# https://www.redhat.com/archives/rpm-list/2001-November/msg00257.html
%define __os_install_post /usr/lib/rpm/brp-compress
%define debug_package %{nil}

Name: %{realname}-%{realversion}
Version: ptools
Release: 1
Name: give
Version: 3.1
Release: 6%{?dist}
Summary: lc file transfer utility
License: LLNL Internal
Group: System Environment/Base
Source0: %{realname}-%{realversion}.tgz
BuildRoot: %{_tmppath}/%{name}-buildroot
URL: https://www.git.lanl.gov/filesystems/give
Source0: https://github.com/hpc/%{name}/archive/v%{version}.tar.gz
URL: https://github.com/hpc/%{name}


######################################################################
%prep
%setup -n %{name}
%setup -n %{name}-%{version}

#Wonderful process to check for config options...wish there was an %elif for this!
#Checks to see if both defined, if both aren't defined it checks one, then the other,
#finally if none... just run config with defaults and make.
#For Release 3:
#Also define a text string to include in the RPM description, stating which (if any) of these options was used.
%build
%if %{?strict_checks:1}%{!?strict_checks:0} && %{?alt_givedir:1}%{!?alt_givedir:0}
%if "%{strict_checks}" == "no" || "%{strict_checks}" == "No" || "%{strict_checks}" == "NO"
%configure --enable-non-strict-checks --enable-givedir=%{alt_givedir}
%define local_options Built with non-strict-checks and alt givedir=%{alt_givedir}
make
%else
echo "*****BAD PARAM TO STRICT-CHECKS, ACCEPTABLE VALS: no, No, or NO. IF YOU WANT STRICT CHECKING DO NOT DEFINE STRICT CHECKS. IT IS ENABLED BY DEFAULT*****."
exit -1
%endif
%else
%if %{?strict_checks:1}%{!?strict_checks:0}
%if "%{strict_checks}" == "no" || "%{strict_checks}" == "No" || "%{strict_checks}" == "NO"
%configure --enable-non-strict-checks
%define local_options Built with non-strict-checks only
make
%else
echo "*****BAD PARAM TO STRICT-CHECKS, ACCEPTABLE VALS: no, No, or NO. IF YOU WANT STRICT CHECKING DO NOT DEFINE STRICT CHECKS. IT IS ENABLED BY DEFAULT*****."
exit -1
%endif
%else
%if %{?alt_givedir:1}%{!?alt_givedir:0}
%configure --enable-givedir=%{alt_givedir}
%define local_options Built with alt givedir=%{alt_givedir} only
make
%else
%define local_options Built with default values, strict checking and /usr/givedir
%configure
make
%endif
%endif
# if give_dir is not defined, give it the value of /usr/give
%if %{?give_dir:0}%{!?give_dir:1}
%define give_dir /usr/give
%endif

%if %{with strict_checks}
%configure --enable-givedir=%{give_dir}
%define local_options Built with strict checks
make
%else
%configure --enable-non-strict-checks --enable-givedir=%{give_dir}
%define local_options Built with non-strict checks (default)
make
%endif

%description
Give and take are a set of companion utilities that allow a
Expand Down Expand Up @@ -103,4 +83,6 @@ rm -rf $RPM_BUILD_ROOT
* Tue Nov 06 2012 Georgia Pedicini <gap@lanl.gov>
- Added defined text string to include in description, citing which (if any) options were used in the build.
* Wed May 25 2016 Dominic Manno <dmanno@lanl.gov>
- Converted to be python2 and python3 compatible, mostly print statement to function calls
- Converted to be python2 and python3 compatible, mostly print statement to function calls
* Wed Feb 19 2020 Francine Lapid <lapid@lanl.gov>
- Edited spec file to change defaults and arguments