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
|
Name: advancedprompt
|
||||||
%define version 1.0
|
Version: 0.1
|
||||||
%define release 1
|
Release: 4%{?dist}
|
||||||
Summary: This is what advancedprompt does.
|
Summary: A coloured prompt for your linux server
|
||||||
Name: %{name}
|
Group: System Environment/Shells
|
||||||
Version: %{version}
|
License: GPL+
|
||||||
Release: %{release}%{?dist}
|
URL: https://www.koozali.org
|
||||||
Source: %{name}-%{version}.tar.gz
|
Source0: coloured.sh
|
||||||
License: GNU GPL version 2
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
Group: SMEserver/addon
|
BuildArch: noarch
|
||||||
BuildRoot: %{_tmppath}/%{name}-buildroot
|
BuildRequires: e-smith-devtools >= 1.13.1-03
|
||||||
Prefix: %{_prefix}
|
|
||||||
BuildArchitectures: noarch
|
|
||||||
BuildRequires: smeserver-devtools
|
|
||||||
Requires: smeserver-release >= 11.0
|
|
||||||
AutoReqProv: no
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
A coloured prompt for your linux server. It will display your username, host.domain and full path of the current dir
|
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]$
|
[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]
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
|
|
||||||
%setup -q
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
perl createlinks
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
|
mkdir -p $RPM_BUILD_ROOT/etc/profile.d
|
||||||
rm -f %{name}-%{version}-filelist
|
install %{SOURCE0} $RPM_BUILD_ROOT/etc/profile.d/
|
||||||
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
|
/bin/rm -f %{name}-%{version}-filelist
|
||||||
> %{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)' \
|
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
cd ..
|
rm -rf $RPM_BUILD_ROOT
|
||||||
rm -rf %{name}-%{version}
|
|
||||||
|
|
||||||
%pre
|
|
||||||
|
|
||||||
%preun
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
|
|
||||||
%postun
|
%preun
|
||||||
#uninstall
|
|
||||||
|
|
||||||
%files -f %{name}-%{version}-filelist
|
%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