%global github_owner rfairley %global github_project console-login-helper-messages # This specfile should be kept updated to follow the Fedora # specfile at https://src.fedoraproject.org/rpms/console-login-helper-messages/blob/master/f/console-login-helper-messages.spec. # (as long as required dependencies are available in el8). Name: console-login-helper-messages Version: 0.16 Release: 1.rhaos4.2%{?dist} Summary: Combines motd, issue, profile features to show system information to the user before/on login License: BSD URL: https://github.com/%{github_owner}/%{github_project} Source0: https://github.com/%{github_owner}/%{github_project}/archive/v%{version}.tar.gz BuildArch: noarch BuildRequires: systemd %{?systemd_requires} Requires: bash systemd %description %{summary}. # TODO: also package console-login-helper-messages-motdgen. # # For now, motdgen is only packaged in Fedora. To package in el8, it will require # equivalents of the below linked patches for setup, selinux-policy, and pam brought # into el8. Once the patches are brought forward, the motdgen parts from the Fedora # specfile can be applied here straightforwardly (https://src.fedoraproject.org/rpms/console-login-helper-messages/blob/master/f/console-login-helper-messages.spec). # # setup: filesystem paths need setting up. # * https://pagure.io/setup/pull-request/14 # * https://pagure.io/setup/pull-request/15 # * https://pagure.io/setup/pull-request/16 # pam: to display motds in /run/motd.d. # * https://github.com/linux-pam/linux-pam/issues/47 # * https://github.com/linux-pam/linux-pam/pull/69 # * https://github.com/linux-pam/linux-pam/pull/76 # selinux-policy: to apply pam_var_run_t contexts: # * https://github.com/fedora-selinux/selinux-policy/pull/244 %package issuegen Summary: Issue generator script showing SSH keys and IP address Requires: console-login-helper-messages Requires: bash systemd setup # systemd-udev: for udev rules Requires: systemd-udev # fedora-release: for /etc/issue.d path # * https://src.fedoraproject.org/rpms/fedora-release/pull-request/64# %if 0%{?fedora} Requires: fedora-release %endif # redhat-release-coreos: for /etc/issue.d path # * https://github.com/openshift/redhat-release-coreos/pull/18 %if 0%{?el8} Requires: redhat-release-coreos %endif # agetty is included in util-linux, which searches /etc/issue.d. # Needed to display issues symlinked from /etc/issue.d. # * https://github.com/karelzak/util-linux/commit/37ae6191f7c5686f1f9a2c3984e2cd9a62764029#diff-15eca7082c3cb16e5ac467f4acceb9d0R54 # * https://github.com/karelzak/util-linux/commit/1fc82a1360305f696dc1be6105c9c56a9ea03f52#diff-d7efd2b3dbb10e54185f001dc21d43db Requires: util-linux >= 2.32-1 %description issuegen %{summary}. %package profile Summary: Profile script showing systemd failed units Requires: console-login-helper-messages Requires: bash systemd setup %description profile %{summary}. %prep %setup -q %build %install # Vendor-scoped directories mkdir -p %{buildroot}%{_prefix}/lib/%{name}/issue.d mkdir -p %{buildroot}/run/%{name}/issue.d mkdir -p %{buildroot}%{_prefix}/share/%{name} mkdir -p %{buildroot}%{_sysconfdir}/%{name}/issue.d # External directories mkdir -p %{buildroot}%{_sysconfdir}/issue.d mkdir -p %{buildroot}%{_sysconfdir}/profile.d mkdir -p %{buildroot}%{_unitdir} mkdir -p %{buildroot}%{_tmpfilesdir} mkdir -p %{buildroot}%{_prefix}/lib/udev/rules.d # issuegen files install -DpZm 0644 usr/lib/systemd/system/%{name}-issuegen.service %{buildroot}%{_unitdir}/%{name}-issuegen.service install -DpZm 0644 usr/lib/tmpfiles.d/%{name}-issuegen-tmpfiles.conf %{buildroot}%{_tmpfilesdir}/%{name}-issuegen.conf install -DpZm 0644 usr/lib/udev/rules.d/90-%{name}-issuegen.rules %{buildroot}%{_prefix}/lib/udev/rules.d/90-%{name}-issuegen.rules install -DpZm 0755 usr/libexec/%{name}/issuegen %{buildroot}%{_libexecdir}/%{name}/issuegen # profile files install -DpZm 0644 usr/lib/tmpfiles.d/%{name}-profile-tmpfiles.conf %{buildroot}%{_tmpfilesdir}/%{name}-profile.conf install -DpZm 0755 usr/share/%{name}/profile.sh %{buildroot}%{_prefix}/share/%{name}/profile.sh # symlinks ln -snf /run/%{name}/40_%{name}.issue %{buildroot}%{_sysconfdir}/issue.d/40_%{name}.issue ln -snf %{_prefix}/share/%{name}/profile.sh %{buildroot}%{_sysconfdir}/profile.d/%{name}-profile.sh %pre # TODO: use tmpfiles_create_package macro for tmpfiles %post %systemd_post %{name}-issuegen.service %preun %systemd_preun %{name}-issuegen.service %postun %systemd_postun_with_restart %{name}-issuegen.service # TODO: %check %files %doc README.md %license LICENSE %dir %{_prefix}/lib/%{name} %dir /run/%{name} %dir %{_prefix}/share/%{name} %dir %{_sysconfdir}/%{name} %files issuegen %{_unitdir}/%{name}-issuegen.service %{_tmpfilesdir}/%{name}-issuegen.conf %{_prefix}/lib/udev/rules.d/90-%{name}-issuegen.rules %{_libexecdir}/%{name}/issuegen %dir %{_prefix}/lib/%{name}/issue.d %dir /run/%{name}/issue.d %{_sysconfdir}/issue.d/40_%{name}.issue %dir %{_sysconfdir}/%{name}/issue.d %files profile %{_prefix}/share/%{name}/profile.sh %{_tmpfilesdir}/%{name}-profile.conf %{_sysconfdir}/profile.d/%{name}-profile.sh %changelog * Fri Jun 21 2019 Robert Fairley - 0.16-1.rhaos4.2 - Update to 0.16 - Stop packaging motdgen, and add note in specfile * Tue Mar 19 2019 Robert Fairley - 0.14-2 - Use redhat-release-coreos instead of redhat-release-coreos-ootpa * Fri Mar 15 2019 Robert Fairley - 0.14-1 - update to latest upstream; fixes to issuegen * Fri Mar 15 2019 Robert Fairley - 0.13-6 - use proper redhat-coreos-release-ootpa subpackage * Fri Mar 15 2019 Robert Fairley - 0.13-5 - update specfile for el8 * Thu Jan 24 2019 Robert Fairley - 0.13-4 - update reviewers.md and manual.md with correct paths * Wed Jan 23 2019 Robert Fairley - 0.13-3 - change generated issue to be scoped in private directory * Wed Jan 23 2019 Robert Fairley - 0.13-2 - change generated motd to be scoped in private directory * Wed Jan 23 2019 Robert Fairley - 0.13-1 - add a symlink for motdgen (quick solution until upstream pam_motd.so changes propagate) * Fri Jan 18 2019 Robert Fairley - 0.12-2 - fix Requires for selinux-policy, add missing Requires for systemd-udev and fedora-release * Wed Jan 16 2019 Robert Fairley - 0.12-1 - fix specfile Source0 to correct github URL * Wed Jan 16 2019 Robert Fairley - 0.11-1 - add reviewers.md, specfile fixes * Wed Jan 16 2019 Robert Fairley - 0.1-12 - add move README.md sections out into a manual, update specfile * Wed Jan 09 2019 Robert Fairley - 0.1-11 - specfile cleanup, go through git commit history to write changelog * Wed Jan 09 2019 Robert Fairley - 0.1-10 - Add license, tidyups * Mon Dec 10 2018 Robert Fairley - 0.1-9 - Add tmpfiles_create_package usage to reproduce coredump * Mon Dec 10 2018 Robert Fairley - 0.1-8 - Remove tmpfiles_create_package usage * Mon Dec 10 2018 Robert Fairley - 0.1-7 - Fix usage of tmpfiles_create_package macro in specfile * Fri Dec 07 2018 Robert Fairley - 0.1-6 - Fix tmpfile symlink paths * Fri Dec 07 2018 Robert Fairley - 0.1-5 - Add [systemd] label to failed units message in profile script * Tue Dec 04 2018 Robert Fairley - 0.1-4 - Minor formatting edits to generated issue and motd * Tue Dec 04 2018 Robert Fairley - 0.1-3 - Remove printing package manager info (rpm-ostree, dnf) * Tue Dec 04 2018 Robert Fairley - 0.1-2 - Add CI with copr - Drop requirement on specifc SELinux version - Various tidyups including filenames * Tue Sep 25 2018 Robert Fairley - 0.1-1 - Initial Package