56a1d0b
%define goldcgidir	%{_datadir}/%{name}-%{version}
56a1d0b
%define golddatadir	%{_localstatedir}/lib/%{name}
01619df
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
56a1d0b
56a1d0b
Name:		gold
56a1d0b
Version:	2.1.12.2
df7c042
Release:	35%{?dist}
56a1d0b
Summary:	Tracks and manages resource usage on High Performance Computers
56a1d0b
License:	BSD
56a1d0b
URL:		http://www.clusterresources.com/products/%{name}
56a1d0b
Source0:	http://www.clusterresources.com/downloads/%{name}/%{name}-%{version}.tar.gz
Jessica R Jones 500818e
# These patches are to make it build happily under rpm and mock - they have
Jessica R Jones 500818e
# been submitted upstream (see the thread at
Jessica R Jones 500818e
# http://www.supercluster.org/pipermail/gold-users/2010-July/000343.html for
Jessica R Jones 500818e
# more info).
56a1d0b
Patch0:		gold-makefile.patch
56a1d0b
Patch1:		gold-configure-ac.patch
Jessica R Jones 500818e
56a1d0b
BuildArch:	noarch 
56a1d0b
Requires(pre):	shadow-utils
56a1d0b
Requires:	perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
56a1d0b
Requires:	sqlite
Jessica R Jones 46c568a
Jessica R Jones 46c568a
# For some reason, these requires are missed:
56a1d0b
Requires:	perl(Data::Properties)
56a1d0b
Requires:	perl(Crypt::DES_EDE3)
Jessica R Jones 46c568a
Igor Gnatenko 06b3cc7
BuildRequires:  gcc
56a1d0b
BuildRequires:	autoconf
8b518c7
BuildRequires:	coreutils
8b518c7
BuildRequires:	make
d17b3db
BuildRequires:	perl-generators
ceeee54
BuildRequires:	perl-interpreter
Jessica R Jones 500818e
Jessica R Jones 500818e
%description
Jessica R Jones 500818e
The Gold Allocation Manager is an open source accounting system developed by
Jessica R Jones 500818e
Pacific Northwest National Laboratory (PNNL) as part of the Department of
Jessica R Jones 500818e
Energy (DOE) Scalable Systems Software Project (SSS). It tracks resource usage
Jessica R Jones 500818e
on High Performance Computers and acts much like a bank, establishing accounts
Jessica R Jones 500818e
in order to pre-allocate user and project resource usage over specific nodes and
Jessica R Jones 500818e
time-frame. Gold provides balance and usage feedback to users, managers, and
Jessica R Jones 500818e
system administrators.  SQLite is used by default, but Gold can be configured
Jessica R Jones 500818e
to use either MySQL or PostgreSQL instead.
Jessica R Jones 500818e
Jessica R Jones 500818e
%package web
Jessica R Jones 500818e
Summary:			Gold Allocation Manager Web Frontend
Jessica R Jones 500818e
Requires:			%{name} = %{version}-%{release}
Jessica R Jones 500818e
Requires:			webserver
Jessica R Jones 500818e
Requires:			perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
ceeee54
BuildRequires:		perl-interpreter
Jessica R Jones 500818e
Jessica R Jones 500818e
%description web
Jessica R Jones 500818e
CGI Perl web front-end for the Gold Allocation Manager.
Jessica R Jones 500818e
Jessica R Jones 500818e
%package doc
Jessica R Jones 500818e
Summary:			Gold Allocation Manager Documentation
Jessica R Jones 500818e
Jessica R Jones 500818e
%description doc
Jessica R Jones 500818e
Documentation for the Gold Allocation Manager.
Jessica R Jones 500818e
Jessica R Jones 500818e
%prep 
Jessica R Jones 500818e
%setup -q
Jessica R Jones 500818e
%patch0
Jessica R Jones 500818e
%patch1
Jessica R Jones 500818e
# Regenerate configure script
Jessica R Jones 500818e
autoconf -f -o configure
Jessica R Jones 500818e
Jessica R Jones 500818e
%build
Jessica R Jones 500818e
%configure \
Jessica R Jones 500818e
	--with-user=gold --with-db=SQLite \
01619df
	--with-doc-dir=%{_pkgdocdir} \
Jessica R Jones 500818e
	--with-perl-libs=vendor --with-gold-libs=vendor --with-cgi-bin=%{goldcgidir} \
Jessica R Jones 500818e
	--datadir=%{golddatadir}
Jessica R Jones 500818e
make %{?_smp_mflags}
Jessica R Jones 500818e
make %{?_smp_mflags} gui
Jessica R Jones 500818e
Jessica R Jones 500818e
# Prevent spurious requirement on Postgres DBD class
Jessica R Jones 500818e
cat << \EOF > %{name}-req
Jessica R Jones 500818e
#!/bin/sh
Jessica R Jones 500818e
%{__perl_requires} $* |\
Jessica R Jones 500818e
sed -e '/perl(DBD::Pg)/d'
Jessica R Jones 500818e
EOF
Jessica R Jones 500818e
Jessica R Jones 500818e
%global __perl_requires %{_builddir}/%{name}-%{version}/%{name}-req
Jessica R Jones 500818e
chmod +x %{__perl_requires}
Jessica R Jones 500818e
Jessica R Jones 500818e
%install
Jessica R Jones 500818e
## Install documentation
01619df
mkdir -p %{buildroot}%{_pkgdocdir}
Jessica R Jones 500818e
Jessica R Jones 500818e
## Install binaries
Jessica R Jones 500818e
mkdir -p %{buildroot}%{golddatadir}
Jessica R Jones 500818e
mkdir -p %{buildroot}%{perl_vendorlib}
Jessica R Jones 500818e
make install DESTDIR=%{buildroot}
Jessica R Jones 500818e
Jessica R Jones 500818e
## Install web gui
Jessica R Jones 500818e
make install-gui DESTDIR=%{buildroot}
Jessica R Jones 500818e
Jessica R Jones 46c568a
# TODO
Jessica R Jones 46c568a
#make auth_key DESTDIR=%{buildroot}
Jessica R Jones 46c568a
Jessica R Jones 500818e
# Clean up things that shouldn't have been installed
Jessica R Jones 500818e
rm %{buildroot}%{perl_vendorlib}/Gold/*.pm.in
Jessica R Jones 500818e
Jessica R Jones 500818e
# Fix non UTF-8 files(preserving timestamps)
Jessica R Jones 500818e
for i in README LICENSE;
Jessica R Jones 500818e
do
Jessica R Jones 500818e
	iconv -f iso8859-1 -t utf8 $i >$i.utf8
Jessica R Jones 500818e
	touch -r $i $i.utf8
Jessica R Jones 500818e
	mv $i.utf8 $i
Jessica R Jones 500818e
done
Jessica R Jones 500818e
01619df
# Install rest of the documentation
01619df
install -pm 644 README INSTALL LICENSE DATABASE CHANGES \
01619df
	%{buildroot}%{_pkgdocdir}
01619df
cp -pR doc/ %{buildroot}%{_pkgdocdir}
01619df
Jessica R Jones 46c568a
# TODO Separate out the gold server and client packages
Jessica R Jones 46c568a
Jessica R Jones 46c568a
# TODO Work out why init script isn't installing - in src/etc/gold.d.in
Jessica R Jones 46c568a
# TODO chkconfig --add gold
Jessica R Jones 46c568a
# TODO Patch Perl in /usr/sbin/goldd to use the passed in pid file and not the
Jessica R Jones 46c568a
# hard coded one!!
Jessica R Jones 46c568a
# TODO Patch Perl in /usr/sbin/goldd to use the correct path for the /etc/
Jessica R Jones 46c568a
# files!
Jessica R Jones 46c568a
# TODO Patch Perl in Gold.pm and others too as paths to the config files are
Jessica R Jones 46c568a
# incorrect.
Jessica R Jones 46c568a
# TODO Correct init script to use the correct path for the pid file -
Jessica R Jones 46c568a
# /var/run/gold/gold.pid or /var/run/gold.pid
Jessica R Jones 46c568a
Jessica R Jones 46c568a
# TODO Correct goldsh so that the gold_history file isn't in a hard-coded
Jessica R Jones 46c568a
# location in /usr/log/.gold_history or similar
Jessica R Jones 46c568a
Jessica R Jones 46c568a
# TODO Sort out the authkey: ${GOLD_HOME}/etc/auth_key (line 220 of
Jessica R Jones 46c568a
# /usr/sbin/goldd)
Jessica R Jones 46c568a
Jessica R Jones 46c568a
# TODO On the client end, make sure the default logging is to use syslog, and
Jessica R Jones 46c568a
# that this is honoured in all the places it is currently hard-coded!
Jessica R Jones 46c568a
Jessica R Jones 46c568a
# TODO The gold*.conf config files need to have their permissions changed so
Jessica R Jones 46c568a
# that they belong to the gold user and group and are chmod 600 or similar as
Jessica R Jones 46c568a
# they will contain database usernames and passwords.
Jessica R Jones 46c568a
Jessica R Jones 46c568a
# TODO Change the server name set in the config files
Jessica R Jones 46c568a
# TODO Change the log location set in the config files
Jessica R Jones 46c568a
# TODO Change the logging level set in the config files
Jessica R Jones 46c568a
Jessica R Jones 46c568a
# The server configuration file is goldd.conf
Jessica R Jones 46c568a
# The client is 
Jessica R Jones 46c568a
# The web interface configuration file is 
Jessica R Jones 46c568a
Jessica R Jones 46c568a
Jessica R Jones 500818e
%check
Jessica R Jones 500818e
# This target, although it exists, does nothing at present
Jessica R Jones 500818e
make test
Jessica R Jones 500818e
Jessica R Jones 500818e
%pre
Jessica R Jones 500818e
## Add the "gold" group
Jessica R Jones 46c568a
getent group gold >/dev/null || groupadd -r gold
Jessica R Jones 500818e
## Add the "gold" user
Jessica R Jones 46c568a
getent passwd gold >/dev/null || \
Jessica R Jones 46c568a
/usr/sbin/useradd -c "Gold Allocation Manager" -g gold \
Jessica R Jones 500818e
	-s /sbin/nologin -r -d %{_localstatedir}/lib/%{name} gold 
Jessica R Jones 500818e
exit 0
Jessica R Jones 500818e
Jessica R Jones 500818e
%preun
Jessica R Jones 500818e
if [ "$1" = 0 ]
Jessica R Jones 500818e
then
Jessica R Jones 500818e
	/sbin/service gold stop >/dev/null 2>&1 || :
Jessica R Jones 500818e
	/sbin/chkconfig --del gold
Jessica R Jones 500818e
fi
Jessica R Jones 500818e
Jessica R Jones 500818e
%files
01619df
%dir %{_pkgdocdir}
01619df
%{_pkgdocdir}/LICENSE
Jessica R Jones 500818e
%dir %{golddatadir}
Jessica R Jones 500818e
%dir %{perl_vendorlib}/Gold
Jessica R Jones 500818e
%config(noreplace) %{_sysconfdir}/*
Jessica R Jones 500818e
%{_bindir}/*
Jessica R Jones 500818e
%{_sbindir}/*
Jessica R Jones 500818e
%{perl_vendorlib}/Gold.pm
Jessica R Jones 500818e
%{perl_vendorlib}/Gold/*.pm
Jessica R Jones 500818e
Jessica R Jones 500818e
%files doc
01619df
%dir %{_pkgdocdir}
01619df
%{_pkgdocdir}/*
Jessica R Jones 500818e
Jessica R Jones 500818e
%files web
Jessica R Jones 500818e
%dir %{goldcgidir}
Jessica R Jones 500818e
%{goldcgidir}/*
Jessica R Jones 500818e
Jessica R Jones 500818e
%changelog
df7c042
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.12.2-35
df7c042
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
df7c042
6cdc9e3
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.12.2-34
6cdc9e3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
6cdc9e3
01aebb0
* Mon Jun 22 2020 Jitka Plesnikova <jplesnik@redhat.com> - 2.1.12.2-33
01aebb0
- Perl 5.32 rebuild
01aebb0
6459474
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.12.2-32
6459474
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
6459474
a0be618
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.12.2-31
a0be618
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
a0be618
e2c0fa5
* Thu May 30 2019 Jitka Plesnikova <jplesnik@redhat.com> - 2.1.12.2-30
e2c0fa5
- Perl 5.30 rebuild
e2c0fa5
89e9217
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.12.2-29
89e9217
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
89e9217
2bbfcb1
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.12.2-28
2bbfcb1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
2bbfcb1
f4f8bd7
* Thu Jun 28 2018 Jitka Plesnikova <jplesnik@redhat.com> - 2.1.12.2-27
f4f8bd7
- Perl 5.28 rebuild
f4f8bd7
2f2f9cd
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.1.12.2-26
2f2f9cd
- Escape macros in %%changelog
2f2f9cd
f2c361b
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.12.2-25
f2c361b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
f2c361b
6f62c6e
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.12.2-24
6f62c6e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
6f62c6e
c399294
* Sun Jun 04 2017 Jitka Plesnikova <jplesnik@redhat.com> - 2.1.12.2-23
c399294
- Perl 5.26 rebuild
c399294
74796cb
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.12.2-22
74796cb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
74796cb
8b518c7
* Mon Aug 15 2016 Jitka Plesnikova <jplesnik@redhat.com> - 2.1.12.2-21
8b518c7
- Fix build-require of perl
8b518c7
0a7299e
* Sun May 15 2016 Jitka Plesnikova <jplesnik@redhat.com> - 2.1.12.2-20
0a7299e
- Perl 5.24 rebuild
0a7299e
194a3ae
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.12.2-19
194a3ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
194a3ae
a6b53dd
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.12.2-18
a6b53dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
a6b53dd
191fe75
* Wed Jun 03 2015 Jitka Plesnikova <jplesnik@redhat.com> - 2.1.12.2-17
191fe75
- Perl 5.22 rebuild
191fe75
8e39587
* Wed Aug 27 2014 Jitka Plesnikova <jplesnik@redhat.com> - 2.1.12.2-16
8e39587
- Perl 5.20 rebuild
8e39587
f6a1b1c
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.12.2-15
f6a1b1c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
f6a1b1c
01619df
* Wed Nov 13 2013 Ville Skyttä <ville.skytta@iki.fi> - 2.1.12.2-14
01619df
- Install docs to %%{_pkgdocdir} where available (#993797).
01619df
- Remove redundant copy of LICENSE from -web.
01619df
f49c18d
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.12.2-13
f49c18d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
f49c18d
c4fd613
* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 2.1.12.2-12
c4fd613
- Perl 5.18 rebuild
c4fd613
ff44954
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.12.2-11
ff44954
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
ff44954
3546adb
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.12.2-10
3546adb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
3546adb
59b2994
* Mon Jun 11 2012 Petr Pisar <ppisar@redhat.com> - 2.1.12.2-9
59b2994
- Perl 5.16 rebuild
59b2994
a42113e
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.12.2-8
a42113e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
a42113e
56a1d0b
* Tue Oct 11 2011 Peter Robinson <pbrobinson@fedoraproject.org> - 2.1.12.2-7
56a1d0b
- Rebuild for new perl, cleanup spec file
56a1d0b
7f0f961
* Mon Jun 20 2011 Marcela Mašláňová <mmaslano@redhat.com> - 2.1.12.2-6
7f0f961
- Perl mass rebuild
7f0f961
7896e8e
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.12.2-5
7896e8e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
7896e8e
Jessica R Jones 500818e
* Thu Aug 12 2010 Jessica Jones <fedora@zaniyah.org> 2.1.12.2-4
Jessica R Jones 500818e
- Changed summary to something more comprehensible
Jessica R Jones 500818e
- Updated description to include full package name
Jessica R Jones 500818e
Jessica R Jones 500818e
* Tue Aug  3 2010 Jessica Jones <fedora@zaniyah.org> 2.1.12.2-3
Jessica R Jones 500818e
- Attempt to fix Perl dependencies
Jessica R Jones 500818e
Jessica R Jones 500818e
* Wed Jul 28 2010 Jessica Jones <fedora@zaniyah.org> 2.1.12.2-2
Jessica R Jones 500818e
- Convert README and LICENSE to UTF-8
2f2f9cd
- Change file list to include %%conf directive for config files
Jessica R Jones 500818e
- Remove duplicate files from file list
Jessica R Jones 500818e
- Remove unnecessary documentation from web and main packages
Jessica R Jones 500818e
- Add test step
Jessica R Jones 500818e
- Remove unnecessary Perl tests
Jessica R Jones 500818e
Jessica R Jones 500818e
* Thu Jul 01 2010 Jessica Jones <fedora@zaniyah.org> 2.1.12.2-1
Jessica R Jones 500818e
- Initial build for EPEL 5