Check-in [516e8e6dd7]
Overview
SHA1:516e8e6dd792c70fa89557a461089ee35593ca8f
Date: 2015-02-24 19:20:06
User: rkeene
Comment:Improved Slackware package building script
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2015-03-16
15:36
[e3ddb480d5] Improved "appfs-mkfs" latest detection (user: rkeene, tags: trunk)
2015-02-24
19:20
[516e8e6dd7] Improved Slackware package building script (user: rkeene, tags: trunk)
18:49
[aac1e74eab] Added sbindir for mount.appfs (user: rkeene, tags: trunk)
Changes

Modified build/make-slackware-package from [9a6e6df8ac] to [f3333b1483].

     5      5   platform="$(uname -m)"
     6      6   url="http://rkeene.org/devel/appfs/appfs-${version}.tar.gz"
     7      7   make_args=(
     8      8   	prefix=/usr
     9      9   	sbindir=/sbin
    10     10   	mandir=/usr/man
    11     11   )
           12  +
           13  +if [ ! -f '/etc/slackware-version' ]; then
           14  +	echo 'This script is meant to be run on a Slackware system.' >&2
           15  +
           16  +	exit 1
           17  +fi
    12     18   
    13     19   if [ -z "${version}" ]; then
    14     20   	echo 'Usage: make-slackware-package <version>' >&2
    15     21   
    16     22   	exit 1
    17     23   fi
    18     24   
................................................................................
    19     25   workdir="${TMPDIR:-/tmp}/appfs-slackware-package-${version}-$$${RANDOM}${RANDOM}${RANDOM}"
    20     26   package="appfs-${version}-${platform}-${version_release}.txz"
    21     27   mkdir "${workdir}" || exit 1
    22     28   
    23     29   (
    24     30   	PATH="${PATH}:/sbin"
    25     31   
    26         -	set -ex
           32  +	set -x
    27     33   
    28         -	cd "${workdir}"
           34  +	cd "${workdir}" || exit 1
    29     35   
    30     36   	installdir="$(pwd)/installed"
    31     37   
    32     38   	wget -O appfs.tar.gz "${url}"
    33         -	tar -xf appfs.tar.gz
           39  +	tar -xf appfs.tar.gz || exit 1
           40  +
           41  +	cd "appfs-${version}" || exit 1
    34     42   
    35         -	cd "appfs-${version}"
           43  +	make "${make_args[@]}" || exit 1
           44  +	make "${make_args[@]}" DESTDIR="${installdir}" install || exit 1
    36     45   
    37         -	make "${make_args[@]}"
    38         -	make "${make_args[@]}" DESTDIR="${installdir}" install
           46  +	cd "${installdir}" || exit 1
    39     47   
    40         -	cd "${installdir}"
    41         -
    42         -	mkdir install
    43         -	cat << \_EOF_ > install/slack-desc
           48  +	mkdir install || exit 1
           49  +	cat << \_EOF_ > install/slack-desc || exit 1
    44     50   appfs: appfs (App Filesystem)
    45     51   appfs:
    46     52   appfs: AppFS is a manifest-based FUSE filesystem that lazily fetches files over HTTP.
    47     53   appfs: It is intended to be a universal packaging format.
    48     54   appfs:
    49     55   appfs:
    50     56   appfs:
    51     57   appfs:
    52     58   appfs:
    53     59   appfs:
    54     60   appfs:
    55     61   _EOF_
    56     62   
    57         -	makepkg -c n -l y "../${package}"
           63  +	makepkg -c n -l y "../${package}" || exit 1
    58     64   
    59         -	xz -dc "../${package}" | tardy -User 0 -Group 0 | xz -9c > "../${package}.new"
    60         -	mv "../${package}.new" "../${package}"
           65  +	if [ "$(id -u)" != '0' ]; then
           66  +		xz -dc "../${package}" | tardy -User 0 -Group 0 | xz -9c > "../${package}.new" || exit 1
           67  +		mv "../${package}.new" "../${package}" || exit 1
           68  +	fi
    61     69   ) || exit 1
    62     70   
    63     71   mv "${workdir}/${package}" .
    64     72   
    65     73   rm -rf "${workdir}"
    66     74   
    67     75   exit 0