Last active
April 17, 2020 03:10
Revisions
-
yookoala revised this gist
Apr 17, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Release: %release License: MIT %description %{name} is a simple useless script that echos a message every %{sleep} seconds. %install @@ -25,7 +25,7 @@ tick5 is a simple useless script that echos a message every 5 seconds. %{__cat} <<EOF> %{buildroot}/usr/bin/%{name} #!/bin/bash # say something, with timestamp, every %{sleep} seconds while echo "\$@"; do sleep %{sleep}s done -
yookoala revised this gist
Apr 16, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ # Some metadata required by an RPM package Name: %name Summary: Print a message every %{sleep}s Version: %version Release: %release License: MIT -
yookoala renamed this gist
Apr 16, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
yookoala revised this gist
Apr 16, 2020 . 1 changed file with 13 additions and 3 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ # Variables that can be override on build time. %{!?sleep: %define sleep 5} %{!?name: %define name tick%{sleep}} %{!?version: %define version 0.0} %{!?release: %define release 1} %{!?systemdinstalldir: %define systemdinstalldir /etc/systemd/system} @@ -18,9 +19,18 @@ tick5 is a simple useless script that echos a message every 5 seconds. %install # create the executable from scratch in buildroot. %{__mkdir} -p %{buildroot}%{_prefix}/bin %{__cat} <<EOF> %{buildroot}/usr/bin/%{name} #!/bin/bash # say something, with timestamp, every 5 seconds while echo "\$@"; do sleep %{sleep}s done EOF %{__chmod} 755 %{buildroot}%{_prefix}/bin/%{name} # generate the systemd unit file to buildroot. -
yookoala created this gist
Apr 16, 2020 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ # Variables that can be override on build time. %{!?name: %define name tick5} %{!?version: %define version 0.0} %{!?release: %define release 1} %{!?systemdinstalldir: %define systemdinstalldir /etc/systemd/system} %{!?message: %define message come on, James} # Some metadata required by an RPM package Name: %name Summary: Print a message every 5s Version: %version Release: %release License: MIT %description tick5 is a simple useless script that echos a message every 5 seconds. %install # copy the executable to buildroot. %{__mkdir} -p %{buildroot}%{_prefix}/bin %{__cp} -pdf tick5 %{buildroot}%{_prefix}/bin/%{name} %{__chmod} 755 %{buildroot}%{_prefix}/bin/%{name} # generate the systemd unit file to buildroot. %{__mkdir} -p %{buildroot}%{systemdinstalldir} %{__cat} <<EOF> %{buildroot}%{systemdinstalldir}/%{name}.service [Unit] [Install] WantedBy=multi-user.target [Service] ExecStart=%{_prefix}/bin/%{name} %{message} Restart=always RestartSec=5 StandardOutput=syslog StandardError=syslog SyslogIdentifier=%n EOF %files %{_prefix}/bin/%{name} %{systemdinstalldir}/%{name}.service