source: dassbuild/trunk/usr/bin/make_and_publish_sles_patch_description.sh@ 1022

Last change on this file since 1022 was 762, checked in by joergs, on Jun 12, 2009 at 6:24:00 PM

set keyword Id

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 2.7 KB
Line 
1#!/bin/sh
2# $Id: make_and_publish_sles_patch_description.sh 762 2009-06-12 16:24:00Z joergs $
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
90echo -n "Passphrase for signing packages: "
91read PASS
92
93 echo $PASS | gpg -u $SIGNID --passphrase-fd 0 --clearsign $PATCHFILE
94 expect -c "spawn rpm --addsign $1" -c 'expect -ex "Enter pass phrase:"' -c "send $PASS\n" -c 'expect "Pass phrase"' -c 'wait'
95
96# gpg -u $SIGNID --clearsign $PATCHFILE
97 mv $PATCHFILE.asc $PATCHFILE
98# rpm --addsign $1
99
100#done
101
102if (rpm --checksig $1 | grep -q "gpg OK")
103then
104 # publish
105 echo "Lösche alte Patch-Description"
106 ssh $YOUSERVER "rm $YOUPATH/patches/patch-$PAKET-*"
107 echo "Kopiere Dateien ..."
108 scp $PATCHFILE $YOUSERVER:$YOUPATH/patches
109 ssh $YOUSERVER "cd $YOUPATH/patches; ls -1 -A > directory.3"
110 scp $1 $YOUSERVER:$YOUPATH/rpm/$ARCH/
111 ssh $YOUSERVER "cd $YOUPATH/rpm/$ARCH/; ln -sf $RPMFILEBASENAME $PAKET.rpm; ls -1 -A > directory.3"
112else
113 echo "rpm Signature _not_ Ok. stop"
114 exit 1
115fi
Note: See TracBrowser for help on using the repository browser.