aboutsummaryrefslogtreecommitdiffstats
path: root/main/debootstrap
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2015-08-18 20:46:25 +0200
committerFrancesco Colista <fcolista@alpinelinux.org>2015-08-20 14:27:33 +0000
commitd4fd8bfbf0256fcb70d1a62e8be2c37aa320f71d (patch)
tree7a0b4d8b4fa6b93e863b401080043df830cec945 /main/debootstrap
parent917d264454c72c77990ecb980961f47daa7f77e1 (diff)
downloadaports-d4fd8bfbf0256fcb70d1a62e8be2c37aa320f71d.tar.bz2
aports-d4fd8bfbf0256fcb70d1a62e8be2c37aa320f71d.tar.xz
main/debootstrap: cleanup by providing custom makedev script
Instead of replicating the Makefile devices.tar.gz rule in the package() APKBUILD function.
Diffstat (limited to 'main/debootstrap')
-rw-r--r--main/debootstrap/APKBUILD48
-rwxr-xr-xmain/debootstrap/makedev.sh19
2 files changed, 39 insertions, 28 deletions
diff --git a/main/debootstrap/APKBUILD b/main/debootstrap/APKBUILD
index 247da7dd1c..787d95b50b 100644
--- a/main/debootstrap/APKBUILD
+++ b/main/debootstrap/APKBUILD
@@ -1,3 +1,4 @@
+# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=debootstrap
pkgver=1.0.72
@@ -7,46 +8,37 @@ url="http://packages.qa.debian.org/d/debootstrap.html"
arch="all"
license="GPL2"
depends="dpkg tar"
+makedepends=""
+install=""
+subpackages=""
source="http://ftp.de.debian.org/debian/pool/main/d/debootstrap/debootstrap_$pkgver.tar.gz
- pkgdetails.c"
+ pkgdetails.c
+ makedev.sh"
_builddir="$srcdir"/debootstrap-$pkgver
build() {
- cd "$_builddir"
- ${CC:-gcc} $CFLAGS $LDFLAGS -o pkgdetails \
+ chmod +x "$srcdir/makedev.sh"
+ ${CC:-gcc} $CFLAGS $LDFLAGS -o "$_builddir"/pkgdetails \
"$srcdir"/pkgdetails.c || return 1
}
package() {
cd "$_builddir"
- # create devices.tar.gz
- rm -rf dev
- mkdir -p dev
- chown 0:0 dev
- chmod 755 dev
- ( cd dev
- ln -s /proc/self/fd fd
- ln -s fd/0 stdin
- ln -s fd/1 stdout
- ln -s fd/2 stderr
- mknod full c 1 7
- mknod null c 1 3
- mknod ptmx c 5 2
- mkdir pts shm
- mknod random c 1 8
- mknod tty c 5 0
- mknod urandom c 1 9
- mknod zero c 1 5
- )
- tar -czf devices.tar.gz dev
- rm -rf dev
- make DESTDIR="$pkgdir" install || return
+
+ # This can only be done in a fakeroot
+ make MAKEDEV="$srcdir/makedev.sh" \
+ devices.tar.gz || return 1
+
+ make DESTDIR="$pkgdir" install || return 1
install -Dm755 pkgdetails "$pkgdir"/usr/lib/debootstrap/pkgdetails
}
md5sums="0cacf6e3bd8b566e921d2a326d6fd2bd debootstrap_1.0.72.tar.gz
-66b6fb6d862ba4886701c9b056088479 pkgdetails.c"
+66b6fb6d862ba4886701c9b056088479 pkgdetails.c
+ef5038e52173de7a18c37a0925ccf383 makedev.sh"
sha256sums="90f4cf1390326f020b9192b6a45ba1d323fffab9c22c6f62451780e6f5482f8d debootstrap_1.0.72.tar.gz
-1cf1644e8400693fd41d378f972c15fa7b32f3282117ea967c995705256a84d6 pkgdetails.c"
+1cf1644e8400693fd41d378f972c15fa7b32f3282117ea967c995705256a84d6 pkgdetails.c
+3f26318b59c7697205285d04eb68a4c65905faedd7bbcb4e53e803f9ea8e5c97 makedev.sh"
sha512sums="b8f186b13f66789e96f775337d06821cfb464e35dd661a2bff1420bfb1254cf85ce9eb46be1a27dad7a462628e441cbfcdfffaf12ee5a394d15c248882295848 debootstrap_1.0.72.tar.gz
-432313c8aef4974f21cb81b48d9f1c319692325f24a456e460e6f92c6a15ade7f29dfee4bf2ab3664c90b09d1f16e46cb8dd898ebd317f2547e63a64a773d971 pkgdetails.c"
+432313c8aef4974f21cb81b48d9f1c319692325f24a456e460e6f92c6a15ade7f29dfee4bf2ab3664c90b09d1f16e46cb8dd898ebd317f2547e63a64a773d971 pkgdetails.c
+71f1dfe7d785cf5f4b2db7e4de01b5e542b33a1a49194a53665d4d68b5de47fc3c5b37ad2d1a7c37fb14d10c6758fa2fb043bd68a6fbb8b9dba90fb071a9db9c makedev.sh"
diff --git a/main/debootstrap/makedev.sh b/main/debootstrap/makedev.sh
new file mode 100755
index 0000000000..bee4ff8fe7
--- /dev/null
+++ b/main/debootstrap/makedev.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Use this instead of packaging makedev.
+
+# Exit on failure.
+set -e
+
+# Create devices in $PWD.
+ln -s /proc/self/fd fd
+ln -s fd/0 stdin
+ln -s fd/1 stdout
+ln -s fd/2 stderr
+mknod full c 1 7
+mknod null c 1 3
+mknod ptmx c 5 2
+mkdir pts shm
+mknod random c 1 8
+mknod tty c 5 0
+mknod urandom c 1 9
+mknod zero c 1 5