Received: from mail.wilcox-tech.com (mail.wilcox-tech.com [45.32.83.9]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id EFF1F780FB8 for <~alpine/apk-tools@lists.alpinelinux.org>; Mon, 27 Sep 2021 22:50:44 +0000 (UTC) Received: (qmail 26671 invoked from network); 27 Sep 2021 22:50:41 -0000 Received: from localhost (HELO smtpclient.apple) (AWilcox@Wilcox-Tech.com@127.0.0.1) by localhost with ESMTPA; 27 Sep 2021 22:50:41 -0000 Content-Type: multipart/alternative; boundary=Apple-Mail-EEA1A478-EB87-44CA-9AB1-177812BCF489 Content-Transfer-Encoding: 7bit From: "A. Wilcox" Mime-Version: 1.0 (1.0) Subject: Re: Building APK in Docker Image Date: Mon, 27 Sep 2021 17:50:39 -0500 Message-Id: References: Cc: ~alpine/apk-tools@lists.alpinelinux.org In-Reply-To: To: Jeron Lau X-Mailer: iPhone Mail (18G82) --Apple-Mail-EEA1A478-EB87-44CA-9AB1-177812BCF489 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sep 27, 2021, at 9:29 AM, Jeron Lau wrote: >=20 > =EF=BB=BFI've been trying to build an APK package for Alpine using a Docke= r > container and the abuild tool. It gives the following error: >=20 >>>> hello: Building shared/hello 0.1.0-r0 (using abuild 3.8.0_rc4-r0) start= ed 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 >=20 > My APKBUILD looks like: >=20 > pkgname=3D"hello" > pkgver=3D"0.1.0" > pkgrel=3D"0" > pkgdesc=3D"Hello World" > url=3D"https://example.com" > arch=3D"noarch" > license=3D"COPYING" > source=3D"../dst/hello" > depends=3D"" >=20 > check() { > : > } >=20 > package() { > : > } >=20 > I have placed the APKBUILD file into it's own folder called "hello", > the "hello" shellscript is located in a separate folder called "dst". >=20 > What reason might this be happening? >=20 >=20 > 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 i= s causing your issue. Try: mkdir -p "$pkgdir"/usr/bin cp "$srcdir"/hello "$pkgdir"/usr/bin/ Best, -arw=20 -- A. Wilcox (Sent from my iPhone) Mac, iOS, Linux software engineer --Apple-Mail-EEA1A478-EB87-44CA-9AB1-177812BCF489 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sep 27, 2021, at 9:29 AM, Jeron Lau <= aldaronlau@gmail.com> wrote:

=EF=BB=BF= 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 (usin= g abuild 3.8.0_rc4-r0) started Mon, 27 Sep 2021 13:44:06 +0000
hello: Checking sanity of /share= d/hello/APKBUILD...
WARNING: hello: No maintainer
hello: Analyzing dependencies...
hello: Installing for build: build-base
=
WARNING: Ignoring /home/apk/pac= kages//shared: No such file or directory
(1/1) Installing .m= akedepends-hello (20210927.134407)
OK: 280 MiB in 67 package= s
hello: Cleaning up srcdir
hello: Cleaning up pkgdir
<= /blockquote>
hello: Checking sha512sums...
hello: OK
hello:= Entering fakeroot...
hello*: Running postcheck for hello
<= /blockquote>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<= br>find: /shared/hello/pkg/hello: No such file or directory
= find: /shared/hello/pkg/hello: No such file or directory
<= span>hello*: Preparing package hello...
=
ERROR: hello*: Missing /shared/hello/pkg/hello
ERROR: hello: rootpkg faile= d
hello: Uninstalli= ng dependencies...
(1= /1) Purging .makedepends-hello (20210927.134407)
OK: 280 MiB= in 66 packages

My APKBUILD looks like:

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

check() {=
   :
}

= package() {
   :
}

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

What reason m= ight this be happening?


Th= anks,
Jeron Aldaron Lau

You need to copy the shell script to $pkgdir in the package function. &nbs= p;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"/us= r/bin/

Best,
-arw 

--
A. Wilcox (Sent from my iPhone)
Mac, iOS, Linux software engineer

=
= --Apple-Mail-EEA1A478-EB87-44CA-9AB1-177812BCF489--