Public Repository

Last pushed: 2 years ago
Short Description
RPMRebuild embedded
Full Description

Full description is empty for this repo.

Docker Pull Command
Owner
jcortejoso

Comments (1)
olopopo
2 years ago

I made a shell function that accepts files as well as URLs:

rpmspec(){
        if [ $# -ne 1 ]; then
                echo "Usage: rpmspec <RPM file/URL>"
                return 1
        fi
        if [[ $1 =~ ^http:// ]]; then
                tmpdir=$(mktemp -d -p /dev/shm -t rpmrebuild.XXX)
                command cd $tmpdir
                wget "$1" -q
                local dir=$tmpdir
                local pkg=$(basename $tmpdir/*)
        else
                local dir=$(realpath $(dirname $1))
                local pkg=$(basename $1)
        fi
        docker run --name rpmrebuild -v $dir:/pkg --rm -it jcortejoso/rpmrebuild:latest rpmrebuild --package --notest-install -e /pkg/$pkg
        [ $tmpdir ] && command cd $OLDPWD
        [ $tmpdir ] && rm -fr $tmpdir
}