Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabelo Magagula committed Aug 26, 2019
1 parent a64c94e commit 4d31cce
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# RPMPackageBuilder
A script to build an RPM package
An RPM package builder.
11 changes: 11 additions & 0 deletions create_rpm_package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

if [ ! -d "~/rpmbuild" ]
then
rpmdev-setuptree
rpmbuild -ba file-installer.spec
mv ./rpmbuild/RPMS/x86_64/file-installer-1-1.x86_64.rpm .
else
rpmbuild -ba file-installer.spec
mv ./rpmbuild/RPMS/x86_64/file-installer-1-1.x86_64.rpm .
fi
28 changes: 28 additions & 0 deletions file-installer.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Name: file-installer
Version: 1
Release: 1
Summary: Simple RPM package to install a file in /etc directory
License: MIT License

%description
This is a simple RPM package that installs a file in /etc directory.

%prep
# Nothing to prep, no source code.

%build
DATE_TIME=$(date)
HOSTNAME=$(hostname)
PRINT_DATE_TIME=$(echo "Installation date/time: $DATE_TIME")
PRINT_HOSTNAME=$(echo "Hostname: $HOSTNAME")
echo $PRINT_DATE_TIME > challenge
echo $PRINT_HOSTNAME >> challenge

%install
mkdir -p %{buildroot}/etc
install -m 664 challenge %{buildroot}/etc/challenge

%files
/etc/challenge

%changelog

0 comments on commit 4d31cce

Please sign in to comment.