~alpine/apk-tools

1

Building APK in Docker Image

Details
Message ID
<CAG7kD60h9F1bDErbw4ZOvF9G+x0+gG6uEPZh=Ab3t_6OVxKBnA@mail.gmail.com>
DKIM signature
missing
Download raw message
I've been trying to build an APK package for Alpine using a Docker
container and the abuild tool. It gives the following error:

>>> hello: Building shared/hello 0.1.0-r0 (using abuild 3.8.0_rc4-r0) started Mon, 27 Sep 2021 13:44:06 +0000
>>> hello: Checking sanity of /shared/hello/APKBUILD...
>>> WARNING: hello: No maintainer
>>> hello: Analyzing dependencies...
>>> hello: Installing for build: build-base
WARNING: Ignoring /home/apk/packages//shared: No such file or directory
(1/1) Installing .makedepends-hello (20210927.134407)
OK: 280 MiB in 67 packages
>>> hello: Cleaning up srcdir
>>> hello: Cleaning up pkgdir
>>> hello: Checking sha512sums...
hello: OK
>>> hello: Entering fakeroot...
>>> hello*: Running postcheck for hello
find: /shared/hello/pkg/hello: No such file or directory
find: /shared/hello/pkg/hello: No such file or directory
find: /shared/hello/pkg/hello: No such file or directory
find: /shared/hello/pkg/hello: No such file or directory
find: /shared/hello/pkg/hello: No such file or directory
>>> hello*: Preparing package hello...
>>> ERROR: hello*: Missing /shared/hello/pkg/hello
>>> ERROR: hello: rootpkg failed
>>> hello: Uninstalling dependencies...
(1/1) Purging .makedepends-hello (20210927.134407)
OK: 280 MiB in 66 packages

My APKBUILD looks like:

pkgname="hello"
pkgver="0.1.0"
pkgrel="0"
pkgdesc="Hello World"
url="https://example.com"
arch="noarch"
license="COPYING"
source="../dst/hello"
depends=""

check() {
    :
}

package() {
    :
}

I have placed the APKBUILD file into it's own folder called "hello",
the "hello" shellscript is located in a separate folder called "dst".

What reason might this be happening?


Thanks,
Jeron Aldaron Lau
Details
Message ID
<A3C5E411-4AA1-4E91-9725-CF70ECFF5F49@adelielinux.org>
In-Reply-To
<CAG7kD60h9F1bDErbw4ZOvF9G+x0+gG6uEPZh=Ab3t_6OVxKBnA@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
On Sep 27, 2021, at 9:29 AM, Jeron Lau <aldaronlau@gmail.com> wrote:
> 
> I've been trying to build an APK package for Alpine using a Docker
> container and the abuild tool. It gives the following error:
> 
>>>> hello: Building shared/hello 0.1.0-r0 (using abuild 3.8.0_rc4-r0) started Mon, 27 Sep 2021 13:44:06 +0000
>>>> hello: Checking sanity of /shared/hello/APKBUILD...
>>>> WARNING: hello: No maintainer
>>>> hello: Analyzing dependencies...
>>>> hello: Installing for build: build-base
> WARNING: Ignoring /home/apk/packages//shared: No such file or directory
> (1/1) Installing .makedepends-hello (20210927.134407)
> OK: 280 MiB in 67 packages
>>>> hello: Cleaning up srcdir
>>>> hello: Cleaning up pkgdir
>>>> hello: Checking sha512sums...
> hello: OK
>>>> hello: Entering fakeroot...
>>>> hello*: Running postcheck for hello
> find: /shared/hello/pkg/hello: No such file or directory
> find: /shared/hello/pkg/hello: No such file or directory
> find: /shared/hello/pkg/hello: No such file or directory
> find: /shared/hello/pkg/hello: No such file or directory
> find: /shared/hello/pkg/hello: No such file or directory
>>>> hello*: Preparing package hello...
>>>> ERROR: hello*: Missing /shared/hello/pkg/hello
>>>> ERROR: hello: rootpkg failed
>>>> hello: Uninstalling dependencies...
> (1/1) Purging .makedepends-hello (20210927.134407)
> OK: 280 MiB in 66 packages
> 
> My APKBUILD looks like:
> 
> pkgname="hello"
> pkgver="0.1.0"
> pkgrel="0"
> pkgdesc="Hello World"
> url="https://example.com"
> arch="noarch"
> license="COPYING"
> source="../dst/hello"
> depends=""
> 
> check() {
>    :
> }
> 
> package() {
>    :
> }
> 
> I have placed the APKBUILD file into it's own folder called "hello",
> the "hello" shellscript is located in a separate folder called "dst".
> 
> What reason might this be happening?
> 
> 
> Thanks,
> Jeron Aldaron Lau

You need to copy the shell script to $pkgdir in the package function.  There is nothing being written to $pkgdir so the output is empty, which is what is causing your issue.

Try:

mkdir -p "$pkgdir"/usr/bin
cp "$srcdir"/hello "$pkgdir"/usr/bin/

Best,
-arw 

--
A. Wilcox (Sent from my iPhone)
Mac, iOS, Linux software engineer
Reply to thread Export thread (mbox)