Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how do you do DESTDIR, it's necessary for packaging #33

Open
SolarAquarion opened this issue Mar 15, 2018 · 13 comments
Open

how do you do DESTDIR, it's necessary for packaging #33

SolarAquarion opened this issue Mar 15, 2018 · 13 comments

Comments

@SolarAquarion
Copy link

No description provided.

@refi64
Copy link
Contributor

refi64 commented Mar 15, 2018

@SolarAquarion This is how to change the installation directory and installation prefix from fbuildroot.py:

def build(ctx):
    ctx.install_destdir = 'the/target/installation/directory'
    ctx.install_prefix = '/usr/not-actually-local'

Of course, you probably don't want to have to edit your build script in order to set the installation directory. In other to allow it to be passed over the command line (e.g. fbuild --destdir=some-path or so), you can do this:

def arguments(parser):
    group = parser.add_argument_group('config options')
    group.add_argument('--destdir', help='Set the installation destdir', default='/')
    group.add_argument('--prefix', help='Set the installation prefix', default='usr')
    # Other arguments go here.

def build(ctx):
    ctx.install_destdir = ctx.options.destdir
    ctx.install_prefix = ctx.options.prefix

This is described in the manual here. A full example in one of my own projects is here.

Does that answer your question?

(Also, out of curiosity, how exactly did you come about this question?)

@SolarAquarion
Copy link
Author

SolarAquarion commented Mar 15, 2018 via email

@SolarAquarion
Copy link
Author

SolarAquarion commented Mar 15, 2018 via email

@refi64
Copy link
Contributor

refi64 commented Mar 15, 2018

@SolarAquarion In that case, it depends on the project you're trying to package adding that argument... What project are you trying to package?

Also, I saw the Arch Linux package, and it looks great!

@SolarAquarion
Copy link
Author

SolarAquarion commented Mar 15, 2018 via email

@SolarAquarion
Copy link
Author

SolarAquarion commented Mar 15, 2018 via email

@SolarAquarion
Copy link
Author

SolarAquarion commented Mar 15, 2018 via email

@refi64
Copy link
Contributor

refi64 commented Mar 16, 2018

That's a good point...

Anyhow, I added --destdir and --prefix to uterm in the latest commit. I'll leave this open for some pondering on how to solve this more generically.

@SolarAquarion
Copy link
Author

SolarAquarion commented Mar 16, 2018 via email

@refi64
Copy link
Contributor

refi64 commented Mar 17, 2018

@SolarAquarion Whoops, sorry...I wasn't actually installing anything yet...

You should be able to just do fbuild install --release --destdir="$pkgdir" --prefix=/usr now.

@SolarAquarion
Copy link
Author

aceback (most recent call last):
File "/bin/fbuild", line 11, in
load_entry_point('fbuild==0.2', 'console_scripts', 'fbuild')()
File "/usr/lib/python3.6/site-packages/fbuild/main.py", line 193, in main
result = build(ctx)
File "/usr/lib/python3.6/site-packages/fbuild/main.py", line 121, in build
install_files(ctx)
File "/usr/lib/python3.6/site-packages/fbuild/main.py", line 77, in install_files
installer.install()
File "/usr/lib/python3.6/site-packages/fbuild/install.py", line 187, in install
self._install(commander)
File "/usr/lib/python3.6/site-packages/fbuild/install.py", line 131, in _install
commander.install(file, target, perms)
File "/usr/lib/python3.6/site-packages/fbuild/install.py", line 29, in install
file.copy(target)
File "/usr/lib/python3.6/site-packages/fbuild/path.py", line 150, in copy
return shutil.copy(self, dst)
File "/usr/lib/python3.6/shutil.py", line 241, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.6/shutil.py", line 121, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: Path('/usr/bin/uterm')

@refi64
Copy link
Contributor

refi64 commented Apr 7, 2018

@SolarAquarion Sorry for the delay, but yeah, that one's definitely a bug. (Seems to be somewhere in path manipulation...) You can try fbuild install --release --destdir="$pkgdir" --prefix=usr as a workaround (notice I dropped the leading / off of --prefix's value).

@SolarAquarion
Copy link
Author

SolarAquarion commented Apr 7, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants