Penguin talkback written in Linux for Linux
-----------------------------------------------
< I am a talking penguin, written in Linux for >
< Linux. Does anyone want a blueberry bagel? >
-----------------------------------------------
\ \
\\
\ ,——.
( @ o)
| 7 |
/ / \\
( > < )
/ \_ _/ \
\____) (___/
This is a guide to create an installer package for the penguinsay command on:
- Arch (Manjaro, Black Arch, et al)
- Debian (Ubuntu, Kali, Mint, et al)
- RPM (OpenSUSE, RedHat/CentOS, Fedora, et al)
Working examples for each already resides in this repository
| Arch :$ (& Manjaro, Black Arch)
git clone https://github.com/JesseSteele/penguinsay.git
cd penguinsay/arch
makepkg -si| Debian :$ (& Ubuntu, Kali, Mint)
git clone https://github.com/JesseSteele/penguinsay.git
cd penguinsay/deb
dpkg-deb --build penguinsay
sudo dpkg -i penguinsay.deb| RedHat/CentOS :$ (& Fedora)
git clone https://github.com/JesseSteele/penguinsay.git
sudo dnf update
sudo dnf install rpm-build rpmdevtools
cp -rf penguinsay/rpm/rpmbuild ~/
rpmbuild -ba ~/rpmbuild/SPECS/penguinsay.spec
ls ~/rpmbuild/RPMS/noarch/
sudo rpm -i ~/rpmbuild/RPMS/noarch/penguinsay-1.0.0-1.noarch.rpm # Change filename if needed
rm -rf ~/rpmbuild| OpenSUSE :$ (& Tumbleweed)
git clone https://github.com/JesseSteele/penguinsay.git
cd penguinsay/rpm
sudo zypper update
sudo zypper install rpm-build rpmdevtools
cp -r rpmbuild ~/
rpmbuild -ba ~/rpmbuild/SPECS/penguinsay.spec
ls ~/rpmbuild/RPMS/noarch/
sudo rpm -i ~/rpmbuild/RPMS/noarch/penguinsay-1.0.0-1.noarch.rpm # Change filename if needed
rm -rf ~/rpmbuildInstructions explain each in detail to create these packages from scratch...
- These instructions presume you can access penguinsay.sh
Arch package directory structure:
| arch/ :
arch/
├─ penguinsay.sh
└─ PKGBUILD
- Create directory:
arch - In
arch/create file:PKGBUILD
| arch/PKGBUILD :
# Maintainer: Jesse Steele <codes@jessesteele.com>
pkgname=penguinsay
pkgver=1.0.0
pkgrel=1
pkgdesc="Penguin talkback written in Linux for Linux"
url="https://github.com/JesseSteele/penguinsay"
#arch=('x86_64')
arch=('any')
license=('GPL')
depends=('bash') # Dependency on bash package
#source=("$pkgname-$pkgver.sh")
source=("$pkgname.sh")
# sha256sums=('SKIP') # Can use this
sha256sums=('3641df922945015a4bf5477947048239fa71795f1fe2d2b3f28c34d8c7214dd5')
package() {
cd "$srcdir"
install -Dm755 "$srcdir/$source" "$pkgdir/usr/bin/$pkgname"
}
- Place file
penguinsay.shin the same directory asPKGBUILD - Build package:
- Navigate to directory
arch/ - Run this, then the package will be built, then installed with
pacman:
- Navigate to directory
| Build & install Arch package :$ (in one command)
makepkg -si- Use this to build and install in two steps:
| Build, then install Arch package :$ (first line produces the .pkg.tar.zst file for repos or manual install)
makepkg
sudo pacman -U penguinsay-1.0.0-1-any.pkg.tar.zst- Special notes about Arch:
- We don't need to resolve any dependencies, we can omit the
-sflag withmakepkg- This package only needs
bashas a dependency, which should already be installed merely to execute the scriptdepends=('bash')is redundant and only serves as an example inPKGBUILD
- This package only needs
- The name of the directory containing the package files does not matter
PKGBUILDis the instruction file, not a directory as might be expected with other package buildersmakepkgmust be run from the same directory containingPKGBUILD- The
.pkg.tar.zstfile will appear inside the containing directory
- We don't need to resolve any dependencies, we can omit the
| Remove Arch package :$ (optional)
sudo pacman -R penguinsayDebian package directory structure:
| deb/ :
deb/
└─ penguinsay/
├─ DEBIAN/
│ └─ control
└─ usr/
└─ local/
└─ bin/
└─ penguinsay
- Create directories:
deb/penguinsay/DEBIAN - In
DEBIAN/create file:control
| deb/penguinsay/DEBIAN/control :
Package: penguinsay
Version: 1.0.0
Section: games
Priority: optional
#Architecture: amd64
Architecture: all
Maintainer: Jesse Steele <codes@jessesteele.com>
Depends: bash (>= 4.0)
Description: Penguin talkback written in Linux for Linux
- Create directories:
deb/penguinsay/usr/local/bin/ - Rename and place file
penguinsay.shatdeb/penguinsay/usr/local/bin/penguinsay- Make it executable with :$
chmod +x deb/penguinsay/usr/local/bin/penguinsay
- Make it executable with :$
- Build package:
- Navigate to directory
deb/ - Run this, then the package will be built, then installed:
- Navigate to directory
| Build, then install Debian package :$
dpkg-deb --build penguinsay # Create the .deb package
sudo dpkg -i penguinsay.deb # Install the package- Special notes about Debian
- The script file at
usr/local/bin/penguinsaymust be pre-named and already executable- This is because this installer does not use a
postinstscript like some.debpackages may - This package simply places the files as they appear in the
DEBIAN/directory
- This is because this installer does not use a
- Debian packages require files to be named and at locations like
usr/local/bin/penguinsay- This defines where they will be installed to relative to
/on the machine
- This defines where they will be installed to relative to
- The directory of the package files (
penguinsay/) will be the same as the package installer's.debbasename - The package installer will appear at
penguinsay.debin the same directory as (penguinsay/) regardless of the PWD from where thedpkg-deb --buildcommand was run- For
deb/penguinsayit will be atdeb/penguinsay.deb
- For
- The script file at
| Remove Debian package :$ (optional)
sudo apt-get remove penguinsayRPM package directory structure:
| rpm/ :
rpm/
└─ rpmbuild/
├─ SPECS/
│ └─ penguinsay.spec
└─ SOURCES/
└─ penguinsay.sh
- Create directories:
rpm/rpmbuild/SPECS - In
SPECS/create file:penguinsay.spec
| rpm/rpmbuild/SPECS/penguinsay.spec :
Name: penguinsay
Version: 1.0.0
Release: 1%{?dist}
Summary: The talking penguin
License: GPL
URL: https://github.com/JesseSteele/penguinsay
BuildArch: noarch
Requires: bash
%description
Penguin talkback written in Linux for Linux
%prep
echo "####################################################
We are creating the talking penguin RPM installer...
Other commands could go here...
####################################################"
%build
# We could put some commands here if we needed to build from source
%install
mkdir -p %{buildroot}/usr/bin
install -m 755 %{_sourcedir}/penguinsay.sh %{buildroot}/usr/bin/penguinsay
%files
/usr/bin/penguinsay
%changelog
* Thu Jan 01 1970 Jesse Steele <codes@jessesteele.com> - 1.0.0-1
- Something started, probably with v1.0.0-1
- Create directory:
rpm/rpmbuild/SOURCES/ - Place file
penguinsay.shin directoryrpm/rpmbuild/SOURCES/ - Install the
rpm-buildandrpmdevtoolspackages
| RedHat/CentOS :$
sudo dnf update
sudo dnf install rpm-build rpmdevtools| OpenSUSE :$
sudo zypper update
sudo zypper install rpm-build rpmdevtools- Build package:
- Navigate to directory
rpm/ - Run the following commands:
- Navigate to directory
| Build, then install RPM package :$
cp -r rpmbuild ~/
rpmbuild -ba ~/rpmbuild/SPECS/penguinsay.spec # Create the .rpm package
ls ~/rpmbuild/RPMS/noarch/ # Check the .rpm filename
sudo rpm -i ~/rpmbuild/RPMS/noarch/penguinsay-1.0.0-1.noarch.rpm # Install the package (filename may be different)- Special notes about RPM:
- RPM requires the build be done from
~/rpmbuild/ - The resulting
.rpmfill will be at:~/rpmbuild/RPMS/noarch/penguinsay-1.0.0-1.noarch.rpm- This file might actually have a different name, but should be in the same directory (
~/rpmbuild/RPMS/noarch/)
- This file might actually have a different name, but should be in the same directory (
noarchmeans it works on any architecture- This part of the filename was set in the
.specfile withBuildArch: noarch
- This part of the filename was set in the
- If you get
changelogorbad dateerror, then consider yourself normal
- RPM requires the build be done from
| Remove RedHat/CentOS package :$ (optional)
sudo dnf remove penguinsay| Remove OpenSUSE package :$ (optional)
sudo zypper remove penguinsay