summaryrefslogtreecommitdiffstats
path: root/mkrepo
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2013-03-20 09:39:06 +0100
committerRemi Collet <fedora@famillecollet.com>2013-03-20 09:39:06 +0100
commitc2213a3c63677926e1564ef3a8ef56d7f9c17bd5 (patch)
treeb02f1628cdee8093a6238b4a2827419b0ff97e06 /mkrepo
parent9e0cb3911d349bd13d1ea7985e038fa8ce393a0f (diff)
save remi repo management tools
Diffstat (limited to 'mkrepo')
-rwxr-xr-xmkrepo65
1 files changed, 65 insertions, 0 deletions
diff --git a/mkrepo b/mkrepo
new file mode 100755
index 0000000..fd05321
--- /dev/null
+++ b/mkrepo
@@ -0,0 +1,65 @@
+#!/bin/sh
+#set -x
+TMP=/tmp/liste.$(basename $PWD)
+
+if [ ${1:-check} != nocheck ]; then
+ echo "+ Controle des signatures"
+ rpm -K *.rpm | grep -v 'gpg OK' | cut -d: -f1 | tee $TMP
+ if [ -s $TMP ]
+ then rpmsign --addsign $(cat $TMP)
+ else echo OK.
+ fi
+fi
+
+echo "+ Nettoyage des anciens"
+
+repomanage --old --keep=2 . | tee $TMP
+LST=$(cat $TMP)
+
+if [ -z "$LST" ]
+then echo OK.
+else mv $LST /data/rpms/old/
+fi
+
+nom=${PWD#/home/rpmbuild/site/rpms/}
+if [ "$nom" = "SRPMS" ]
+then
+ dis=fedora
+ ver=17
+else
+ dis=${nom%%/*}
+ ver=${nom#$dis/}
+ ver=${ver%%/*}
+fi
+
+cache=/home/rpmbuild/site/rpms/.createrepocache/$nom
+mkdir -p $cache
+if [ $dis == fedora -a $ver -ge 11 ]
+then check=sha256
+elif [ $dis == enterprise -a $ver -ge 6 ]
+then check=sha256
+else check=sha
+fi
+echo "+ Génération des meta + sql ($check)"
+createrepo --workers 4 \
+ --cachedir $cache \
+ --checksum $check \
+ --unique-md-filenames \
+ --compress-type=bz2 \
+ --database .
+
+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.famillecollet.com/$nom \
+ --template-dir /home/rpmbuild/site/rpms/repotmpl \
+ --title "Les RPM de Remi - ${nom//\// - }" .
+LANG=C repoview --url http://rpms.famillecollet.com/$nom \
+ --template-dir /home/rpmbuild/site/rpms/repotmpl \
+ --title "Les RPM de Remi - ${nom//\// - }" .
+