source: trunk/technical/common/build/make_and_publish_sles_patch_description.sh@ 706

Last change on this file since 706 was 697, checked in by maik, on Nov 24, 2004 at 10:24:24 AM

Var fuer signid, rpm signieren mit eingebaut, patch pfad auf /tmp

  • Property svn:executable set to *
File size: 2.4 KB
Line 
1#!/bin/sh
2# $Id: $
3# dass IT GmbH
4#
5# This script reads some information out of rpm packages and generates Suse patch files, signs and
6# checks signature of package and finally puts patch descriptions and rpms onto the you server
7#
8# Parameter: binary rpm file
9# TODO: Make patches consisting of more than one rpm, proceed some more rpm attributes into patch file
10
11## customize THIS:
12
13YOUSERVER=lxcdtower
14# There must be subirectories named patches and rpm below this path
15YOUPATH=/cds/linux/i386/update/lvermgeo
16
17SIGNID="build@lvermgeo.rlp.de"
18
19##
20
21function out()
22{
23echo $1 >> $PATCHFILE
24#echo -e "\n" >> $PATCHFILE
25}
26
27
28#DESCRDIR=/usr/src/packages/PATCH/
29DESCRDIR=/tmp
30
31PAKET=`rpm --queryformat %{NAME} -qp $1`
32SUFFIX=`rpm --queryformat %{VERSION}-%{RELEASE} -qp $1`
33SUMMARY=`rpm --queryformat %{SUMMARY} -qp $1`
34DESCRIPTION=`rpm --queryformat %{DESCRIPTION} -qp $1`
35ARCH=`rpm --queryformat %{ARCH} -qp $1`
36GROUP=`rpm --queryformat %{GROUP} -qp $1`
37SIZE=`rpm --queryformat %{SIZE} -qp $1`
38
39RELEASE=`date +%Y%m%d%H%M`
40
41RPMFILEBASENAME=`basename $1`
42
43# Name of patch-description file
44PATCHFILE="$DESCRDIR/patch-$PAKET-$SUFFIX"
45
46if [ -e $PATCHFILE ]
47then
48 rm $PATCHFILE
49fi
50out "##"
51out "## Patch Description for $PAKET"
52out "##"
53out
54out "Kind: recommended"
55out "Shortdescription.english: $SUMMARY"
56out "Longdescription.english:"
57out "$DESCRIPTION"
58out " "
59out "Hsilgne.noitpircsedgnol:"
60out "UpdateOnlyInstalled: false"
61out "Size: $SIZE"
62out "MinYaST1Version:"
63out "MinYaST2Version:"
64out
65out "Packages:"
66out "##"
67out "Filename: $PAKET.rpm"
68out "Label: $PAKET"
69out "Series: $ARCH"
70out "DepAND:"
71out "DepOR:"
72out "DepExcl:"
73out "Flag:"
74out "Category:"
75out "RpmGroup: $GROUP"
76out "Copyright: see package"
77out "AuthorAddress:"
78out "Version: $SUFFIX"
79out "StartCommand:"
80out "Obsoletes:"
81out "Segakcap:"
82
83
84
85#for i in $SIGNID
86#do
87# echo Please enter Passphrase for gpg ID $SIGNID:
88# read PASS
89# echo $PASS | gpg -u $SIGNID --passphrase-fd 0 --clearsign $PATCHFILE
90
91 gpg -u $SIGNID --clearsign $PATCHFILE
92 mv $PATCHFILE.asc $PATCHFILE
93 rpm --addsign $1
94
95#done
96
97if (rpm --checksig $1 | grep -q "gpg OK")
98then
99 # publish
100 echo "Kopiere Dateien ..."
101 scp $PATCHFILE $YOUSERVER:$YOUPATH/patches
102 ssh $YOUSERVER "cd $YOUPATH/patches; ls -1 -A > directory.3"
103 scp $1 $YOUSERVER:$YOUPATH/rpm/$ARCH/
104 ssh $YOUSERVER "cd $YOUPATH/rpm/$ARCH/; ln -sf $RPMFILEBASENAME $PAKET.rpm; ls -1 -A > directory.3"
105else
106 echo "rpm Signature _not_ Ok. stop"
107 exit 1
108fi
Note: See TracBrowser for help on using the repository browser.