mkports

recipes for building multiple softwares with mk(1)
git clone git://z3bra.org/mkports
Log | Files | Refs

commit ad31a561809d5f164850ff0d2ad4c3e37dc2cc4d
parent 6ead52508268ed0852fc9eedf141475384a9bf01
Author: z3bra <willyatmailoodotorg>
Date:   Thu Apr 21 13:37:18 2016

Rename $workdir as $WORK

Diffstat:
 binutils/mkfile |  2 +-
 config.mk       |  2 +-
 curl/mkfile     |  2 +-
 dash/mkfile     |  2 +-
 default.mk      | 22 ++++++++++------------
 gcc/mkfile      |  4 ++--
 init/mkfile     |  8 ++++----
 iputils/mkfile  |  2 +-
 mksh/mkfile     |  4 ++--
 9 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/binutils/mkfile b/binutils/mkfile @@ -8,7 +8,7 @@ url = ftp://ftp.gnu.org/gnu/$pkg/$pkg-$ver.tar.bz2 MAKEFLAGS = ${MAKEFLAGS} tooldir='' build:QV: fetch patch - cd $workdir/$pkg-$ver + cd $WORK/$pkg-$ver ./configure $CONFIGURE make configure-host make CC="$CC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS -all-static" ${MAKEFLAGS} diff --git a/config.mk b/config.mk @@ -3,8 +3,8 @@ #PATH = ${CROSS}/bin:${PATH} ROOT = /ns/distro/fs REPO = /ns/distro/pm/repo +WORK = `{printf '/tmp/mkports/%s-%s' "$pkg" "$(id -u)"} NPROC = 8 -workdir = `{printf '/tmp/mkports/%s-%s' "$pkg" "$(id -u)"} CC = gcc -static CXX = g++ -static diff --git a/curl/mkfile b/curl/mkfile @@ -25,7 +25,7 @@ CONFIGURE = ${CONFIGURE} \ --disable-smtps build:QV: fetch patch - cd $workdir/$pkg-$ver + cd $WORK/$pkg-$ver ./configure ${CONFIGURE} make ${MAKEFLAGS} # static build: http://curl.haxx.se/mail/archive-2003-03/0115.html diff --git a/dash/mkfile b/dash/mkfile @@ -7,6 +7,6 @@ url=http://gondor.apana.org.au/~herbert/dash/files/$pkg-$ver.tar.gz install:V: build mkdir -p $destdir - cd $workdir/$pkg-$ver + cd $WORK/$pkg-$ver make PREFIX= DESTDIR=$destdir install ln -sf /bin/dash $destdir/bin/sh diff --git a/default.mk b/default.mk @@ -1,6 +1,5 @@ srcdir = `{pwd} -workdir = `{printf '/tmp/%s-%s' "$pkg" "$(id -u)"} -destdir = `{printf '%s/%s/.rootfs' "$workdir" "$pkg-$ver"} +destdir = `{printf '%s/%s/.rootfs' "$WORK" "$pkg-$ver"} archive = `{basename $url 2>/dev/null || echo /dev/null} @@ -14,16 +13,15 @@ $pkg\#$ver.tar.bz2: fetch patch build install cleanup # building # If it doesn't work, simply override it on a per pack basis build:V: fetch patch - cd $workdir/$pkg-$ver + cd $WORK/$pkg-$ver test -f configure && ./configure $CONFIGURE make CC="$CC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" ${MAKEFLAGS} # install the pack to a .rootfs directory # this is where the "pack" target will chdir to create the pack install:V: build - echo $destdir mkdir -p $destdir - cd $workdir/$pkg-$ver + cd $WORK/$pkg-$ver make ${MAKEFLAGS} DESTDIR=$destdir install cleanup:V: install @@ -41,7 +39,7 @@ cleanup:V: install # patch your software using everything in ./patches patch:V: fetch if [ -d "$srcdir/patches" ]; then - cd $workdir/$pkg-$ver + cd $WORK/$pkg-$ver cat $srcdir/patches/*.diff | patch -Np1 fi @@ -51,8 +49,8 @@ fetch:V: fetch-git fetch-archive # if $git is set, clone the repo, and checkout $ver fetch-git:V: if [ -n "$git" ]; then - mkdir -p $workdir - cd $workdir + mkdir -p $WORK + cd $WORK test -d $pkg-$ver || git clone $git $pkg-$ver cd $pkg-$ver git reset --hard @@ -63,7 +61,7 @@ fetch-git:V: # content to a directory named $pkg-$ver fetch-archive:V: $archive if [ -n "$url" ]; then - cd $workdir + cd $WORK case $archive in *.tar.bz2) opt="-xvj" ;; *.tar.gz|*.tgz) opt="-xvz" ;; @@ -78,14 +76,14 @@ fetch-archive:V: $archive $archive:Q: if [ -n "$url" ]; then - mkdir -p $workdir - cd $workdir + mkdir -p $WORK + cd $WORK curl -LO $url > $archive fi # delete everything but the pack clean:V: - rm -rf $workdir + rm -rf $WORK # remove the pack distclean:V: clean diff --git a/gcc/mkfile b/gcc/mkfile @@ -18,12 +18,12 @@ CONFIGURE = ${CONFIGURE} \ --with-pkgversion="SPOINK-x86_64-static" #build:QV: fetch patch -# cd $workdir/$pkg-$ver +# cd $WORK/$pkg-$ver # ./configure $CONFIGURE # make CC="$CC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" ${MAKEFLAGS} all-gcc all-target-libgcc install:QV: build mkdir -p $destdir - cd $workdir/$pkg-$ver + cd $WORK/$pkg-$ver make ${MAKEFLAGS} DESTDIR=$destdir install-gcc install-target-libgcc diff --git a/init/mkfile b/init/mkfile @@ -5,15 +5,15 @@ ver = 0.1 <../default.mk build:QV: fetch patch - mkdir -p $workdir/$pkg-$ver - cp init.c $workdir/$pkg-$ver/init.c - cd $workdir/$pkg-$ver + mkdir -p $WORK/$pkg-$ver + cp init.c $WORK/$pkg-$ver/init.c + cd $WORK/$pkg-$ver $CC $CFLAGS init.c $LDFLAGS -o init install:QV: build mkdir -p $destdir/sbin mkdir -p $destdir/libexec - cp $workdir/$pkg-$ver/init $destdir/sbin/init + cp $WORK/$pkg-$ver/init $destdir/sbin/init cp $srcdir/rc $destdir/sbin/rc cp $srcdir/power.subr $destdir/libexec/power.subr chmod 750 $destdir/sbin/rc diff --git a/iputils/mkfile b/iputils/mkfile @@ -10,7 +10,7 @@ MAKEFLAGS = ${MAKEFLAGS} USE_GNUTLS=no USE_CAP=no install:QV: build mkdir -p $destdir/bin mkdir -p $destdir/sbin - cd $workdir/$pkg-$ver + cd $WORK/$pkg-$ver cp ping ping6 $destdir/bin cp arping tracepath tracepath6 traceroute6 clockdiff rarpd rdisc $destdir/sbin/ chmod u+s $destdir/bin/ping $destdir/sbin/traceroute6 diff --git a/mksh/mkfile b/mksh/mkfile @@ -8,11 +8,11 @@ url = http://www.mirbsd.org/MirOS/dist/mir/mksh/$pkg-$ver.tgz CFLAGS = ${CFLAGS} -DMKSH_S_NOVI=1 -DMKSH_SMALL_BUT_FAST build:QV: fetch patch - cd $workdir/$pkg-$ver + cd $WORK/$pkg-$ver /bin/sh Build.sh -r install:QV: build - cd $workdir/$pkg-$ver + cd $WORK/$pkg-$ver mkdir -p $destdir/bin mkdir -p $destdir/etc mkdir -p $destdir/man/man1