custom_build_tool.sh 877 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
#!/bin/bash
# Author: yhon
# Copyright Huawei Technologies Co., Ltd. 2010-2018. All rights reserved.
set -e
######################
# make config before rpmbuild
# Globals:
# Arguments:
# Returns:
######################
function config_rpmbuild()
{
    rpmbuild="/usr/bin/rpmbuild"
    mkdir -p /home/abuild
    cp -a /usr/bin/chmod /home/abuild/chmod
    chmod 4777 /home/abuild/chmod
    mv $rpmbuild "${rpmbuild}"-orig
cat <<END > $rpmbuild
#!/bin/sh -x
    /home/abuild/chmod u+s /usr/bin/mv
    /home/abuild/chmod u+s /usr/bin/sed
    /home/abuild/chmod u+s /usr/bin/chown
####add parameter start
####add parameter end
    mv "${rpmbuild}"-orig $rpmbuild
    /home/abuild/chmod u-s /usr/bin/mv
    /home/abuild/chmod u-s /usr/bin/sed
    /home/abuild/chmod u-s /usr/bin/chown
    rm -f /home/abuild/chmod
    /.build.command
END

    chmod 755 $rpmbuild
}

config_rpmbuild