Project

General

Profile

Download (10.8 KB) Statistics
| Branch: | Tag: | Revision:
b4b276f3 Dominic Cleal
%global homedir %{_datadir}/%{name}
%global confdir config

44be90c9 Dominic Cleal
%global scl_ruby_bin /usr/bin/%{?scl:%{scl_prefix}}ruby
%global scl_rake /usr/bin/%{?scl:%{scl_prefix}}rake
b4b276f3 Dominic Cleal
2a2cd4ee Dominic Cleal
# set and uncomment all three to set alpha tag
#global alphatag RC1
#global dotalphatag .%{alphatag}
#global dashalphatag -%{alphatag}

b4b276f3 Dominic Cleal
Name: foreman-proxy
e7754c49 Ewoud Kohl van Wijngaarden
Version: 1.19.0
429e935d Dominic Cleal
Release: 0.develop%{?dotalphatag}%{?dist}
b4b276f3 Dominic Cleal
Summary: Restful Proxy for DNS, DHCP, TFTP, PuppetCA and Puppet

Group: Applications/System
License: GPLv3+
e7754c49 Ewoud Kohl van Wijngaarden
URL: https://theforeman.org/projects/smart-proxy
Source0: https://downloads.theforeman.org/%{name}/%{name}-%{version}%{?dashalphatag}.tar.bz2
56359a99 Dominic Cleal
Source1: %{name}.tmpfiles
Source2: logrotate.conf
b4b276f3 Dominic Cleal
BuildArch: noarch
f4bd4628 Dmitri Dolguikh
BuildRequires: /usr/bin/rename
65d46d30 Stephen Benjamin
BuildRequires: asciidoc
b319e683 Dominic Cleal
BuildRequires: %{?scl_prefix_ruby}rubygem(rake) >= 0.8.3
b4b276f3 Dominic Cleal
b319e683 Dominic Cleal
BuildRequires: %{?scl_prefix_ruby}ruby(release)
Requires: %{?scl_prefix_ruby}ruby(release)
b4b276f3 Dominic Cleal
b79e046b Lukas Zapletal
Requires: foreman-debug
b319e683 Dominic Cleal
Requires: %{?scl_prefix_ruby}rubygems
Requires: %{?scl_prefix_ruby}rubygem(rake) >= 0.8.3
Requires: %{?scl_prefix_ruby}rubygem(sinatra)
Requires: %{?scl_prefix_ruby}rubygem(rack) >= 1.1.0
Requires: %{?scl_prefix_ruby}rubygem(json)
91da511b Ewoud Kohl van Wijngaarden
Requires: %{?scl_prefix}rubygem(rkerberos) >= 0.1.1
Requires: %{?scl_prefix}rubygem(rubyipmi) >= 0.10.0
b4b276f3 Dominic Cleal
Requires: %{?scl_prefix}rubygem(gssapi)
f4bd4628 Dmitri Dolguikh
Requires: %{?scl_prefix}rubygem(bundler_ext)
25846dec Dominic Cleal
Requires: %{?scl_prefix}rubygem(rb-inotify)
7e07f722 Dominic Cleal
Requires: %{?scl_prefix}rubygem(rsec)
0bb35112 Dominic Cleal
Requires: %{?scl_prefix}rubygem(concurrent-ruby) >= 1.0
Requires: %{?scl_prefix}rubygem(concurrent-ruby) < 2.0
b4b276f3 Dominic Cleal
Requires: sudo
Requires: wget
Requires(pre): shadow-utils
ba249001 Ewoud Kohl van Wijngaarden
%{?systemd_requires}
BuildRequires: systemd
b4b276f3 Dominic Cleal
%description
Manages DNS, DHCP, TFTP and puppet settings though HTTP Restful API
e7754c49 Ewoud Kohl van Wijngaarden
Mainly used by the foreman project (https://theforeman.org)
b4b276f3 Dominic Cleal
%prep
2a2cd4ee Dominic Cleal
%setup -q -n %{name}-%{version}%{?dashalphatag}
b4b276f3 Dominic Cleal
%build
65d46d30 Stephen Benjamin
#build man pages
%{scl_rake} -f Rakefile.dist build \
PREFIX=%{_prefix} \
SBINDIR=%{_sbindir} \
SYSCONFDIR=%{_sysconfdir} \
--trace
b4b276f3 Dominic Cleal
#replace shebangs for SCL
44be90c9 Dominic Cleal
%if 0%{?scl:1}
f4bd4628 Dmitri Dolguikh
for f in bin/smart-proxy extra/query.rb extra/changelog extra/migrate_settings.rb; do
44be90c9 Dominic Cleal
sed -ri '1sX(/usr/bin/ruby|/usr/bin/env ruby)X%{scl_ruby_bin}X' $f
b4b276f3 Dominic Cleal
done
%endif

f4bd4628 Dmitri Dolguikh
#replace default location of 'settings.d'
sed -i '/^---/ a #replace default location of "settings.d"\n:settings_directory: %{_sysconfdir}/%{name}/settings.d\n' \
%{confdir}/settings.yml.example

# switches to bundler_ext instead of bundler
mv Gemfile Gemfile.in
b4b276f3 Dominic Cleal
%install
rm -rf %{buildroot}
65d46d30 Stephen Benjamin
#install man pages
%{scl_rake} -f Rakefile.dist install \
PREFIX=%{buildroot}%{_prefix} \
SBINDIR=%{buildroot}%{_sbindir} \
SYSCONFDIR=%{buildroot}%{_sysconfdir} \
--trace
%{scl_rake} -f Rakefile.dist clean

b79e046b Lukas Zapletal
# install foreman-devel script
install -Dp -m0755 extra/foreman-debug-proxy %{buildroot}%{_datadir}/foreman/script/foreman-debug.d/75-foreman-proxy

b4b276f3 Dominic Cleal
install -d -m0755 %{buildroot}%{_datadir}/%{name}
install -d -m0755 %{buildroot}%{_datadir}/%{name}/config
install -d -m0755 %{buildroot}%{_sysconfdir}/%{name}
f4bd4628 Dmitri Dolguikh
install -d -m0755 %{buildroot}%{_sysconfdir}/%{name}/settings.d
ba249001 Ewoud Kohl van Wijngaarden
install -d -m0755 %{buildroot}%{_sharedstatedir}/%{name}
b4b276f3 Dominic Cleal
install -d -m0750 %{buildroot}%{_localstatedir}/log/%{name}
42372c8d Dirk Goetz
install -d -m0750 %{buildroot}%{_localstatedir}/spool/%{name}
a0935cbf Ewoud Kohl van Wijngaarden
install -d -m0750 %{buildroot}%{_rundir}/%{name}
56359a99 Dominic Cleal
install -Dp -m0644 extra/systemd/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
# Compatibility with old init script, prefer systemd overrides now
sed -i '/^ExecStart/a EnvironmentFile=-%{_sysconfdir}/sysconfig/%{name}' %{buildroot}%{_unitdir}/%{name}.service

a0935cbf Ewoud Kohl van Wijngaarden
install -Dp -m0644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf
56359a99 Dominic Cleal
install -Dp -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
b4b276f3 Dominic Cleal
df7e3a60 Stephen Benjamin
mkdir -p %{buildroot}%{_sbindir}
install -m 0755 sbin/foreman-prepare-realm %{buildroot}%{_sbindir}/foreman-prepare-realm
affb1b0a Dominic Cleal
cp -p -r bin extra lib modules Rakefile Gemfile.in smart_proxy.gemspec bundler.d config.ru VERSION %{buildroot}%{_datadir}/%{name}
b4b276f3 Dominic Cleal
chmod a+x %{buildroot}%{_datadir}/%{name}/bin/smart-proxy
rm -rf %{buildroot}%{_datadir}/%{name}/*.rb

# remove all test units from productive release
find %{buildroot}%{_datadir}/%{name} -type d -name "test" |xargs rm -rf

# Move config files to %{_sysconfdir}
install -Dp -m0644 %{confdir}/settings.yml.example %{buildroot}%{_sysconfdir}/%{name}/settings.yml
ln -sv %{_sysconfdir}/%{name}/settings.yml %{buildroot}%{_datadir}/%{name}/config/settings.yml
f4bd4628 Dmitri Dolguikh
install -Dp -m0644 %{confdir}/settings.d/*.example %{buildroot}%{_sysconfdir}/%{name}/settings.d/
rename .example '' %{buildroot}%{_sysconfdir}/%{name}/settings.d/*
85a7dd0e Dominic Cleal
touch %{buildroot}%{_sysconfdir}/%{name}/migration_state
ln -sv %{_sysconfdir}/%{name}/migration_state %{buildroot}%{_datadir}/%{name}/config/migration_state
b4b276f3 Dominic Cleal
# Put logs in %{_localstatedir}/log/%{name}
ln -sv %{_localstatedir}/log/%{name} %{buildroot}%{_datadir}/%{name}/logs

# Link temp directory to system wide temp
ln -sv %{_tmppath} %{buildroot}%{_datadir}/%{name}/tmp

%files
e7754c49 Ewoud Kohl van Wijngaarden
%doc README.md VERSION
%license LICENSE
b4b276f3 Dominic Cleal
%{_datadir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%attr(-,%{name},%{name}) %{_localstatedir}/log/%{name}
42372c8d Dirk Goetz
%attr(-,%{name},%{name}) %{_localstatedir}/spool/%{name}
ba249001 Ewoud Kohl van Wijngaarden
%attr(-,%{name},%{name}) %{_sharedstatedir}/%{name}
a0935cbf Ewoud Kohl van Wijngaarden
%attr(-,%{name},%{name}) %{_rundir}/%{name}
b4b276f3 Dominic Cleal
%attr(-,%{name},root) %{_datadir}/%{name}/config.ru
982e07bc Dominic Cleal
%exclude %{_datadir}/%{name}/bundler.d/development.rb
%exclude %{_datadir}/%{name}/bundler.d/test.rb
%exclude %{_datadir}/%{name}/bundler.d/windows.rb
df7e3a60 Stephen Benjamin
%{_sbindir}/foreman-prepare-realm
65d46d30 Stephen Benjamin
%{_mandir}/man8
b4b276f3 Dominic Cleal
%{_unitdir}/%{name}.service
a0935cbf Ewoud Kohl van Wijngaarden
%{_tmpfilesdir}/%{name}.conf
b79e046b Lukas Zapletal
%{_datadir}/foreman/script/foreman-debug.d/75-foreman-proxy
b4b276f3 Dominic Cleal
%pre
# Add the "foreman-proxy" user and group
getent group foreman-proxy >/dev/null || \
groupadd -r foreman-proxy
getent passwd foreman-proxy >/dev/null || \
abfd8c85 Ewoud Kohl van Wijngaarden
useradd -r -g foreman-proxy -d %{homedir} -s /sbin/nologin -c "Foreman Proxy daemon user" foreman-proxy
f4bd4628 Dmitri Dolguikh
b4b276f3 Dominic Cleal
exit 0

%post
85a7dd0e Dominic Cleal
# Migrate proxy config files
if [ $1 == 2 ]; then
TEMP=$(mktemp -d)
trap "rm -rf $TEMP" EXIT
pushd $TEMP >/dev/null

8e92d8d6 Dominic Cleal
if %{scl_ruby_bin} %{homedir}/extra/migrate_settings.rb -t . > %{_localstatedir}/log/%{name}/migrate_settings.log 2>&1; then
85a7dd0e Dominic Cleal
(
cd result && for f in migration_state settings.yml settings.d/*.yml; do
[ -e "$f" ] && cat $f > %{_sysconfdir}/%{name}/$f
done
)

# from monolithic to split config files
egrep -q '^:settings_directory' %{_sysconfdir}/%{name}/settings.yml || \
sed -i '/^---/ a #replace default location of "settings.d"\n:settings_directory: %{_sysconfdir}/%{name}/settings.d\n' \
%{_sysconfdir}/%{name}/settings.yml
f4bd4628 Dmitri Dolguikh
fi
popd >/dev/null
fi

ba249001 Ewoud Kohl van Wijngaarden
%systemd_post %{name}.service
b4b276f3 Dominic Cleal
%preun
ba249001 Ewoud Kohl van Wijngaarden
%systemd_preun %{name}.service
b4b276f3 Dominic Cleal
%postun
ba249001 Ewoud Kohl van Wijngaarden
%systemd_postun_with_restart %{name}.service
b4b276f3 Dominic Cleal

%changelog
e7754c49 Ewoud Kohl van Wijngaarden
* Thu May 31 2018 Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> - 1.19.0-0.develop
- Bump version to 1.19-develop

61b34a4c Daniel Lobato Garcia
* Mon Aug 28 2017 Daniel Lobato Garcia <me@daniellobato.me> - 1.17.0-0.develop
- Bump version to 1.17-develop
e7754c49 Ewoud Kohl van Wijngaarden
c06d9f42 Eric D. Helms
* Wed Mar 29 2017 Eric D Helms <ericdhelms@gmail.com> - 1.16.0-0.develop
- Bump version to 1.16-develop

5d4e18fe Dominic Cleal
* Tue Dec 06 2016 Dominic Cleal <dominic@cleal.org> - 1.15.0-0.develop
- Bump version to 1.15-develop

d1e331c2 Dominic Cleal
* Wed Sep 07 2016 Dominic Cleal <dominic@cleal.org> - 1.14.0-0.develop
- Bump version to 1.14-develop

d7a23846 Dominic Cleal
* Tue May 31 2016 Dominic Cleal <dominic@cleal.org> - 1.13.0-0.develop
- Bump version to 1.13-develop

31224600 Dominic Cleal
* Fri Feb 19 2016 Dominic Cleal <dominic@cleal.org> - 1.12.0-0.develop
- Bump version to 1.12-develop

421c5513 Dominic Cleal
* Wed Oct 07 2015 Dominic Cleal <dcleal@redhat.com> - 1.11.0-0.develop
- Bump version to 1.11-develop

307fc782 Dominic Cleal
* Fri Jun 26 2015 Dominic Cleal <dcleal@redhat.com> - 1.10.0-0.develop
- Bump version to 1.10-develop

e1348821 Dominic Cleal
* Tue Mar 03 2015 Dominic Cleal <dcleal@redhat.com> - 1.9.0-0.develop
- Bump version to 1.9-develop

de043601 Dominic Cleal
* Tue Oct 28 2014 Dominic Cleal <dcleal@redhat.com> - 1.8.0-0.develop
- Bump version to 1.8-develop

e73052c7 Dominic Cleal
* Mon Aug 11 2014 Dominic Cleal <dcleal@redhat.com> - 1.7.0-0.develop
- Bump version to 1.7-develop

b4b276f3 Dominic Cleal
* Wed Apr 16 2014 Dominic Cleal <dcleal@redhat.com> - 1.6.0-0.develop
- Bump to version 1.6-develop

* Thu Jan 16 2014 Dominic Cleal <dcleal@redhat.com> - 1.5.0-0.develop
- Bump to version 1.5-develop

* Thu Nov 21 2013 Dominic Cleal <dcleal@redhat.com> - 1.4.0-0.develop
- Bump and change versioning scheme (#3712)
- Ship config.ru for running under Passenger

* Thu Sep 05 2013 Lukas Zapletal <lzap+rpm[@]redhat.com> - 1.3.9999-1
- bump to version 1.3-develop
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Wed Jul 03 2013 Dominic Cleal <dcleal@redhat.com> - 1.2.9999-3
- add rubyipmi dependency for BMC support
2df109f1 Dominic Cleal
* Tue Jun 11 2013 Lukas Zapletal <lzap+rpm[@]redhat.com> - 1.2.9999-2
b4b276f3 Dominic Cleal
- fixed service file for systemd
- /etc/sysconfig configuration is no longer in use for systemd
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Thu May 16 2013 Martin Bačovský <mbacovsk@redhat.com> 1.2.9999-1
- added support for building with tito
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Mon Feb 4 2013 shk@redhat.com 1.1-1
- 1.1 final.
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Fri Jan 25 2013 shk@redhat.com 1.1RC3-1
- Updated to RC3
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Wed Jan 09 2013 shk@redhat.com 1.1RC2-1
- Updated to RC2
- Removed net-ping dependency
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Tue Jan 1 2013 shk@redhat.com 1.1RC1-1
- Update to 1.1RC1
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Thu Aug 30 2012 jmontleo@redhat.com 1.0.0-3
- Update to include up to 330dbef353
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Sun Aug 05 2012 jmontleo@redhat.com 1.0.0-2
- Update to pull in fixes
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Mon Jul 23 2012 jmontleo@redhat.com 1.0.0-1
- Update packages for Foreman 1.0 Release.
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Wed Jul 18 2012 jmontleo@redhat.com 1.0.0-0.7
- Updated pacakages for Foreman 1.0 RC5 and Proxy RC2
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Thu Jul 05 2012 jmontleo@redhat.com 1.0.0-0.6
- Fix foreman-release to account for different archs. Pull todays source.
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Wed Jul 04 2012 jmontleo@redhat.com 1.0.0-0.5
- Bump version number for foreman RC3 and build with todays develop branch
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Sun Jul 01 2012 jmontleo@redhat.com 1.0.0-0.4
- Pull todays develop branch
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Fri Jun 29 2012 jmontleo@redhat.com 1.0.0-0.2
- Rebuild with develop branch from today. Hopefully we're really 1.0.0 RC2 this time
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Tue Jun 19 2012 jmontleo@redhat.com 0.5.1-9
- Rebuild with todays develop branch.
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Thu Jun 14 2012 jmontleo@redhat.com 0.5.1-8
- Rebuild with todays develop branch.
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Tue May 08 2012 Jason Montleon <jmontleo@redhat.com> - 0.5.1-1
- update version to match foreman package version
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Wed Dec 28 2011 Ohad Levy <ohadlevy@gmail.com> - 0.3.1
- rebuilt
2df109f1 Dominic Cleal
* Tue Nov 08 2011 Ohad Levy <ohadlevy@gmail.com> - 0.3
b4b276f3 Dominic Cleal
- rebuilt
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Wed Sep 28 2011 Ohad Levy <ohadlevy@gmail.com> - 0.3rc2
- rebuilt
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Sat Sep 10 2011 Ohad Levy <ohadlevy@gmail.com> - 0.3rc1
- rebuilt
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Mon Jun 6 2011 Ohad Levy <ohadlevy@gmail.com> - 0.2
- rebuilt
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Thu May 26 2011 ohadlevy@gmail.com - 0.2rc2-2
- rebuilt
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Thu Feb 24 2011 Ohad Levy <ohadlevy@gmail.com> - 0.1.0rc
- new package built with tito
2df109f1 Dominic Cleal
b4b276f3 Dominic Cleal
* Wed Jan 26 2011 Lukas Zapletal <lzap+git@redhat.com> - 0.1.0
- new package built with tito