You are not logged in.

#1 2017-02-13 20:49:04

delmadord
Member
Registered: 2015-03-22
Posts: 14

Polishing a package build for ScriptBasic compiler

Hello.
I am trying to make an a AUR package in case I will need to install it in the future again, or someone else will need to use ScriptBasic.

https://aur.archlinux.org/packages/scriptbasic/

The PKGBUILD has multiple problems:

1.) The source tar has some weird permissions, hence the line `sudo chmod -R 755 "scriptbasic"`. Is this a good practice?
2.) The line `sudo ./install.sh` in package() installs the files to the FS even when I am just building it with `makepkg -srf', without the -i switch. How to prevent this?

Any suggestions and improvements are welcome smile Thank You

Offline

#2 2017-02-14 03:48:03

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Polishing a package build for ScriptBasic compiler

Stop using sudo, I guess? I cannot fathom why you would use it on the source files in the first place, as they aren't supposed to be owned by root anyway smile and the actual ./install.sh should be installing the files to "${pkgdir}", e.g. Makefiles are usually given the DESTDIR="${pkgdir}/" directive.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2017-02-14 21:49:01

delmadord
Member
Registered: 2015-03-22
Posts: 14

Re: Polishing a package build for ScriptBasic compiler

Hello Eschwartz.
Thank You for the insights, they are reasonable. I will work them in soon.

Offline

#4 2017-02-22 20:35:53

delmadord
Member
Registered: 2015-03-22
Posts: 14

Re: Polishing a package build for ScriptBasic compiler

Hello.
I removed the sudo from chmod line and it is ok no.

However, please,
how do I trick install.sh to not copy the files into "/" but into "${pkgdir}". The file is generated, doing a .patch that removes all the leading / from all the paths in it is not advisable.

Is there any way around it?

Thanks for any suggestions!

EDIT
I was experimenting with `firejail --overlay ./install.sh` but the install.sh still wants to operate with sudo. I am thinking about rewriting that script to move the data myself into "${pkgdir}" unless someone suggests some more sophisticated method.

Last edited by delmadord (2017-02-22 21:32:45)

Offline

#5 2017-02-23 00:29:32

delmadord
Member
Registered: 2015-03-22
Posts: 14

Re: Polishing a package build for ScriptBasic compiler

Ok so I was able to understand what is going on in that `./install.sh` script and translated it into the `package()` function.

Can you please provide any helpful hints on how to improve the quality of the PKGBUILD further?

Thank You!

Offline

#6 2017-02-23 11:54:08

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,920

Re: Polishing a package build for ScriptBasic compiler

Usually empty directories are left out of $pkgdir and created at first run if needed.
Group the install commands on path used so it's easy to see if you are creating empty directories .

Post the empty directories that are created atm, so we can look into details what to do with them.


Arch packages don't include *.a files by default .
Unless another package doesn't work without that file present, skip it.


/usr/local/ on arch is normally not used by packages, try to figure out where those files should be useful/findable .

https://wiki.archlinux.org/index.php/Ar … irectories

Last edited by Lone_Wolf (2017-02-23 11:54:54)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB