I want to automate the steps of adding the extension to LibreOffice and Firefox. How do I create a package for this?
Creating packages is relatively straight forward. You essentially create a tarball, which could be unpacked at the root of your filesystem (the parallel directory structures), but in addition there is a debian folder, which contains scripts which can be run during the process.
I'm assuming you knew this, so I'm not sure exactly which bit of the process of creating a package, you're unclear on.
Will give you chapter and verse on creating the package
Says putting .xpi files in a certain directory will cause firefox to install them on next startup
Talks about using unopkg to install libreoffice packages from the command line.
If you want hired consultancy to do the grunt work for you, that's a different matter ;-)