The goal is to create a package that simply puts the shell of the script where I want.
Create a directory to create your packages. Some use deb, while others use packages. Others create a directory structure to create multiple packages under "deb" (or something else).
mkdir deb
Create a directory structure in deb that represents where you want to place the script 1
mkdir -p./deb/usr/local/bin
3. Copy the script to the new directory
cp /path/to/my/script/myscript.sh ./deb/usr/local/bin/
4. Create a subdirectory called "DEBIAN", it will store the package management file.
mkdir -p ./deb/DEBIAN
Create a control file.
touch ./deb/DEBIAN/control
5. Open the control file and enter the text below.
Package: myPackagename (no spaces or underscores allowed)
Priority: optional Section:
misc Maintainer: Maintainer Name <user@mail.com>
Architecture: all Version: 1.0
Depends: package1, package2, ......... Description: short description here long description here (don't remove space at the beginning of line) (replace this with an empty line)
Change ownership: sudo chown -R root:root ./deb
6. Create the debian package.
dpkg -b ./deb /my/output/destination/packagename.deb
source
share