-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·80 lines (62 loc) · 1.76 KB
/
deploy.sh
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
#!/bin/bash
# """ Clean Project """
make clean
# """ Variables """
NAME=fdesc
VERSION=0
RELEASE=1
TARGET=fc32
ARCH=x86_64
# """ Create tar file """
mkdir $NAME-$VERSION
rm -rf $NAME-$VERSION/*
cp -r src $NAME-$VERSION/
cp $NAME.1 $NAME-$VERSION/
cp Makefile $NAME-$VERSION/
cp README.md $NAME-$VERSION/
cp LICENSE $NAME-$VERSION/
tar -czvf archive/v$VERSION/$NAME-$VERSION.$RELEASE.tar.gz $NAME-$VERSION
cp archive/v$VERSION/$NAME-$VERSION.$RELEASE.tar.gz archive/v$VERSION/$NAME-$VERSION.tar.gz
# """ Clean UP """
rm -rf $NAME-$VERSION
# """ Create package.sh """
touch $NAME-package.sh
chmod 755 $NAME-package.sh
__package="
#
# This file is generated throw deploy process
# DO NOT EDIT MANUALLY!
# Copy this file in ~ and run it
# cp $NAME-package.sh ~
# cd ~
# ./$NAME-package.sh
# setuptree
rm -rf ~/rpmbuild
rpmdev-setuptree
# get spec and source
wget -O ~/rpmbuild/SPECS/$NAME.spec https://raw.githubusercontent.com/msoodb/$NAME/master/$NAME.spec
wget -O ~/rpmbuild/SOURCES/$NAME-$VERSION.tar.gz https://raw.githubusercontent.com/msoodb/$NAME/master/archive/v$VERSION/$NAME-$VERSION.tar.gz
# lint spec
rpmlint ~/rpmbuild/SPECS/$NAME.spec
# build and lint SRPM
rpmbuild -bs ~/rpmbuild/SPECS/$NAME.spec
rpmlint ~/rpmbuild/SRPMS/$NAME-$VERSION-$RELEASE.$TARGET.src.rpm
# build and lint RPM
rpmbuild -bb ~/rpmbuild/SPECS/$NAME.spec
rpmlint ~/rpmbuild/RPMS/x86_64/$NAME-$VERSION-$RELEASE.$TARGET.$ARCH.rpm
# Building in Copr
copr-cli build $NAME ~/rpmbuild/SRPMS/$NAME-$VERSION-$RELEASE.$TARGET.src.rpm
# sudo dnf copr enable msoodb/fdesc fedora-32-x86_64
"
echo "$__package" > $NAME-package.sh
# """ Push "
git add .
git commit -m "deploy"
git push origin master
# """ Package commands"
echo ""
echo ""
echo "# cp $NAME-package.sh ~"
echo "# cd ~"
echo "# ./$NAME-package.sh"
echo ""