#4 specfile: Update to v0.19
Merged 3 years ago by pbrobinson. Opened 3 years ago by kfan.
Unknown source master  into  master

@@ -2,8 +2,8 @@

  %global github_project  console-login-helper-messages

  

  Name:           console-login-helper-messages

- Version:        0.18.2

- Release:        2%{?dist}

+ Version:        0.19

+ Release:        1%{?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}
@@ -59,8 +59,10 @@

  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

+ # systemd-udev: for displaying IP info using udev

+ # NetworkManager: for displaying IP info using NetworkManager dispatcher script

+ # NetworkManager is recommended as it supports complex/custom networking devices

+ Requires:       (NetworkManager or systemd-udev)

  # fedora-release: for /etc/issue.d path

  #   * https://src.fedoraproject.org/rpms/fedora-release/pull-request/64#

  Requires:       fedora-release
@@ -87,47 +89,7 @@

  %build

  

  %install

- 

- # Vendor-scoped directories

- mkdir -p %{buildroot}%{_prefix}/lib/%{name}/issue.d

- mkdir -p %{buildroot}%{_prefix}/lib/%{name}/motd.d

- mkdir -p %{buildroot}/run/%{name}/issue.d

- mkdir -p %{buildroot}/run/%{name}/motd.d

- mkdir -p %{buildroot}%{_prefix}/share/%{name}

- mkdir -p %{buildroot}%{_sysconfdir}/%{name}/issue.d

- mkdir -p %{buildroot}%{_sysconfdir}/%{name}/motd.d

- 

- # External directories

- mkdir -p %{buildroot}%{_sysconfdir}/issue.d

- mkdir -p %{buildroot}%{_sysconfdir}/motd.d

- mkdir -p %{buildroot}%{_sysconfdir}/profile.d

- mkdir -p %{buildroot}%{_unitdir}

- mkdir -p %{buildroot}%{_tmpfilesdir}

- mkdir -p %{buildroot}%{_prefix}/lib/udev/rules.d

- 

- # common files

- install -DpZm 0644 usr/lib/tmpfiles.d/%{name}-tmpfiles.conf %{buildroot}%{_tmpfilesdir}/%{name}.conf

- 

- # issuegen files

- install -DpZm 0644 usr/lib/systemd/system/%{name}-issuegen.service %{buildroot}%{_unitdir}/%{name}-issuegen.service

- install -DpZm 0644 usr/lib/systemd/system/%{name}-issuegen.path %{buildroot}%{_unitdir}/%{name}-issuegen.path

- 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

- 

- # motdgen files

- install -DpZm 0644 usr/lib/systemd/system/%{name}-motdgen.service %{buildroot}%{_unitdir}/%{name}-motdgen.service

- install -DpZm 0644 usr/lib/systemd/system/%{name}-motdgen.path %{buildroot}%{_unitdir}/%{name}-motdgen.path

- install -DpZm 0644 usr/lib/tmpfiles.d/%{name}-motdgen-tmpfiles.conf %{buildroot}%{_tmpfilesdir}/%{name}-motdgen.conf

- install -DpZm 0755 usr/libexec/%{name}/motdgen %{buildroot}%{_libexecdir}/%{name}/motdgen

- 

- # 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

+ make install DESTDIR=%{buildroot}

  

  %pre

  %tmpfiles_create_package %{name} usr/lib/tmpfiles.d/%{name}-tmpfiles.conf
@@ -136,54 +98,62 @@

  %tmpfiles_create_package %{name}-profile usr/lib/tmpfiles.d/%{name}-profile-tmpfiles.conf

  

  %post

- %systemd_post %{name}-issuegen.service

  %systemd_post %{name}-issuegen.path

- %systemd_post %{name}-motdgen.service

  %systemd_post %{name}-motdgen.path

+ %systemd_post %{name}-gensnippet-os-release.service

+ %systemd_post %{name}-gensnippet-ssh-keys.service

  

  %preun

- %systemd_preun %{name}-issuegen.service

  %systemd_preun %{name}-issuegen.path

- %systemd_preun %{name}-motdgen.service

  %systemd_preun %{name}-motdgen.path

+ %systemd_preun %{name}-gensnippet-os-release.service

+ %systemd_preun %{name}-gensnippet-ssh-keys.service

  

  %postun

- %systemd_postun_with_restart %{name}-issuegen.service

  %systemd_postun_with_restart %{name}-issuegen.path

- %systemd_postun_with_restart %{name}-motdgen.service

  %systemd_postun_with_restart %{name}-motdgen.path

+ %systemd_postun_with_restart %{name}-gensnippet-os-release.service

+ %systemd_postun_with_restart %{name}-gensnippet-ssh-keys.service

  

  # TODO: %check

  

  %files

  %doc README.md

- %doc manual.md

+ %doc doc/manual.md

  %license LICENSE

  %dir %{_libexecdir}/%{name}

  %dir %{_prefix}/lib/%{name}

- %dir /run/%{name}

  %dir %{_prefix}/share/%{name}

  %dir %{_sysconfdir}/%{name}

  %{_tmpfilesdir}/%{name}.conf

+ %{_prefix}/lib/%{name}/libutil.sh

  

  %files issuegen

  %{_unitdir}/%{name}-issuegen.service

  %{_unitdir}/%{name}-issuegen.path

+ %{_unitdir}/%{name}-gensnippet-ssh-keys.service

  %{_tmpfilesdir}/%{name}-issuegen.conf

- %{_prefix}/lib/udev/rules.d/90-%{name}-issuegen.rules

+ # Udev rules are not installed by default. 

+ # %%{_prefix}/lib/udev/rules.d/90-%%{name}-gensnippet_if.rules

+ %{_sysconfdir}/NetworkManager/dispatcher.d/90-%{name}-gensnippet_if

+ %{_prefix}/lib/%{name}/issuegen.defs

  %{_libexecdir}/%{name}/issuegen

- %dir %{_prefix}/lib/%{name}/issue.d

- %dir /run/%{name}/issue.d

+ %{_libexecdir}/%{name}/gensnippet_ssh_keys

+ %{_libexecdir}/%{name}/gensnippet_if

+ %{_libexecdir}/%{name}/gensnippet_if_udev

  %{_sysconfdir}/issue.d/40_%{name}.issue

+ %dir %{_prefix}/lib/%{name}/issue.d

  %dir %{_sysconfdir}/%{name}/issue.d

  

  %files motdgen

  %{_unitdir}/%{name}-motdgen.service

  %{_unitdir}/%{name}-motdgen.path

+ %{_unitdir}/%{name}-gensnippet-os-release.service

  %{_tmpfilesdir}/%{name}-motdgen.conf

+ %{_prefix}/lib/%{name}/motdgen.defs

  %{_libexecdir}/%{name}/motdgen

+ %{_libexecdir}/%{name}/gensnippet_os_release

  %dir %{_prefix}/lib/%{name}/motd.d

- %dir /run/%{name}/motd.d

  %dir %{_sysconfdir}/%{name}/motd.d

  

  %files profile
@@ -192,6 +162,12 @@

  %{_sysconfdir}/profile.d/%{name}-profile.sh

  

  %changelog

+ * Tue Sep 08 2020 Kelvin Fan <kfan@redhat.com> - 0.19-1

+ - Update to 0.19

+ - Invoke make install

+ - Remove -motdgen.service, -issuegen.service presets

+ - Require NetworkManager or systemd-udev

+ 

  * Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.18.2-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

  

To prepare for adding kola external tests, the Makefile now has
the install target. Let specfile use make install to avoid having
multiple sources of truth.

This was accompanied by some re-organization of the repo upstream? It might be worth linking to those commits (or PR) in the commit message here.

One thing using make install does is it might make things a little more brittle when we implement https://github.com/coreos/console-login-helper-messages/issues/7 and https://github.com/coreos/console-login-helper-messages/issues/60. For a period of time we'll be able to use those in Fedora, but not in RHEL, so we might have to add some other switch to make install to make it install files in a different location for one vs the other. Either way this is a net win, but it's something to keep in mind.

For my understanding, why does make install make things more brittle when we implement https://github.com/coreos/console-login-helper-messages/issues/7 and https://github.com/coreos/console-login-helper-messages/issues/60? My understanding is that motdgen/issuegen take care of where the generated snippets are located.

I could be wrong, but I assumed the set of files we create would be then be slightly different for Fedora vs RHEL and if we hoisted that logic up into the Makefile (upstream) then we'd need to handle it there.

If I am wrong, then just ignore me 😜

rebased onto 79e2b6d

3 years ago

rebased onto f09be04

3 years ago

Tested locally and the changes LGTM.

Built fine locally and was able to include in dev FCOS build without issue. :thumbsup:

Pull-Request has been merged by pbrobinson

3 years ago