File: rpms-create-james.sh

package info (click to toggle)
ustr 1.0.4-6.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,676 kB
  • sloc: ansic: 19,041; makefile: 935; perl: 779; sh: 686; xml: 97
file content (83 lines) | stat: -rwxr-xr-x 1,482 bytes parent folder | download | duplicates (5)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#! /bin/bash -e

pkg=ustr
# FIXME: More C&P of VERSION
v="1.0.4"

if [ ! -f ustr-main.h ]; then
  if [ -f ustr/ustr-main.h ]; then
    cd ustr
  else
    echo "No VERSION, $pkg.spec or configure file." 1&>2
    exit 1
  fi
fi

s="`pwd`"
cd ../build/$pkg

rm -rf $pkg-$v
cp -a $s ./$pkg-$v
cd ./$pkg-$v

./scripts/clean.sh full
( cd Documentation && make )

perl -p -i -e \
 's{href="(tutorial|constants|design|functions|structs)(?!\.html)\b}
   {href="$1.html}g;' Documentation/*.html


rm -rf tmp

# Backup files...
find . \
 \( -name "*.o" -o -name ".*[%~]" -o -name "*[%~]" -o -name "#*#" \) \
 -print0 | xargs --no-run-if-empty -0 rm -f

# git
rm -rf .git

# Arch stuff...
rm -rf ./{arch}
find . -name .arch-ids -type d -print0 | xargs -0 rm -rf

# Create tarballs/RPMS
cp $s/$pkg.spec .

cd ..

chk=1
rel=1
if [ "x$1" = "xnochk" ]; then
echo Not doing checking.
chk=0
shift
else
echo Doing checking.
args="$args  --define \"chk 1\""
fi

if [ "x$1" = "xrel" ]; then
shift
echo Using custom release $1.
rel=$1
shift
else
echo Using normal release of 1.
fi

perl -i -pe "s/^Release: 1/Release: $rel/" $pkg-$v/$pkg.spec

tar -cf - $pkg-$v | \
  tee >(gzip  -9 -c > $pkg-$v.tar.gz) | \
        bzip2 -9 -c > $pkg-$v.tar.bz2

# sudo rpmbuild -ts --define "chk $chk" $pkg-$v.tar.gz
rpmbuild --define "_sourcedir `pwd`/tmp"   --define "_specdir `pwd`/tmp" \
         --define "_srcrpmdir `pwd`" -ts \
  $pkg-$v.tar.gz

mock $pkg-$v-$rel*.src.rpm

ls -ahslF `pwd`/$pkg-$v-$rel*.src.rpm