@ -43,9 +43,15 @@ A binary package for can be constructed for Go with as little as a `control` an
### Control File
The `debian/control` file
The `debian/control` file defines a package's metadata and build-time parameters. Refer to https://www.debian.org/doc/debian-policy/ch-controlfields.html for indepth descriptions of all the available fields. The most minimal file can contain
- control
```
Package: YOUR_PACKAGE_NAME
Version: YOUR_DEBIAN_PACKAGE_VERSION
Architecture: YOUR_TARGET_PROCESSOR_ARCHITECTURE
Maintainer: YOUR_EMAIL(Ex: Your Name <youremail@example.com>)
We will use the debchange tool `dch` to create the first entry in our file. Use `man dch` to learn more about all the options available to you for editing these entries.
Since we did not set envvars for things like our package or maintainer email you will see warnings. Press enter to continue and you will drop into an text editor with a basic template.
output:
```
PACKAGE (VERSION) UNRELEASED; urgency=medium
* Initial release. (Closes: #XXXXXX)
-- toor <toor@toor-runcible> Thu, 26 Jun 2025 14:28:27 -0400
```
Change the contents of this entry as needed and save.
```
foo (0.1.0-1) unstable; urgency=low
* Initial release.
-- me <me@example.com> Thu, 26 Jun 2025 14:28:27 -0400
```
Now we can build the package with `dpkg-deb`. Again see `man dpkg-deb` for more information.
```bash
cd ./dist
dpkg-deb --build foo_0.1.0-1/
pkg-deb: building package 'foo' in 'foo_0.1.0-1.deb'.
```
Change the contents of this entry as needed.
You should now have successfully built a `foo_0.1.0-1.deb` in your ./dist/ directory.
(Reading database ... 217268 files and directories currently installed.)
Removing dirp (0.1.0-1) ...
dpkg: warning: while removing dirp, directory '/usr/local/bin' not empty so not removed
```
```
We can disregard the warning because the package manager is doing what its supposed to. It removed the `/usr/local/bin/foo` and attempts to clean up all directories it may have created in the process. Once it finds existing files in the directory structure it was avoid deleting them.