I'm adding pkgbuilds to many of my company's internal projects so it is easy to
install->edit->reinstall on Arch. I'm having a problem making it simple to use
makepkg in an idempotent manner. This is the workflow I was hoping for:
> git clone project > cd project > # Make edits to project sources in ./src > makepkg -csif > # Make some more edits to project sources in ./src > makepkg -csif > # See changes in installed binaries
However, after the first run of makepkg, ./src is deleted, so we can't edit the
local sources anymore. This happens because the -c flag of makepkg tells it to
clean up after itself, and makepkg assumes it owns the ./src directory so it
I was hoping that I could do something in pkgbuild to change the SRCDEST so
that people making/installing our packages can run the above commands and have
the package install, and leave the git repository clean.
Here are some solutions I've though of:
- Set SRCDEST in makepkg.conf. Hard to guarantee all Arch installs will have
this set correctly.
- Don't use -c flag. Requires manually removing ./pkg.
- Rename my src dir something else. Changing project structure to make one
distro's packaging stack happy seems wrong.
- Manually use git to restore the files.
- Script to call makepkg/pacman so it ibuilds/installs, leaves ./src alone, and deletes ./pkg when done.
Is there any other way I can use pkgbuild/makepkg to build and install a
project without leaving/removing files in the project directory?