You are not logged in.
Pages: 1
In the creating packages wiki srcdir is described as
srcdir
This points to the directory where makepkg extracts or symlinks all files in the source array.
I've also seen people cd'ing into it in their PKGBUILD. Where exactly is the srcdir? I can't find much describing how exactly we are suppose to use it.
Offline
That cd'ing is not necessary (anymore?), but the documentation was [1] unclear (and some examples used it) so you'll see it a lot.
I'm not exactly sure what else you're asking. The directory is somewhere (usually inside the directory makepkg is started in), the variable $srcdir tells you where this somewhere is (it contains the path) and, as the man page says, makepkg puts all the sources for the package in this directory before running the functions in the PKGBUILD (and these functions execute commands that operate on these source files, which is why they start in $srcdir, so you can use relative paths and `make` finds the Makefile in the current directory etc.).
Offline
So basically $srcdir is your current directory? Do I just forget that it exists and assume i'm working in the $srcdir?
Offline
If there is any doubt, you can always modify the script as an experiment and echo the value of srcdir at the point of interest.
Last edited by ewaller (2015-09-14 23:28:38)
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Do I just forget that it exists
No.
and assume i'm working in the $srcdir?
Yes, if you are inside one of the documented functions in a PKGBUILD. The variable is still useful, if you are cd'ing around in your function and want to quickly back out to the top without counting the levels with "cd ../../../"
Edit: Using the variable is not wrong, so if you like a more verbose style, then you can still start your function with "cd $srcdir/foobar"
Last edited by progandy (2015-09-14 21:28:13)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
So it's basically the root of the packaging directory?
Offline
So it's basically the root of the packaging directory?
Define packaging directory -- that sounds more like $pkgdir.
But as ewaller says, go and experiment. Grab a PKGBUILD, modify it to echo the values of these variables and then also look at the directory structure that makepkg creates.
Offline
Pages: 1