You are not logged in.
i'm just created a PKGBUILD and I am about to push it to the aur. So I would like someone to review it for me.
its busybox, but set to allow other users to reboot.
Here is the PKGBUILD.
_pkgname=busybox
pkgname=$_pkgname-norootreboot
pkgver=1.25.0
pkgrel=1
pkgdesc="Utilities for rescue and embedded systems"
arch=("i686" "x86_64")
url="http://www.$_pkgname.net"
license=('GPL')
provides=("$_pkgname")
conflicts=("$_pkgname" "$_pkgname-static")
makedepends=("make" "gcc" "sed" "ncurses")
install=$_pkgname.install
source=(
"$url/downloads/$_pkgname-$pkgver.tar.bz2"
)
md5sums=(
'b05af9645076f75429a8683f8afcbdb3'
)
prepare() {
cd "$_pkgname-$pkgver"
cp ../../halt.c init/halt.c
make clean
make defconfig
}
build() {
cd "$_pkgname-$pkgver"
make
}
package() {
cd "$srcdir/$_pkgname-$pkgver"
install -Dm755 $_pkgname $pkgdir/usr/bin/$_pkgname
}
Here is the line I changed in halt.c
//applet:IF_HALT(APPLET(halt, BB_DIR_SBIN, BB_SUID_MAYBE))
//applet:IF_HALT(APPLET_ODDNAME(poweroff, halt, BB_DIR_SBIN, BB_SUID_MAYBE, poweroff))
//applet:IF_HALT(APPLET_ODDNAME(reboot, halt, BB_DIR_SBIN, BB_SUID_MAYBE, reboot))
Last edited by jcjordyn120 (2016-09-27 16:53:18)
jcjordyn120 on irc.freenode.net #archlinux and #thelinuxgeekcommunity
Offline
That isn't going to work in the AUR, as your changed source file won't be available.
Offline
I'd use a patch for the halt.c file changes (the changes look a bit big for a sed command ).
----------------------------------------
The lines shown below reduce the human readability of the PKGBUILD a lot.
To me that's a bad thing.
It could make automating the writing of multiple PKGBUILDS easier, but i prefer human readability over easy automation.
provides=("$_pkgname")
conflicts=("$_pkgname" "$_pkgname-static")
install -Dm755 $_pkgname $pkgdir/usr/bin/$_pkgname
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
I fixed the PKGBUILD
pkgname=busybox-norootreboot
pkgver=1.25.0
pkgrel=1
pkgdesc="Utilities for rescue and embedded systems"
arch=("i686" "x86_64")
url="http://www.busybox.net"
license=('GPL')
provides=("busybox")
conflicts=("busybox" "busybox-static")
makedepends=("make" "gcc" "sed" "ncurses")
install=busybox-norootreboot.install
source=(
"$url/downloads/busybox-$pkgver.tar.bz2"
"https://raw.githubusercontent.com/jcjordyn130/aur-misc/master/busybox-norootreboot/halt.patch"
"https://raw.githubusercontent.com/jcjordyn130/aur-misc/master/busybox-norootreboot/halt.c"
)
md5sums=('b05af9645076f75429a8683f8afcbdb3'
'b5ab29025a588785ec7888d03e87823c'
'59a2c9ba582c2045630b1f7add482011')
prepare() {
echo $pkgdir
cd "busybox-$pkgver"
patch -p1 -R < ../halt.patch
make clean
make defconfig
}
build() {
cd "busybox-$pkgver"
make
}
package() {
cd "$srcdir/busybox-$pkgver"
install -Dm755 busybox $pkgdir/usr/bin/busybox
}
jcjordyn120 on irc.freenode.net #archlinux and #thelinuxgeekcommunity
Offline
Kind of. Why do you have both the patch and the .c file there? And pulling from Master isn't generally a good idea, if it's just the patch, you could just include it with the PKGBUILD.
Offline
how do you include a patch with the PKGBUILD
Last edited by jcjordyn120 (2016-08-25 03:08:52)
jcjordyn120 on irc.freenode.net #archlinux and #thelinuxgeekcommunity
Offline
Just put it in the same dir as the PKGBUILD, add the filename to the source array, and commit it in git when you commit everything else.
Last edited by Scimmia (2016-08-25 04:17:08)
Offline
The lines shown below reduce the human readability of the PKGBUILD a lot.
To me that's a bad thing.
It could make automating the writing of multiple PKGBUILDS easier, but i prefer human readability over easy automation.provides=("$_pkgname") conflicts=("$_pkgname" "$_pkgname-static")
install -Dm755 $_pkgname $pkgdir/usr/bin/$_pkgname
I consider that perfectly readable...
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
1. I may have phrased it wrong.
I feel that the lines using the value of $_pkgname are easier to understand for humans then the lines with _pkgname in them.
maybe "human understandable" would be clearer ?
2. It's a personal preference.
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
This seems like an aweful lot of work to avoid one line in your sudoers file that would allow the same thing. And perhaps one line in a shellrc file for an alias if you didn't want to have to type 'sudo reboot'.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
1. I may have phrased it wrong.
I feel that the lines using the value of $_pkgname are easier to understand for humans then the lines with _pkgname in them.
maybe "human understandable" would be clearer ?2. It's a personal preference.
No, you phrased it perfectly (in the sense that it correctly described your meaning).
I can assure you I was not nitpicking over the meaning of the word "read".
I just wanted to point out that when you say #1 what you really mean is #2.
Your personal preference is for using the actual value, because you find it awkward to keep track of the variables... other people have no such problem and find $_pkgname to be highly intuitive and easy to follow the meaning of, and therefore prefer to use it.
In fact, I find using the $_pkgname helps keep track of the relationship between the name of the package and the url it is located at (or whatever else it is used for). For the same reason that it helps template the creation of multiple PKGBUILDs.
Using the _pkgname directly instead of the variable, would result in a PKGBUILD which I find more confusing (although still not challenging...).
So I just wanted to express my disinterest in watching you pressure others into following your personal preferences, in a case where neither is objectively preferable.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
The use or non-use of such variables is quite tangential to the current questions. Either is acceptable and functional. So lets stick to the more relevant topics of how to best patch/sed the source or other concrete issues of viability as a AUR package.
If there is more to be said on the use/non-use of such variables, it'd apply to all PKGBUILDs and might be best directed to aur-general, or the talk page of the PKGBUILD wiki.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Clear, Eschwartz.
I'll watch my wording wrt difference between personal preferences and errors more closely.
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
This seems like an aweful lot of work to avoid one line in your sudoers file that would allow the same thing. And perhaps one line in a shellrc file for an alias if you didn't want to have to type 'sudo reboot'.
That's not the point. This is for people who want to reboot without having to be root.
jcjordyn120 on irc.freenode.net #archlinux and #thelinuxgeekcommunity
Offline
No it still needs root access. You are just giving them root access to that function in the init system rather than a shell alias.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
No it still needs root access. You are just giving them root access to that function in the init system rather than a shell alias.
Oh okay then, But still some things need to reboot the system and I don't like to run random things as root.
jcjordyn120 on irc.freenode.net #archlinux and #thelinuxgeekcommunity
Offline
Not random things. ONE thing. I think you may not understand how sudo works. You can specify that a anyone can run a specific command with sudo without a password.
The result would be that any user could reboot without needing a password. They would not be able to run anything else as root though.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Not random things. ONE thing. I think you may not understand how sudo works. You can specify that a anyone can run a specific command with sudo without a password.
The result would be that any user could reboot without needing a password. They would not be able to run anything else as root though.
That one thing is busybox to be exact, also I know how sudo works.
jcjordyn120 on irc.freenode.net #archlinux and #thelinuxgeekcommunity
Offline
Marking as solved
jcjordyn120 on irc.freenode.net #archlinux and #thelinuxgeekcommunity
Offline