You are not logged in.

#1 2014-02-26 18:01:23

Registered: 2014-02-26
Posts: 1

change srcdir in pkgbuild so makepkg --c doesn't delete it

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
deletes 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?


#2 2014-02-26 23:51:57

From: New York, USA
Registered: 2009-10-22
Posts: 4,109

Re: change srcdir in pkgbuild so makepkg --c doesn't delete it

- Don't put the PKGBUILD in the root of the repo
- Don't build the package from the git repo, let makepkg clone it's own copy


Board footer

Powered by FluxBB