You are not logged in.
Hi
I found a very useful Linux utility on GitHub and wanted to port it to arch Linux.
PKGBUILD file:
https://github.com/akhilin/ondir/blob/master/PKGBUILD
Please review and approve it.
Thank you,
Akhil Jalagam
Offline
Please check pkgdesc
Write a proper pkgver function as that one will not work at all
Fix the make install command as that PREFIX will result in a completely broken package: the PREFIX is /usr/bin and DESTDIR should be pkgdir (edit: It looks like this is benign in this case, but it is still incorrect)
Remove the empty or unused variables/arrays
Be sure to install a license with the package, EDIT: ARGH! And use the author's license. You cannot distribute GPLed code under an MIT license. Note that GPL licenses do not need to be distributed with the package if they are properly indicated in the PKGBUILD (reference)
Last edited by Trilby (2019-08-12 14:03:02)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Also, use the upstream URL as the source URL, not your personal fork of it.
Offline
Hi,
Thanks for your suggestions and time.
I resolved all the issues you mentioned. Please check it once.
https://github.com/akhilin/ondir/blob/master/PKGBUILD
Thank you,
Akhil Jalagam
Offline
Write a proper pkgver function as that one will not work at all
Check that again. The upstream repo does not have tags so I would just use the number of revisions since beginning of the history https://wiki.archlinux.org/index.php/VC … elines#Git. Note also that the Makefile says 0.2.3.
Offline
Fixed:
- Version changed to 0.2.3
- Let's use the number of revisions since the beginning.
Updated, Please check:
https://github.com/akhilin/ondir/blob/master/PKGBUILD
Thank you,
Akhil Jalagam
Offline
Great work on the revisions. GPL licenses confuse me a bit with their "version N or later" options, but as the upstream source only indicates version 2, I think the license field should be GPL2
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Fixed:
- updated license to GPL2
Updated, Please check:
https://github.com/akhilin/ondir/blob/master/PKGBUILD
Thank you,
Akhil Jalagam
Offline
I haven't tested it myself as it's not something I'd have a use for - but that now looks like a well written proper PKGBUILD to me.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
I tested it.
$ makepkg
==> Making package: ondir-git 0.2.3-1 (Wednesday 14 August 2019 01:56:26 PM IST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Updating ondir git repo...
Fetching origin
==> Validating source files with md5sums...
ondir ... Skipped
==> Extracting sources...
-> Creating working copy of ondir git repo...
Switched to a new branch 'makepkg'
==> Starting pkgver()...
==> Updated version: ondir-git r13.55279f0-1
==> Removing existing $pkgdir/ directory...
==> Starting build()...
make: 'ondir' is up to date.
==> Entering fakeroot environment...
==> Starting package()...
install -m 755 -d /home/akhil/src/ondir/pkg/ondir-git//usr/share/man/man1
install -m 644 ondir.1 /home/akhil/src/ondir/pkg/ondir-git//usr/share/man/man1
install -m 755 -d /home/akhil/src/ondir/pkg/ondir-git//usr/bin
install -m 755 ondir /home/akhil/src/ondir/pkg/ondir-git//usr/bin
==> Tidying install...
-> Removing libtool files...
-> Purging unwanted files...
-> Removing static library files...
-> Stripping unneeded symbols from binaries and libraries...
-> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "ondir-git"...
-> Generating .PKGINFO file...
-> Generating .BUILDINFO file...
-> Generating .MTREE file...
-> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: ondir-git r13.55279f0-1 (Wednesday 14 August 2019 01:56:28 PM IST)
Offline
Some issues detected by namcap
Checking PKGBUILD
PKGBUILD (ondir-git) W: Missing Maintainer tag
Checking ondir-git-r13.55279f0-1-x86_64.pkg.tar.xz
ondir-git W: ELF file ('usr/bin/ondir') lacks FULL RELRO, check LDFLAGS.
ondir-git E: Dependency glibc detected and not included (libraries ['usr/lib/libc.so.6'] needed in files ['usr/bin/ondir'])
Offline
$ namcap ondir-git-r13.55279f0-1-x86_64.pkg.tar.xz
ondir-git W: ELF file ('usr/bin/ondir') lacks FULL RELRO, check LDFLAGS.
ondir-git E: Dependency glibc detected and not included (libraries ['usr/lib/libc.so.6'] needed in files ['usr/bin/ondir'])
I found this:
It turns like the namcap tool has had a bug and it was fixed a couple of weeks ago. There are no releases with the fix yet.
https://git.archlinux.org/namcap.git/co … 3b5284d25f
Offline
Namcap is great for checking, but it is not the definitive answer. The libc dependency is valid. I almost noted it previously, but I've been confronted by differing views given that libc is a dependency of pacman/makepkg it's a given that it's already installed. I don't find that logic compelling and I'd prefer that glibc was listed, but it is an argument that is regularly made.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
namcap ondir-git-r13.55279f0-1-x86_64.pkg.tar.xz
ondir-git W: ELF file ('usr/bin/ondir') lacks FULL RELRO, check LDFLAGS.
ondir-git E: Dependency glibc detected and not included (libraries ['usr/lib/libc.so.6'] needed in files ['usr/bin/ondir'])
pacman -Q namcap
namcap-git 3.2.8.17.g97e816e-1
The Makefile overwrites LDFLAGS along with CFLAGS so namcap is correct in this case. Adding back LDFLAGS and CFLAGS the warning for FULL RELRO does not appear.
Edit:
Dirty way of adding the flags back.
make CFLAGS="$CFLAGS "'-DVERSION=\"$(VERSION)\" -DGLOBAL_CONF=\"$(CONF)\"' LDFLAGS="$LDFLAGS"
Last edited by loqs (2019-08-14 12:29:50)
Offline
A cleaner approach would be a patch, or a sed command in a prepare function, but really it should be reported upstream to change to "CFLAGS+=..." and "LDFLAGS+=..." and to get rid of that second CFLAGS definition which they seem to have put in there for testing and left.
Of course upstream has been silent on this repo for a *long* time - so a patch would likely be the way to go.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
diff --git a/Makefile b/Makefile
index d81a39f..e5c6d10 100644
--- a/Makefile
+++ b/Makefile
@@ -15,12 +15,10 @@ DESTDIR=
# **WARNING** This is not recommended at all.
CC=cc
-CFLAGS=-O3 -DVERSION=\"$(VERSION)\" -DGLOBAL_CONF=\"$(CONF)\" -DUSE_ONENTERLEAVE
-CFLAGS=-Wall -c -g -DVERSION=\"$(VERSION)\" -DGLOBAL_CONF=\"$(CONF)\"
+CFLAGS+=-DVERSION=\"$(VERSION)\" -DGLOBAL_CONF=\"$(CONF)\"
LD=cc
-LDFLAGS=
-LDFLAGS=-g
+LDFLAGS+=
$(TARGET): $(OBJS)
$(LD) $(OBJS) $(LDFLAGS) -o $@
Last edited by loqs (2019-08-14 12:57:31)
Offline
Great thanks.
All namcap issues are fixed now.
Offline
When PKGBUILD will be published?
I think all issues are fixed now.
Offline
Whenever you publish it. Were you expecting someone else to post and maintain it?
https://wiki.archlinux.org/index.php/AU … ge_content
Last edited by Trilby (2019-08-19 12:39:18)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Where to submit my package build (PKGBUILD file)?
Offline
Offline
If you are unable or unwilling to read the simple instructions I linked to in the previous post, then I'd suggest that you submit it absolutely nowhere.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
I uploaded it.
Thanks for your support.
Offline