You are not logged in.

#1 2017-03-11 18:32:23

Sori Ano
Member
Registered: 2017-02-01
Posts: 22

[SOLVED] Creating a simple PKGBUILD

Hi, I'm new at packaging, I wanted to create one of this plugin, which is literally one file to be installed in the /lib directory, the problem is that the package, for some reason, replaces the hole directory, making all files to disappear. How do I fix that? Here's the PKGBUILD

pkgname=plymouth-openrc-plugin
pkgver=0.1.2
pkgrel=1
pkgdesc="Plymouth plugin for OpenRC "
arch=('any')
url="https://github.com/aidecoe/plymouth-openrc-plugin"
license=('GPL2')
depends=()
backup=('plymouth.so')
source=("https://github.com/aidecoe/$pkgname/archive/master.zip")
md5sums=('59c6cf5e4cfba53679e40efea5a64dcc')

build() {
	cd "$srcdir/$pkgname-master"
	make
}

package() {
	cd "$srcdir/$pkgname-master"
	make DESTDIR="$pkgdir" install
}

Last edited by Sori Ano (2017-03-11 21:14:38)

Offline

#2 2017-03-11 19:40:29

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

Re: [SOLVED] Creating a simple PKGBUILD

First, remove the needless "HELP" from your title.  These are help forums, we know you need help.  Further, the post is in the Creating & Modifying Packages subforum, so we know it's for creating a PKGBUILD, so that tells us nothing.  Replace it with something informative like what tool/package you want help with.

As to the PKGBUILD, get rid of the 'backup' variable - that doesn't make any sense for a compiled object file.  You can remove the empty depends (if there really aren't any).  'arch' should not by "any" as this is compiled.  Also if you are pulling the most recent code from git, do not use the zip file, just use the git url and append '-git' to the pkgname and put 'SKIP' in the checksum array: otherwise this will break as soon as upstream makes a revision.  Alternatively, get a tagged version from their git history.

As to the problem you claim to have, can you describe that more.  The PKGBUILD you've shown could not have the effect you describe.


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

Offline

#3 2017-03-11 19:44:47

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Creating a simple PKGBUILD

Are you sure?

Pacman never deletes files unless instructed to by the package, which yours doesn't do.

Also there are a few issues with your PKGBUILD, as you're building from git master you need to append -git to the pkgname and add a pkgver function to get the correct version. Check the wiki for details.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2017-03-11 20:24:51

Sori Ano
Member
Registered: 2017-02-01
Posts: 22

Re: [SOLVED] Creating a simple PKGBUILD

Ok, this is REALLY strange. Packages are unable to overwrite the /lib directory, and when removing the package that I made, then they can. Also, when removing it, the /lib directory disappears.

Offline

#5 2017-03-11 20:28:25

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,901
Website

Re: [SOLVED] Creating a simple PKGBUILD

There is no /lib directory on Arch. /lib should be a symlink pointing to /usr/lib. Pacman will refuse to install packages that try to install to /lib, so if you managed to install one, you unwisely used '--force'. After that, removing the package shouldn't remove /lib, unless you also removed the filesystem package.

What have you actually done, and what are you actually trying to do?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#6 2017-03-11 20:35:50

Sori Ano
Member
Registered: 2017-02-01
Posts: 22

Re: [SOLVED] Creating a simple PKGBUILD

Trilby wrote:

Also if you are pulling the most recent code from git, do not use the zip file, just use the git url and append '-git' to the pkgname and put 'SKIP' in the checksum array: otherwise this will break as soon as upstream makes a revision.  Alternatively, get a tagged version from their git history.

But that plugin is no longer developed, so should I do what you say anyway? or as it is obsolete, it is unnecessary?

Offline

#7 2017-03-11 20:44:46

Sori Ano
Member
Registered: 2017-02-01
Posts: 22

Re: [SOLVED] Creating a simple PKGBUILD

WorMzy wrote:

There is no /lib directory on Arch. /lib should be a symlink pointing to /usr/lib. Pacman will refuse to install packages that try to install to /lib, so if you managed to install one, you unwisely used '--force'. After that, removing the package shouldn't remove /lib, unless you also removed the filesystem package.

What have you actually done, and what are you actually trying to do?

I already noted that it is a symlink, but the plugin writed in the /lib directory. What I'm trying to do is to install the plymouth.so file generated when running make, and install it to /lib/rc/plugins
So, what I think is that there are 3 possible solutions:
1) I fork the repository so I correct the directories
2) Include the precompiled file, and just copy it and give the correct permissions
3) Leave it as it is, but in the package() function and replace make install by cp $srcdir/plymouth.so $pkgdir/usr/lib/rc/plugins

I'll try option 3 to see what happens.

Offline

#8 2017-03-11 20:50:45

Sori Ano
Member
Registered: 2017-02-01
Posts: 22

Re: [SOLVED] Creating a simple PKGBUILD

ok, so I tried

pkgname=plymouth-openrc-plugin
pkgver=0.1.2
pkgrel=1
pkgdesc="Plymouth plugin for OpenRC "
arch=('x86_64' 'i686' 'armv7h')
url="https://github.com/aidecoe/plymouth-openrc-plugin"
license=('GPL2')
source=("git+https://github.com/aidecoe/plymouth-openrc-plugin.git")
md5sums=('SKIP')

build() {
	cd "$srcdir/$pkgname"
	make
}

package() {
	cd "$srcdir/$pkgname"
	mkdir -p $pkgdir/usr/lib/rc/plugins
	cp plymouth.so $pkgdir/usr/lib/rc/plugins
}

and no problems, now I'll test it

Offline

#9 2017-03-11 21:13:35

Sori Ano
Member
Registered: 2017-02-01
Posts: 22

Re: [SOLVED] Creating a simple PKGBUILD

solved, but the PKGBUILD can improve anyways

Offline

#10 2017-03-12 15:15:04

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

Re: [SOLVED] Creating a simple PKGBUILD

Looking at the PKGBUILD, this is intended to work with the openrc package used by systemd-free.org ?

If that's correct, please make that clear in pkgdesc .


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