Blame SPECS/conman.spec

5633cb
Name:               conman
5633cb
Version:            0.2.8
5633cb
Release:            1%{?dist}
5633cb
Summary:            ConMan - The Console Manager
5633cb
5633cb
Group:              Applications/System
5633cb
License:            GPLv3+
5633cb
URL:                https://dun.github.io/conman/
5633cb
Source0:            https://github.com/dun/%{name}/archive/%{name}-%{version}.tar.gz#/%{name}-%{version}.tar.gz
5633cb
Source1:            %{name}.service
5633cb
Source2:            %{name}.logrotate
5633cb
5633cb
BuildRoot:          %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
5633cb
5633cb
Requires:           logrotate
5633cb
Requires(post): systemd-units
5633cb
Requires(preun): systemd-units
5633cb
Requires(postun): systemd-units
5633cb
BuildRequires:      tcp_wrappers
5633cb
BuildRequires:      systemd-units
5633cb
BuildRequires:      freeipmi-devel
5633cb
5633cb
%description
5633cb
ConMan is a serial console management program designed to support a large
5633cb
number of console devices and simultaneous users.  It currently supports
5633cb
local serial devices and remote terminal servers (via the telnet protocol).
5633cb
Its features include:
5633cb
5633cb
  - mapping symbolic names to console devices
5633cb
  - logging all output from a console device to file
5633cb
  - supporting monitor (R/O), interactive (R/W), and
5633cb
    broadcast (W/O) modes of console access
5633cb
  - allowing clients to join or steal console "write" privileges
5633cb
  - executing Expect scripts across multiple consoles in parallel
5633cb
5633cb
%prep
5633cb
%setup -qn %{name}-%{name}-%{version}
5633cb
5633cb
# fix paths
5633cb
sed -i -e 's|lib\/|share\/|g' lib/examples/*.exp
5633cb
5633cb
# fix shebang
5633cb
sed -i -e 's|\/usr\/bin\/env perl|\/usr\/bin\/perl|g' conmen
5633cb
5633cb
5633cb
%build
5633cb
5633cb
# This is a bit rough, it builds as PIE client tool (conman)
5633cb
# in addition to PIEing daemon (conmand). But for finer granularity,
5633cb
# we'd need to patch Makefile.in to make it possible to have different
5633cb
# CFLAGS et al for these two binaries.
5633cb
%ifarch s390 s390x sparcv9 sparc64
5633cb
export PIECFLAGS="-fPIE"
5633cb
%else
5633cb
export PIECFLAGS="-fpie"
5633cb
%endif
5633cb
export RELRO="-Wl,-z,relro,-z,now"
5633cb
5633cb
%configure --with-tcp-wrappers CFLAGS="$CFLAGS $PIECFLAGS $RELRO" CXXFLAGS="$CXXFLAGS $PIECFLAGS $RELRO" LDFLAGS="$LDFLAGS -pie"
5633cb
make %{?_smp_mflags}
5633cb
5633cb
%install
5633cb
rm -rf $RPM_BUILD_ROOT
5633cb
make install DESTDIR=$RPM_BUILD_ROOT
5633cb
# put in our own initscript and logrotate
5633cb
install -D -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
5633cb
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/init.d
5633cb
install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}
5633cb
# make log directories
5633cb
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}
5633cb
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}.old
5633cb
5633cb
# examples don't belong in libdir...
5633cb
rm -rf $RPM_BUILD_ROOT%/usr/lib/%{name}/examples
5633cb
# move scripts to proper place
5633cb
mv $RPM_BUILD_ROOT/usr/lib/%{name} $RPM_BUILD_ROOT%{_datadir}/%{name}
5633cb
5633cb
## these shouldn't be executable
5633cb
#chmod -x $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
5633cb
# rhel7 uses systemd instead of sysV init, /etc/sysconfig/conman
5633cb
# is not used. Remove it to reduce user's confusion:
5633cb
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
5633cb
rmdir $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
5633cb
# adjust perms on main config file
5633cb
chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
5633cb
5633cb
%clean
5633cb
rm -rf "$RPM_BUILD_ROOT"
5633cb
5633cb
%post
5633cb
if [ $1 -eq 1 ] ; then 
5633cb
    # Initial installation 
5633cb
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
5633cb
fi
5633cb
5633cb
%preun
5633cb
if [ $1 -eq 0 ] ; then
5633cb
    # Package removal, not upgrade
5633cb
    /bin/systemctl --no-reload disable conman.service > /dev/null 2>&1 || :
5633cb
    /bin/systemctl stop conman.service > /dev/null 2>&1 || :
5633cb
fi
5633cb
5633cb
%postun
5633cb
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
5633cb
if [ $1 -ge 1 ] ; then
5633cb
    # Package upgrade, not uninstall
5633cb
    /bin/systemctl try-restart conman.service >/dev/null 2>&1 || :
5633cb
fi
5633cb
5633cb
%triggerun -- conman < 0.2.7-1
5633cb
# Save the current service runlevel info
5633cb
# User must manually run systemd-sysv-convert --apply conman
5633cb
# to migrate them to systemd targets
5633cb
/usr/bin/systemd-sysv-convert --save conman >/dev/null 2>&1 ||:
5633cb
5633cb
# Run these because the SysV package being removed won't do them
5633cb
/sbin/chkconfig --del conman >/dev/null 2>&1 || :
5633cb
/bin/systemctl try-restart conman.service >/dev/null 2>&1 || :
5633cb
5633cb
%files
5633cb
%defattr(-,root,root,-)
5633cb
%license COPYING
5633cb
%doc AUTHORS FAQ NEWS
5633cb
%doc lib/examples
5633cb
%config(noreplace) %{_sysconfdir}/%{name}.conf
5633cb
# rhel7 does not use this file:
5633cb
#%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
5633cb
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
5633cb
%{_unitdir}/%{name}.service
5633cb
%{_localstatedir}/log/%{name}
5633cb
%{_localstatedir}/log/%{name}.old
5633cb
%{_bindir}/*
5633cb
%{_sbindir}/*
5633cb
%{_datadir}/%{name}
5633cb
%{_mandir}/*/*
5633cb
5633cb
%changelog
5633cb
* Tue Aug 29 2017 Ondrej Vasik <ovasik@redhat.com> - 0.2.8-1
5633cb
- updated to 0.2.8, spec cleanups, drop overflow hack(#1435840)
5633cb
5633cb
* Fri May 13 2016 David Sommerseth <davids@redhat.com> - 0.2.7-15
5633cb
- Fix lost CFFLAGS/CXXFLAGS/LDFLAGS from RELRO/PIE fixes in 0.2.7-13 (1092546)
5633cb
5633cb
* Fri May 13 2016 David Sommerseth <davids@redhat.com> - 0.2.7-14
5633cb
- Fix buffer overflow issue triggered by PIE/RELRO builds (1092546)
5633cb
5633cb
* Mon Sep 14 2015 Denys Vlasenko <dvlasenk@redhat.com> - 0.2.7-13
5633cb
- Build executables with RELRO and PIE (1092546)
5633cb
5633cb
* Fri Jul 17 2015 Denys Vlasenko <dvlasenk@redhat.com> - 0.2.7-12
5633cb
- Remove unused /etc/sysconfig/conman.
5633cb
- Resolves: rhbz#1244219.
5633cb
5633cb
* Fri Jul 17 2015 Denys Vlasenko <dvlasenk@redhat.com> - 0.2.7-11
5633cb
- Ensure that num_threads <= IPMICONSOLE_THREAD_COUNT_MAX.
5633cb
- Resolves: rhbz#1244189.
5633cb
5633cb
* Wed Jul  1 2015 Denys Vlasenko <dvlasenk@redhat.com> - 0.2.7-10
5633cb
- Enable IPMI feature.
5633cb
- Resolves: rhbz#1084116.
5633cb
5633cb
* Wed Apr  8 2015 Denys Vlasenko <dvlasenk@redhat.com> - 0.2.7-9
5633cb
- Added commented-out "LimitNOFILE=" directive to conman.service.
5633cb
- This is systemd-esque way to change process limits for serivces.
5633cb
- Also and a comment when to use it.
5633cb
- Resolves: rhbz#1035228.
5633cb
5633cb
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 0.2.7-8
5633cb
- Mass rebuild 2014-01-24
5633cb
5633cb
* Tue Jan  7 2014 Denys Vlasenko <dvlasenk@redhat.com> - 0.2.7-7
5633cb
- Added "BuildRequires: systemd-units" to fix _unitdir expansion.
5633cb
- Resolves: rhbz#1048854.
5633cb
5633cb
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 0.2.7-6
5633cb
- Mass rebuild 2013-12-27
5633cb
5633cb
* Tue May  7 2013 Denys Vlasenko <dvlasenk@redhat.com> - 0.2.7-5
5633cb
- Again fixed "License:" in spec file (GPLv2+ -> GPLv3+).
5633cb
5633cb
* Tue May  7 2013 Denys Vlasenko <dvlasenk@redhat.com> - 0.2.7-4
5633cb
- Forward-porting fixes from RHEL6.
5633cb
- Enlarge buffer used for formatting date in a string format.
5633cb
- Resolves: rhbz#891938.
5633cb
- Allow configuration of the maximum number of open files.
5633cb
- Resolves: rhbz#738967.
5633cb
5633cb
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.7-3
5633cb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
5633cb
5633cb
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.7-2
5633cb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
5633cb
5633cb
* Tue Apr 17 2012 Jon Ciesla <limburgher@gmail.com> - 0.2.7-1
5633cb
- Migrate to systemd, BZ 771474.
5633cb
5633cb
* Sun Apr 15 2012 Steven M. Parrish <smparrish@gmail.com> - 0.2.7-0
5633cb
- New upstream release
5633cb
5633cb
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.5-4
5633cb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
5633cb
5633cb
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.5-3
5633cb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
5633cb
5633cb
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.5-2
5633cb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
5633cb
5633cb
* Mon Jun 08 2009 Steven M. Parrish <tuxbrewr@fedoraproject.org> - 0.2.5-0
5633cb
- New upstream release
5633cb
5633cb
* Mon Apr 20 2009 Steven M. Parrish <tuxbrewr@fedoraproject.org> - 0.2.4.1-1
5633cb
- New upstream release
5633cb
5633cb
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.2-3
5633cb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
5633cb
5633cb
* Mon Oct 06 2008 Jarod Wilson <jarod@redhat.com> 0.2.2-2
5633cb
- The console option in conman.conf is case-insensitive, so relax
5633cb
  defined consoles check in initscript (Mark McLoughlin, #465777)
5633cb
5633cb
* Mon Sep 08 2008 Steven M. Parrish <smparrish@shallowcreek.net> 0.2.2-1
5633cb
- New upstream release
5633cb
5633cb
* Fri May 02 2008 Jarod Wilson <jwilson@redhat.com> 0.2.1-1
5633cb
- New upstream release
5633cb
5633cb
* Wed Feb 13 2008 Jarod Wilson <jwilson@redhat.com> 0.1.9.2-8
5633cb
- Bump and rebuild for gcc 4.3
5633cb
5633cb
* Thu Apr 26 2007 Jarod Wilson <jwilson@redhat.com> 0.1.9.2-7
5633cb
- Update project urls
5633cb
- Fix up initscript exit codes (#237936)
5633cb
5633cb
* Tue Sep 05 2006 Jarod Wilson <jwilson@redhat.com> 0.1.9.2-6
5633cb
- Bump for new glibc
5633cb
5633cb
* Fri Jul 28 2006 Jarod Wilson <jwilson@redhat.com> 0.1.9.2-5
5633cb
- Properly enable smp_mflags this time
5633cb
5633cb
* Fri Jul 28 2006 Jarod Wilson <jwilson@redhat.com> 0.1.9.2-4
5633cb
- Add Reqs on chkconfig and service
5633cb
- Turn on smp_mflags
5633cb
- Initial build for RHEL5
5633cb
5633cb
* Wed Jul 05 2006 Jarod Wilson <jwilson@redhat.com> 0.1.9.2-3
5633cb
- Add missing condrestart fuction to initscript
5633cb
5633cb
* Tue Jun 27 2006 Jarod Wilson <jwilson@redhat.com> 0.1.9.2-2
5633cb
- Don't strip bins on make install, leave for find-debug.sh
5633cb
5633cb
* Tue Jun 27 2006 Jarod Wilson <jwilson@redhat.com> 0.1.9.2-1
5633cb
- Update to 0.1.9.2
5633cb
5633cb
* Tue Jun 20 2006 Jarod Wilson <jwilson@redhat.com> 0.1.9.1-3
5633cb
- Add Requires: logrotate
5633cb
- Ugh, conmand exits cleanly if no CONSOLE(s) are defined in
5633cb
  /etc/conman.conf, add check to initscript to report failure
5633cb
  if none are defined
5633cb
5633cb
* Wed Jun 14 2006 Jarod Wilson <jwilson@redhat.com> 0.1.9.1-2
5633cb
- Create log directories and install working logrotate config
5633cb
- Use a much cleaner RH/FC-specific initscript
5633cb
5633cb
* Tue Jun 13 2006 Jarod Wilson <jwilson@redhat.com> 0.1.9.1-1
5633cb
- Initial build for Fedora Extras