You are not logged in.

#1 2016-05-30 16:57:42

dreivier
Member
Registered: 2016-04-07
Posts: 36

leave cli utility request

Could some package this little gem as an aur package?

https://code.launchpad.net/~ubuntu-bran … leave/wily

Thank you very much.

Offline

#2 2016-05-30 17:08:53

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

Re: leave cli utility request

That looks like the easiest possible PKGBUILD.  Have you tried yourself?  This would be a good one to learn on.  Take a template PKGBUILD and substitute the relevant link and information, and it will likely work as is.  (You can leave out the configure step).

But I don't know what this this is actually supposed to do that "at" doesn't already do.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2016-05-30 17:18:29

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: leave cli utility request

There was one in AUR 3, but it's crap.

Like trilby says, give it a shot. Looks like you might need bmake from Community.

Offline

#4 2016-05-30 17:47:41

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

Re: leave cli utility request

Ah, I just saw a makefile, I didn't look in it.  I'm not familiar with bmake, but that include looks odd as it seems to be including something that isn't there.

Given that this is just one C file with no apparently deps outside of the standard libraries, a single gcc line would suffice.  I just tested that here, and I get an error from the COPYRIGHT and RCSID lines if 'lint' isn't defined.  I'm not familiar with Debian builds or bmake to know if this is something that is handled by those tools.

Given this, it might not be quite as trivial as I thought - but it should still be a very easy first package.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2016-05-30 18:57:49

dreivier
Member
Registered: 2016-04-07
Posts: 36

Re: leave cli utility request

I really appreciate the heads up and normally I'd try my best to fix things myself but packaging is a whole new topic in my ever growing list of things to learn. I'm usually the translator guy and I code in Ruby so compiling C files usually ends with a headache and too many installed packages. So if this package is too much trouble I'm fine without smile Maybe I should write a ruby replacement gem instead.

Offline

#6 2016-05-30 19:27:54

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

Re: leave cli utility request

Don't reinvent the reinvention of the wheel.  See 'at' which is already in the repos.

Packaging for arch is insanely easy.  It seems like it will be a complicated mess that you have to learn all sorts of stuff to manage (this is the case with Debian packaging) but it is really ridiculously simple.  I'll get you started.  See the brief wiki page here.  Grab the template PKGBUILD there and remove all the empty vars and anything not needed.  Then just fill in a few variables and put the build and install commands in:

# Maintainer: Your Name <youremail@domain.com>
pkgname=leave
pkgver=1.12
pkgrel=1
pkgdesc=""
arch=('i686' 'x86_64')
url="https://launchpad.net/ubuntu/+source/leave/1.12-2.1"
license=(TODO)
source=("https://launchpad.net/ubuntu/+archive/primary/+files/${pkgname}_${pkgver}.orig.tar.gz")
sha256sums=('de30529de8abf49004da4120ca352d5c588a657f8845e44d5e83a4860e6bbe1f')

prepare() {
	cd "$pkgname-$pkgver"
	sed -i 's|getprogname()|"leave"|' leave.c
}

build() {
	cd "$pkgname-$pkgver"
	gcc -o leave leave.c -D__COPYRIGHT\(x\)= -D__RCSID\(x\)=
}

package() {
	cd "$pkgname-$pkgver"
	install -Dm 0755 leave ${pkgdir}/usr/bin/leave
	install -Dm 0644 leave.1 ${pkgdir}/usr/share/man/man1/leave.1
}

I did have to add a prepare function to patch out some ancient code.  It seems this may have been last touched by the actual author some 15+ years ago.  It uses a function that used to be in the C std library but is no longer. (edit: maybe it's not because it's old, it seems this function is available in the BSD stdlib - just not in linux.)

This works but note 2 1 important missing bit: you must add a license, and there should be a better way around than defining "lint" as I've done (edit: updated PKGBULD as suggested below).

Last edited by Trilby (2016-05-30 20:07:14)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2016-05-30 19:58:56

mis
Member
Registered: 2016-03-16
Posts: 234

Re: leave cli utility request

Trilby wrote:

there should be a better way around than defining "lint" as I've done.  I have no idea what that is, but it is used to conditionally exlude some bits that are likely imporatant for the license.

This is the way the ubuntu package handles it. See: http://bazaar.launchpad.net/~ubuntu-bra … bian/rules

gcc -o leave leave.c -D__COPYRIGHT\(x\)= -D__RCSID\(x\)=

Offline

#8 2016-05-30 20:33:32

mis
Member
Registered: 2016-03-16
Posts: 234

Re: leave cli utility request

This uses the license from the leave.c file

# Maintainer: Your Name <youremail@domain.com>
pkgname=leave
pkgver=1.12
pkgrel=1
pkgdesc="Reminds you when you have to leave"
arch=('i686' 'x86_64')
url="https://launchpad.net/ubuntu/+source/leave/1.12-2.1"
license=('BSD')
source=("https://launchpad.net/ubuntu/+archive/primary/+files/${pkgname}_${pkgver}.orig.tar.gz")
sha256sums=('de30529de8abf49004da4120ca352d5c588a657f8845e44d5e83a4860e6bbe1f')

prepare() {
        cd "$pkgname-$pkgver"
        sed -i 's|getprogname()|"leave"|' leave.c

        # extract license from leave.c
        cut -c 4- leave.c | sed -n '4,29p' > LICENSE
}

build() {
        cd "$pkgname-$pkgver"
        gcc -o leave leave.c -D__COPYRIGHT\(x\)= -D__RCSID\(x\)=
}

package() {
        cd "$pkgname-$pkgver"
        install -Dm 0755 leave "$pkgdir/usr/bin/leave"
        install -Dm 0644 leave.1 "$pkgdir/usr/share/man/man1/leave.1"
        install -Dm 0644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

edit: added description used in ubuntu package: http://bazaar.launchpad.net/~ubuntu-bra … an/control

Last edited by mis (2016-05-30 20:50:50)

Offline

#9 2016-05-31 19:19:31

mis
Member
Registered: 2016-03-16
Posts: 234

Re: leave cli utility request

@dreivier
Are you interested in uploading and maintaining this in the AUR?
If not let me know. I would do it.

Offline

#10 2016-05-31 20:24:02

dreivier
Member
Registered: 2016-04-07
Posts: 36

Re: leave cli utility request

@mis, please upload it. I'd be a happy user for now. Thank you very much.

Offline

Board footer

Powered by FluxBB