Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec changes #8

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 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
--with checks............enables strict checks. The default has strict checking set to disabled.
--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 --with 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 --with 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" --with checks

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" --with checks

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

Expand Down
73 changes: 26 additions & 47 deletions give.spec
Original file line number Diff line number Diff line change
@@ -1,64 +1,41 @@
%define realname give
%define realversion 3.1-5
# add --with checks option (default is enable non strict checks)
%bcond_with 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: 5
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}-%{release}.tar.gz
URL: https://github.com/hpc/%{name}


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

#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
%if %{with checks}
%{!?give_dir: %define give_dir /usr/give}
francinelapid marked this conversation as resolved.
Show resolved Hide resolved
%configure --enable-givedir=%{give_dir}
%define local_options Built with strict checks
make
%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
%{!?give_dir: %define give_dir /usr/give}
%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
secure transfer of files from one user to another without
Expand Down Expand Up @@ -101,6 +78,8 @@ rm -rf $RPM_BUILD_ROOT
* Thu Nov 01 2012 Georgia Pedicini <[email protected]>
- LANL version 3.1-2, tighten permissions
* Tue Nov 06 2012 Georgia Pedicini <[email protected]>
- Added defined text string to include in description, citing which (if any) options were used in the build.
- Added defined text string to include in description, citing which (if any)
options were used in the build.
* Wed May 25 2016 Dominic Manno <[email protected]>
- 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