forked from xmake-io/xmake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakeppa
executable file
·128 lines (112 loc) · 2.85 KB
/
makeppa
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/usr/bin/env bash
# check
if [ $# -lt 1 ]; then
echo "Usage: ./scripts/makeppa [serie] [patch]"
exit
fi
# workdir
workdir=./xmake-ppa
if [ ! -d $workdir ]; then
mkdir $workdir
fi
# version
version=`cat ./core/xmake.lua | grep -E "^set_version" | grep -oE "[0-9]*\.[0-9]*\.[0-9]*"`
# serie, e.g. groovy, focal, bionic, xenial, trusty, precise
serie="$1"
if [ -z $serie ]; then
serie=xenial
fi
# patch number
patch="$2"
if [ -z $patch ]; then
patch=1
fi
# tarball
basename=xmake-$version+$patch$serie
tarball=$workdir/$basename.tar.gz
if [ ! -f $tarball ]; then
cd core
xmake pack --autobuild=n -y --formats=srctargz --basename=xmake -o ../artifacts xmakesrc || exit -1
cd ..
cp ./artifacts/xmake.tar.gz $tarball
fi
# extract tarball
cd $workdir
if [ -d xmakesrc ]; then
rm -rf xmakesrc
fi
if [ ! -d $basename ]; then
mkdir xmakesrc
tar -xvf $basename.tar.gz -C xmakesrc
mv xmakesrc/xmake-$version $basename
fi
# enter project directory
cd $basename
# make template
echo "making template .."
if [ -d debian ]; then
rm -rf debian
fi
export USER=`id -u -n`
dh_make -e [email protected] -c apache -y -s -f ../$basename.tar.gz
# copy debian
echo "instaling debian .."
if [ -d debian ]; then
rm -rf debian
fi
cp -r ../../scripts/debian .
# update changelog
rm debian/changelog
dch -v $version+$patch$serie "update $version" -D $serie --create --package xmake -M $USER
cat debian/changelog
# build package
echo "building package .."
debuild -S -k02713554FA2CE4AADA20AB23167A22F22C0C68C9
# check package
echo "checking package .."
lintian ../xmake_$version+$patch$serie.dsc
# upload package
echo "uploading package .."
source=xmake_$version+"$patch$serie"_source
if [ -f ../$source.ppa.upload ]; then
rm ../$source.ppa.upload
fi
dput ppa:xmake-io/xmake ../$source.changes
# remove workdir
cd ../..
rm -rf xmake-ppa
# install dh-make and gpg
# sudo apt install dh-make rng-tools
#
# @see https://help.ubuntu.com/community/GnuPrivacyGuardHowto
#
# generate key
# gpg --gen-key
#
# save public/private key
# gpg -a --export 2C0C68C9 > /mnt/xmake_ppa_pgp.pub
# gpg -a --export-secret-keys 2C0C68C9 > /mnt/xmake_ppa_pgp.sec
#
# submit to keykserver and import this key to launchpad.net
# @see https://launchpad.net/+help-registry/import-pgp-key.html
# gpg --send-keys --keyserver keyserver.ubuntu.com 2C0C68C9
#
# recv email and validate this gpg key
# gpg --decrypt file.txt
# goto link
#
# show gpg
# gpg --fingerprint
# pub 2048R/2C0C68C9 2020-09-08
# Key fingerprint = 0271 3554 FA2C E4AA DA20 AB23 167A 22F2 2C0C 68C9
#
# build package and upload ppa to launchpad.net
# https://launchpad.net/~xmake-io/+archive/ubuntu/xmake
#
# recv and import key on ubuntu
# gpg --keyserver keyserver.ubuntu.com --recv 2C0C68C9
# gpg --export --armor 2C0C68C9 | sudo apt-key add -
#
# show long key
# gpg --keyid-format long --list-keys [email protected]
#