e836f2a
e836f2a
%if  0%{?el4}%{?el5}
e836f2a
%define _initddir %{_sysconfdir}/rc.d/init.d
e836f2a
%endif
e836f2a
e836f2a
Name:           munge
e673e8f
Version:        0.5.9
0262046
Release:        3%{?dist}
e836f2a
Summary:        Enables uid & gid authentication across a host cluster
e836f2a
e836f2a
Group:          Applications/System
e836f2a
License:        GPLv2+
e836f2a
URL:            http://home.gna.org/munge/
e836f2a
Source0:        http://download.gna.org/munge/%{version}/munge-%{version}.tar.bz2
e836f2a
Source1:        create-munge-key
e836f2a
Source2:        munge.logrotate
e836f2a
Patch2:         runas-munge-user.patch
44108b7
# Was loading /etc/sysconfig/munge wrongly on reboot.
44108b7
# Fixed upstream already for next release.
91b0aa3
# https://bugzilla.redhat.com/show_bug.cgi?id=525732
44108b7
Patch5:         %{name}-correct-service-name.patch
e836f2a
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
e836f2a
e836f2a
BuildRequires:  zlib-devel bzip2-devel openssl-devel
91b0aa3
Requires:       munge-libs = %{version}-%{release}
e836f2a
91b0aa3
Requires(post):   chkconfig
91b0aa3
Requires(pre):    shadow-utils
91b0aa3
Requires(preun):  chkconfig, initscripts
e836f2a
Requires(postun): initscripts
e836f2a
e836f2a
e836f2a
%description
e836f2a
MUNGE (MUNGE Uid 'N' Gid Emporium) is an authentication service for creating 
e836f2a
and validating credentials. It is designed to be highly scalable for use 
e836f2a
in an HPC cluster environment. 
e836f2a
It allows a process to authenticate the UID and GID of another local or 
e836f2a
remote process within a group of hosts having common users and groups. 
e836f2a
These hosts form a security realm that is defined by a shared cryptographic 
e836f2a
key. Clients within this security realm can create and validate credentials 
e836f2a
without the use of root privileges, reserved ports, or platform-specific 
e836f2a
methods.
e836f2a
e836f2a
%package devel
91b0aa3
Summary:        Development files for uid * gid authentication acrosss a host cluster
91b0aa3
Group:          Applications/System
91b0aa3
Requires:       munge-libs = %{version}-%{release}
e836f2a
e836f2a
%description devel
e836f2a
Header files for developing using MUNGE.
e836f2a
a178a82
%package libs
91b0aa3
Summary:        Runtime libs for uid * gid authentication acrosss a host cluster
91b0aa3
Group:          Applications/System
a178a82
a178a82
%description libs
a178a82
Runtime libraries for using MUNGE.
a178a82
a178a82
e836f2a
%prep
e836f2a
%setup -q
e836f2a
%patch2 -p1
e836f2a
e836f2a
e836f2a
%build
e836f2a
# Won't compile without -DGNU_SOURCE on fc11,12 at least.
e836f2a
%if ! 0%{?el4}%{?el5}
e836f2a
  export CFLAGS="%{optflags} -D_GNU_SOURCE"
e836f2a
%endif
e836f2a
e836f2a
%configure  --disable-static
e836f2a
# Get rid of some rpaths for /usr/sbin
e836f2a
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
e836f2a
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
e836f2a
make %{?_smp_mflags} 
e836f2a
e836f2a
e836f2a
%install
e836f2a
e836f2a
rm -rf $RPM_BUILD_ROOT
e836f2a
make install DESTDIR=$RPM_BUILD_ROOT
e836f2a
e836f2a
# mv init.d script form /etc/init.d to %{_initddir}
e836f2a
mkdir -p $RPM_BUILD_ROOT/%{_initddir}
e836f2a
mv  $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/munge $RPM_BUILD_ROOT/%{_initddir}/munge
e836f2a
#  
e836f2a
chmod 644 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/munge
e836f2a
# Exclude .la files 
e836f2a
rm $RPM_BUILD_ROOT/%{_libdir}/libmunge.la
e836f2a
e836f2a
install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT/%{_sbindir}/create-munge-key
e836f2a
install -p -D -m 644 %{SOURCE2} $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/munge
e836f2a
e836f2a
# Fix a few permissions
e836f2a
chmod 700 $RPM_BUILD_ROOT%{_var}/lib/munge $RPM_BUILD_ROOT%{_var}/log/munge
e836f2a
chmod 700 $RPM_BUILD_ROOT%{_sysconfdir}/munge
e836f2a
44108b7
# Create and empty key file and pid file to be marked as a ghost file below.
e836f2a
# i.e it is not actually included in the rpm, only the record 
e836f2a
# of it is.
e836f2a
# Can't be done on .el4 or .el5.
e836f2a
%if ! 0%{?el4}%{?el5}
44108b7
touch $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.key
44108b7
chmod 400 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.key
44108b7
touch $RPM_BUILD_ROOT%{_var}/run/%{name}/%{name}d.pid
e836f2a
%endif
e836f2a
e836f2a
%clean
e836f2a
rm -rf $RPM_BUILD_ROOT
e836f2a
e836f2a
%postun 
e836f2a
if [ "$1" -ge "1" ] ; then
e836f2a
    /sbin/service munge condrestart >/dev/null 2>&1 || :
e836f2a
fi
e836f2a
e836f2a
e836f2a
%preun
e836f2a
if [ $1 = 0 ]; then
e836f2a
    /sbin/service munge stop > /dev/null 2>&1 || :
e836f2a
    /sbin/chkconfig --del munge || :
e836f2a
fi
e836f2a
e836f2a
%pre
e836f2a
getent group munge >/dev/null || groupadd -r munge
e836f2a
getent passwd munge >/dev/null || \
e836f2a
useradd -r -g munge -d %{_var}/run/munge -s /sbin/nologin \
e836f2a
  -c "Runs Uid 'N' Gid Emporium" munge
e836f2a
exit 0
e836f2a
e836f2a
e836f2a
%post
e836f2a
/sbin/chkconfig --add munge || :
e836f2a
a178a82
%post   libs -p /sbin/ldconfig
a178a82
%postun libs -p /sbin/ldconfig
e836f2a
e836f2a
%files
e836f2a
%defattr(-,root,root,-)
e836f2a
%{_initddir}/munge
e836f2a
%{_bindir}/munge
e836f2a
%{_bindir}/remunge
e836f2a
%{_bindir}/unmunge
e836f2a
%{_sbindir}/munged
e836f2a
%{_sbindir}/create-munge-key
e836f2a
%{_mandir}/man1/munge.1.gz
e836f2a
%{_mandir}/man1/remunge.1.gz
e836f2a
%{_mandir}/man1/unmunge.1.gz
e836f2a
%{_mandir}/man7/munge.7.gz
e836f2a
%{_mandir}/man8/munged.8.gz
e836f2a
44108b7
%attr(-,munge,munge) %dir  %{_var}/run/munge
e836f2a
%attr(0700,munge,munge) %dir  %{_var}/log/munge
e836f2a
%attr(0700,munge,munge) %dir %{_sysconfdir}/munge
e836f2a
%if ! 0%{?el4}%{?el5}
e836f2a
%attr(0400,munge,munge) %ghost %{_sysconfdir}/%{name}/%{name}.key
44108b7
%attr(-,munge,munge)    %ghost %{_var}/run/%{name}/%{name}d.pid
e836f2a
%endif
e836f2a
e836f2a
%attr(0700,munge,munge) %dir  %{_var}/lib/munge
e836f2a
e836f2a
%config(noreplace) %{_sysconfdir}/sysconfig/munge
e836f2a
%config(noreplace) %{_sysconfdir}/logrotate.d/munge
e836f2a
0262046
%doc AUTHORS BUGS ChangeLog    
e836f2a
%doc JARGON META NEWS QUICKSTART README 
e836f2a
%doc doc
e836f2a
a178a82
%files libs
a178a82
%defattr(-,root,root,-)
a178a82
%{_libdir}/libmunge.so.2
a178a82
%{_libdir}/libmunge.so.2.0.0
91b0aa3
%doc COPYING
e836f2a
e836f2a
%files devel
e836f2a
%defattr(-,root,root,-)
e836f2a
%{_includedir}/munge.h
e836f2a
%{_libdir}/libmunge.so
e836f2a
%{_mandir}/man3/munge.3.gz
e836f2a
%{_mandir}/man3/munge_ctx.3.gz
e836f2a
%{_mandir}/man3/munge_ctx_copy.3.gz
e836f2a
%{_mandir}/man3/munge_ctx_create.3.gz
e836f2a
%{_mandir}/man3/munge_ctx_destroy.3.gz
e836f2a
%{_mandir}/man3/munge_ctx_get.3.gz
e836f2a
%{_mandir}/man3/munge_ctx_set.3.gz
e836f2a
%{_mandir}/man3/munge_ctx_strerror.3.gz
e836f2a
%{_mandir}/man3/munge_decode.3.gz
e836f2a
%{_mandir}/man3/munge_encode.3.gz
e836f2a
%{_mandir}/man3/munge_enum.3.gz
e836f2a
%{_mandir}/man3/munge_enum_int_to_str.3.gz
e836f2a
%{_mandir}/man3/munge_enum_is_valid.3.gz
e836f2a
%{_mandir}/man3/munge_enum_str_to_int.3.gz
e836f2a
%{_mandir}/man3/munge_strerror.3.gz
e836f2a
e836f2a
e836f2a
%changelog
0262046
* Sat Mar 27 2010 Steve Traylen <steve.traylen@cern.ch> - 0.5.9-3
0262046
- Release Bump
62619b2
* Fri Mar 26 2010 Steve Traylen <steve.traylen@cern.ch> - 0.5.9-2
62619b2
- Remove initd-pass-rpmlint.patch, has been applied upstream.
62619b2
- Remove remove-GPL_LICENSED-cpp.patch, has been applied upstream.
e673e8f
* Fri Mar 26 2010 Steve Traylen <steve.traylen@cern.ch> - 0.5.9-1
e673e8f
- New upstream 0.5.9
91b0aa3
* Wed Oct 21 2009 Steve Traylen <steve.traylen@cern.ch> - 0.5.8-8
91b0aa3
- Requirment on munge removed from munge-libs.
91b0aa3
- Explicit exact requirment on munge-libs for munge and munge-devel
91b0aa3
  added.
a178a82
* Wed Oct 21 2009 Steve Traylen <steve.traylen@cern.ch> - 0.5.8-7
a178a82
- rhbz#530128 Move runtime libs to a new -libs package.
a178a82
  ldconfig moved to new -libs package as a result.
44108b7
* Sat Sep 26 2009 Steve Traylen <steve.traylen@cern.ch> - 0.5.8-6
44108b7
- Patch for rhbz #525732 - Loads /etc/sysconfig/munge 
44108b7
  correctly.
44108b7
- Mark pid file as ghost file on oses that support that.
44108b7
- Permisions on pid directory to 755
44108b7
0181466
* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 0.5.8-5
0181466
- rebuilt with new openssl
0181466
e836f2a
* Thu Jul 22 2009 Steve Traylen <steve.traylen@cern.ch> - 0.5.8-4
e836f2a
- Expand defattr with 4th argument for default directory perms.
e836f2a
- Explict attr for non 0644 files and 0755 directories.
e836f2a
e836f2a
* Thu Jul 22 2009 Steve Traylen <steve.traylen@cern.ch> - 0.5.8-3
e836f2a
- Append -DGNU_SOURCE to default CFLAGS.
e836f2a
e836f2a
* Wed Jul 22 2009 Steve Traylen <steve.traylen@cern.ch> - 0.5.8-2
e836f2a
- Correct License to GPLv2+
e836f2a
- Move man3 pages to the devel package.
e836f2a
- Remove +x bit from create-munge-key source.
e836f2a
- Preserve timestamps when installing files.
e836f2a
- ldconfig not needed on -devel package.
e836f2a
- Do a condrestart when upgrading.
e836f2a
- Remove redundant files from docs.
e836f2a
- chmod /var/lib/munge /var/log/munge and /etc/munge to 700.
e836f2a
- Apply patch to not error when GPL_LICENSED is not set.
e836f2a
- Patch service script to print error on if munge.key not present
e836f2a
  on start only and with a better error. 
e836f2a
- Remove dont-exit-form-lib.patch. munge is expecting munge to
e836f2a
  do this.
e836f2a
- Remove libgcrypt-devel from BuildRequires, uses openssl by
e836f2a
  default anyway.
e836f2a
- Mark the munge.key as a ghost file.
e836f2a
e836f2a
e836f2a
* Fri Jun 12 2009 Steve Traylen <steve@traylen.net> - 0.5.8-1
e836f2a
- First Build
e836f2a
e836f2a