Skip to content
Snippets Groups Projects
Select Git revision
  • f9edb8a1d8ff1a10f3f8fc1ae107ef67f8c6a25a
  • master default protected
2 results

make.sh

Blame
  • make.sh 1.68 KiB
    #!/bin/bash
    
    set -x
    
    # Nastaveni promennych, pokud je SINVERSION zakomentovana, pokusime se odhadnout nejnovejsi
    export DEBIAN_FRONTEND=noninteractive
    
    # Nacteni promennych o bezicim systemu vcetne verzi
    . /etc/os-release
    
    # Od Debian 11 Bullseye ma debian-security trochu jinou cestu, abychom mohli pouzit heredoc, rozskocime si pres funkci
    function get_debian_security() {
        if [ "${VERSION_ID}" -lt "11" ]; then echo "${VERSION_CODENAME}/updates"; else echo "${VERSION_CODENAME}-security"; fi
    }
    
    # Vygenerovani sources.list podle verze Debianu
    cat > /etc/apt/sources.list << EOSOURCES
    deb http://ftp.zcu.cz/pub/linux/debian ${VERSION_CODENAME} main contrib non-free
    deb http://ftp.zcu.cz/pub/linux/debian ${VERSION_CODENAME}-updates main contrib non-free
    deb http://ftp.zcu.cz/pub/linux/debian-security $(get_debian_security) main contrib non-free
    
    deb-src http://ftp.zcu.cz/pub/linux/debian ${VERSION_CODENAME} main contrib non-free
    deb-src http://ftp.zcu.cz/pub/linux/debian ${VERSION_CODENAME}-updates main contrib non-free
    deb-src http://ftp.zcu.cz/pub/linux/debian-security $(get_debian_security) main contrib non-free
    EOSOURCES
    
    # Instalace buildovacich veci a zavislosti
    apt update -qqq
    apt install -yqqq git devscripts build-essential
    
    
    apt source nfs-utils
    cd nfs-utils-2.6.2
    
    cp ../zs* debian/patches
    
    echo "zs1-local-realm-guess
    zs1-n-option-impl
    zs2-idmap-init
    zs3-keyctl-order
    zs4-nfs4mount-strtok
    zs5-multhr-hostcache
    zs9-idmap-verbosity.patch" >> debian/patches/series
    
    dch --newversion "1:2.6.2-4+zs9" "Apply local patches"
    
    mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes --yes' debian/control
    
    # Build balicku
    dpkg-buildpackage -uc -us -b
    
    cd ..
    mkdir build
    mv *.deb build/