#!/bin/sh #set -x TMP=/tmp/liste.$(basename $PWD) nom=${PWD#/home/rpmbuild/site/rpms/} if [ "$nom" = "SRPMS" ] then dis=fedora ver=28 old=5 else dis=${nom%%/*} ver=${nom#$dis/} ver=${ver%%/*} old=2 fi if [ ${1:-check} != nocheck ]; then echo "+ Controle des signatures" rpm -K *.rpm | grep -v 'signatures.*OK' | cut -d: -f1 | tee $TMP if [ -s $TMP ] then if [ "$dis" == "fedora" -a "$ver" -ge 28 ] then echo "key 2018" rpmsign --define '_gpg_path /home/remi/.gnupg2018' --define "_gpg_name Remi's RPM repository" --addsign $(cat $TMP) elif [ "$dis" == "fedora" -a "$ver" -ge 26 ] then echo "key 2017" rpmsign --define '_gpg_path /home/remi/.gnupg2017' --define "_gpg_name Remi's RPM repository" --addsign $(cat $TMP) else echo "old key" rpmsign --define '_gpg_path /home/remi/.gnupgrpm' --define "_gpg_name Remi Collet" --addsign $(cat $TMP) fi else echo OK. fi fi echo "+ Nettoyage des anciens ($old)" dnf repomanage --old --keep=$old . | tee $TMP LST=$(cat $TMP) if [ -z "$LST" ] then echo OK. else mv $LST /data/rpms/old/ fi cache=/home/rpmbuild/site/rpms/.createrepocache/$nom mkdir -p $cache check=sha256 if [ "$dis" == "fedora" -a "$ver" -ge 27 ]; then echo "+ Génération repodata (createrepo_c, $check)" createrepo_c --workers 4 \ --cachedir $cache \ --unique-md-filenames \ --retain-old-md 1 \ --changelog-limit 3 \ --compress-type=bz2 \ --database . else echo "+ Génération repodata (createrepo, $check)" createrepo --workers 4 \ --cachedir $cache \ --checksum $check \ --unique-md-filenames \ --changelog-limit 3 \ --compress-type=bz2 \ --database . fi if [ -d headers ] then echo "+ Génération des headers" yum-arch . fi echo "+ Génération repoview" nom=${PWD#/home/rpmbuild/site/rpms/} echo repoview --url http://rpms.remirepo.net/$nom \ --template-dir /home/rpmbuild/site/rpms/repotmpl \ --title "Remi's RPM repository - ${nom//\// - }" . LANG=C repoview --url http://rpms.remirepo.net/$nom \ --template-dir /home/rpmbuild/site/rpms/repotmpl \ --title "Remi's RPM repository - ${nom//\// - }" .