To get started:
For an arch-based distro, read into AUR for aur-packages.
For redhat based distros, read into specfiles for rpm-packages.
For debian based distros, read into XY? for deb-packages.
If it is binary, requires compiling just prepare a proper config & make "script" (what language are those anyway?) These 2 scripts (if binary) could also be used to install it on the system.
If your projects are just scrips, its worth to think about wether they even require installation, or if you could prepare them better so they dont.
Hope this helps.
If not, share more info.
Environmentvariables, such as XDG_DOWNLOAD_DIR?
They are already saved, you better reuse them, instead of setting them your own.
However, (shared) Variables c/would be safed inside your application, or, less nice, in /etc/profile.d/project-scriptfile-containain-variables.sh
Remember, not every variable must be shared, only a few required ones.
hth