summaryrefslogtreecommitdiffstats
path: root/mkrepo
blob: de68f58a3b8692bbbfd49b92b0261b9abfb3ce9d (plain)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/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

nom=${PWD#/home/rpmbuild/site/rpms/}
if [ "$nom" = "SRPMS" ]
then
  dis=fedora
  ver=17
  old=5
else
  dis=${nom%%/*}
  ver=${nom#$dis/}
  ver=${ver%%/*}
  old=2
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
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.remirepo.net/$nom \
	--template-dir /home/rpmbuild/site/rpms/repotmpl \
	--title "Les RPM de Remi - ${nom//\// - }" .
LANG=C repoview --url http://rpms.remirepo.net/$nom \
	--template-dir /home/rpmbuild/site/rpms/repotmpl \
	--title "Les RPM de Remi - ${nom//\// - }" .