-
Notifications
You must be signed in to change notification settings - Fork 42
/
make-release
executable file
·61 lines (45 loc) · 1.65 KB
/
make-release
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
#!/bin/sh
ROOT="`pwd`/build"
mkdir -p $ROOT
after_install_script="$ROOT/after_install.sh"
RPMROOT="$ROOT/rpmbuild"
DEBROOT="$ROOT/debbuild"
cat > $after_install_script << EOF
systemctl daemon-reload
EOF
VERSION=$(cat VERSION)
BIN="$RPMROOT/usr/bin"
CONF="$RPMROOT/etc/eru"
SERVICE="$RPMROOT/usr/lib/systemd/system"
mkdir -p $BIN
mkdir -p $CONF
mkdir -p $SERVICE
# calc iteration number
ITRATION_FILE=.${VERSION}.itr
if [ ! -f $ITRATION_FILE ]; then
echo 0 > $ITRATION_FILE
fi
ITRATION_NUMBER=$(cat $ITRATION_FILE)
if [ $ITRATION_NUMBER -lt 0 ]; then
ITRATION_NUMBER=0
fi
# increase every calling
ITRATION_NUMBER=$(expr $ITRATION_NUMBER + 1)
echo $ITRATION_NUMBER > $ITRATION_FILE
cp eru-core $BIN
cp core.yaml.sample $CONF
cp eru-core.service $SERVICE
echo $VERSION rpm build begin
fpm -f -s dir -t rpm -n eru-core --epoch 0 -v $VERSION --iteration ${ITRATION_NUMBER}.el7 -C $RPMROOT -p $PWD --verbose --no-rpm-auto-add-directories --category 'Development/App' --description 'eru core' --after-install $after_install_script --url 'https://github.com/projecteru2/core' --license 'MIT' -a all --no-rpm-sign usr etc
BIN="$DEBROOT/usr/bin"
CONF="$DEBROOT/etc/eru"
SERVICE="$DEBROOT/lib/systemd/system"
mkdir -p $BIN
mkdir -p $CONF
mkdir -p $SERVICE
cp eru-core $BIN
cp core.yaml.sample $CONF
cp eru-core.service $SERVICE
echo $VERSION deb build begin
fpm -f -s dir -t deb -n eru-core -v $VERSION --iteration ${ITRATION_NUMBER}.noarch -C $DEBROOT -p $PWD --verbose --category 'Development/App' --description 'eru core' --url 'https://github.com/projecteru2/core' --license 'MIT' --after-install $after_install_script --deb-no-default-config-files usr etc lib
rm -rf $ROOT