generated from smedev/Template-for-SMEServer-Contribs-Package
* Wed Feb 24 2021 Jean-Philipe Pialasse <tests@pialasse.com> 0.1-4.sme
- fix domain name displayed twice \H to \h [SME: 11389]
This commit is contained in:
0
additional/.gitignore
vendored
0
additional/.gitignore
vendored
@@ -1,57 +1,50 @@
|
||||
%define name advancedprompt
|
||||
%define version 1.0
|
||||
%define release 1
|
||||
Summary: This is what advancedprompt does.
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}%{?dist}
|
||||
Source: %{name}-%{version}.tar.gz
|
||||
License: GNU GPL version 2
|
||||
Group: SMEserver/addon
|
||||
BuildRoot: %{_tmppath}/%{name}-buildroot
|
||||
Prefix: %{_prefix}
|
||||
BuildArchitectures: noarch
|
||||
BuildRequires: smeserver-devtools
|
||||
Requires: smeserver-release >= 11.0
|
||||
AutoReqProv: no
|
||||
Name: advancedprompt
|
||||
Version: 0.1
|
||||
Release: 4%{?dist}
|
||||
Summary: A coloured prompt for your linux server
|
||||
Group: System Environment/Shells
|
||||
License: GPL+
|
||||
URL: https://www.koozali.org
|
||||
Source0: coloured.sh
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildArch: noarch
|
||||
BuildRequires: e-smith-devtools >= 1.13.1-03
|
||||
|
||||
%description
|
||||
A coloured prompt for your linux server. It will display your username, host.domain and full path of the current dir
|
||||
[myuser@myhost.domain.com:/home/e-smith/files/ibays/Primary]$
|
||||
|
||||
|
||||
%changelog
|
||||
* Day MMMM DD YYYY <brianr@koozali.org> 1.0-1.sme
|
||||
- Initial code - create RPM [SME:99999]
|
||||
|
||||
A coloured prompt for your linux server. It will display your username, host.domain and full path of the current dir
|
||||
[myuser@myhost.domain.com:/home/e-smith/files/ibays/Primary]$
|
||||
%prep
|
||||
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
perl createlinks
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
|
||||
rm -f %{name}-%{version}-filelist
|
||||
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
|
||||
> %{name}-%{version}-filelist
|
||||
#echo "%doc COPYING" >> %{name}-%{version}-filelist
|
||||
#--dir <dir> 'attr(755,user,grp)' \
|
||||
#--file <file> 'attr(755,root,root)' \
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/profile.d
|
||||
install %{SOURCE0} $RPM_BUILD_ROOT/etc/profile.d/
|
||||
/bin/rm -f %{name}-%{version}-filelist
|
||||
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist
|
||||
|
||||
%clean
|
||||
cd ..
|
||||
rm -rf %{name}-%{version}
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%pre
|
||||
|
||||
%preun
|
||||
|
||||
%post
|
||||
|
||||
%postun
|
||||
#uninstall
|
||||
%preun
|
||||
|
||||
|
||||
%files -f %{name}-%{version}-filelist
|
||||
%defattr(-,root,root)
|
||||
%defattr(-,root,root,-)
|
||||
|
||||
%changelog
|
||||
* Wed Feb 24 2021 Jean-Philipe Pialasse <tests@pialasse.com> 0.1-4.sme
|
||||
- fix domain name displayed twice \H to \h [SME: 11389]
|
||||
|
||||
* Sun Oct 18 2020 Brian Read <brianr@bjsystems.co.uk> 0.1-3.sme
|
||||
- Import in SME10 tree [SME: 11041]
|
||||
|
||||
* Mon Nov 20 2017 Jean-Philipe Pialasse <tests@pialasse.com> 0.1-2.sme
|
||||
- added missing # and $
|
||||
|
||||
* Mon Nov 20 2017 Jean-Philipe Pialasse <tests@pialasse.com> 0.1-1.sme
|
||||
- initial release
|
||||
|
8
coloured.sh
Normal file
8
coloured.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
# set prompt: ``username@hostname:/directory $ ''
|
||||
|
||||
PS1="[\[\e[1;32m\]\u\[\e[m\]@\[\e[0;31m\]\h.$(dnsdomainname)\[\e[m\]:\[\e[0;33m\]\w\[\e[m\]]"
|
||||
case `id -u` in
|
||||
0) PS1="${PS1}# ";;
|
||||
*) PS1="${PS1}$ ";;
|
||||
esac
|
||||
|
43
createlinks
43
createlinks
@@ -1,43 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
use esmith::Build::CreateLinks qw(:all);
|
||||
use esmith::Build::Backup qw(:all);
|
||||
|
||||
# our event specific for updating with yum without reboot
|
||||
$event = 'advancedprompt-update';
|
||||
#add here the path to your templates needed to expand
|
||||
#see the /etc/systemd/system-preset/49-koozali.preset should be present for systemd integration on all you yum update event
|
||||
|
||||
# Maybe need ths in here as well:
|
||||
# /etc/dar/DailyBackup.dcf - if backup requested
|
||||
|
||||
foreach my $file (qw(
|
||||
/etc/systemd/system-preset/49-koozali.preset
|
||||
))
|
||||
{
|
||||
templates2events( $file, $event );
|
||||
};
|
||||
#action needed in case we have a systemd unit
|
||||
event_link('systemd-default', $event, '10');
|
||||
event_link('systemd-reload', $event, '50');
|
||||
|
||||
#services we might need to restart
|
||||
#event_services($event, 'xxxx' => 'restart', 'yyyy' => 'restart');
|
||||
|
||||
#Backup contrib files
|
||||
# backup_includes("advancedprompt", qw(
|
||||
# files(s) to be backed up
|
||||
#));
|
||||
|
||||
#Other possible entries:
|
||||
#Server manager entry
|
||||
#panel_link("advancedprompt", 'manager');
|
||||
#Events to advancedprompt
|
||||
#$event = 'advancedprompt-advancedprompt';
|
||||
# safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/advancedprompt");
|
||||
# templates2events("/etc/advancedprompt/advancedprompt.conf", $event);
|
||||
|
||||
|
||||
|
||||
|
||||
|
0
root/.gitignore
vendored
0
root/.gitignore
vendored
Reference in New Issue
Block a user