You are not logged in.

#1 2019-08-12 12:25:50

AkhilJalagam
Member
Registered: 2017-08-13
Posts: 9

[NEW] PKGBUILD review request (ondir-git)

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

#2 2019-08-12 13:16:42

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 21,925
Website

Re: [NEW] PKGBUILD review request (ondir-git)

  • 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

#3 2019-08-12 13:49:44

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 444
Website

Re: [NEW] PKGBUILD review request (ondir-git)

Also, use the upstream URL as the source URL, not your personal fork of it.

Offline

#4 2019-08-13 10:24:59

AkhilJalagam
Member
Registered: 2017-08-13
Posts: 9

Re: [NEW] PKGBUILD review request (ondir-git)

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

#5 2019-08-13 11:15:06

a821
Member
From: My Location
Registered: 2012-10-31
Posts: 125

Re: [NEW] PKGBUILD review request (ondir-git)

Trilby wrote:

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

#6 2019-08-13 12:09:54

AkhilJalagam
Member
Registered: 2017-08-13
Posts: 9

Re: [NEW] PKGBUILD review request (ondir-git)

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

#7 2019-08-13 12:34:32

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 21,925
Website

Re: [NEW] PKGBUILD review request (ondir-git)

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

#8 2019-08-13 12:36:51

AkhilJalagam
Member
Registered: 2017-08-13
Posts: 9

Re: [NEW] PKGBUILD review request (ondir-git)

Fixed:
- updated license to GPL2

Updated, Please check:
https://github.com/akhilin/ondir/blob/master/PKGBUILD

Thank you,
Akhil Jalagam

Offline

#9 2019-08-13 17:20:20

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 21,925
Website

Re: [NEW] PKGBUILD review request (ondir-git)

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

#10 2019-08-14 08:27:19

AkhilJalagam
Member
Registered: 2017-08-13
Posts: 9

Re: [NEW] PKGBUILD review request (ondir-git)

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

#11 2019-08-14 10:13:31

loqs
Member
Registered: 2014-03-06
Posts: 8,216

Re: [NEW] PKGBUILD review request (ondir-git)

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

#12 2019-08-14 10:28:12

AkhilJalagam
Member
Registered: 2017-08-13
Posts: 9

Re: [NEW] PKGBUILD review request (ondir-git)

$ 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

#13 2019-08-14 12:22:32

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 21,925
Website

Re: [NEW] PKGBUILD review request (ondir-git)

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

#14 2019-08-14 12:28:11

loqs
Member
Registered: 2014-03-06
Posts: 8,216

Re: [NEW] PKGBUILD review request (ondir-git)

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

#15 2019-08-14 12:37:46

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 21,925
Website

Re: [NEW] PKGBUILD review request (ondir-git)

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

#16 2019-08-14 12:55:27

loqs
Member
Registered: 2014-03-06
Posts: 8,216

Re: [NEW] PKGBUILD review request (ondir-git)

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

#17 2019-08-14 13:03:02

AkhilJalagam
Member
Registered: 2017-08-13
Posts: 9

Re: [NEW] PKGBUILD review request (ondir-git)

Great thanks.

All namcap issues are fixed now.

Offline

#18 2019-08-19 11:55:27

AkhilJalagam
Member
Registered: 2017-08-13
Posts: 9

Re: [NEW] PKGBUILD review request (ondir-git)

When PKGBUILD will be published?
I think all issues are fixed now.

Offline

#19 2019-08-19 12:38:42

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 21,925
Website

Re: [NEW] PKGBUILD review request (ondir-git)

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

Board footer

Powered by FluxBB