forked from AIPowerGrid/AI-Power-Grid-Core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease-linux.sh
150 lines (118 loc) · 2.9 KB
/
release-linux.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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
VERSION=1.0.2.0
rm -rf ./release-linux
mkdir release-linux
cp ./src/aipgd ./release-linux/
cp ./src/aipg-cli ./release-linux/
cp ./src/qt/aipg-qt ./release-linux/
cp ./AIPGCOIN_small.png ./release-linux/
cd ./release-linux/
strip aipgd
strip aipg-cli
strip aipg-qt
#==========================================================
# prepare for packaging deb file.
mkdir aipgcoin-$VERSION
cd aipgcoin-$VERSION
mkdir -p DEBIAN
echo 'Package: aipgcoin
Version: '$VERSION'
Section: base
Priority: optional
Architecture: all
Depends:
Maintainer: Aipg
Description: Aipg coin wallet and service.
' > ./DEBIAN/control
mkdir -p ./usr/local/bin/
cp ../aipgd ./usr/local/bin/
cp ../aipg-cli ./usr/local/bin/
cp ../aipg-qt ./usr/local/bin/
# prepare for desktop shortcut
mkdir -p ./usr/share/icons/
cp ../AIPGCOIN_small.png ./usr/share/icons/
mkdir -p ./usr/share/applications/
echo '
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/usr/local/bin/aipg-qt
Name=aipgcoin
Comment= aipg coin wallet
Icon=/usr/share/icons/AIPGCOIN_small.png
' > ./usr/share/applications/aipgcoin.desktop
cd ../
# build deb file.
dpkg-deb --build aipgcoin-$VERSION
#==========================================================
# build rpm package
rm -rf ~/rpmbuild/
mkdir -p ~/rpmbuild/{RPMS,SRPMS,BUILD,SOURCES,SPECS,tmp}
cat <<EOF >~/.rpmmacros
%_topdir %(echo $HOME)/rpmbuild
%_tmppath %{_topdir}/tmp
EOF
#prepare for build rpm package.
rm -rf aipgcoin-$VERSION
mkdir aipgcoin-$VERSION
cd aipgcoin-$VERSION
mkdir -p ./usr/bin/
cp ../aipgd ./usr/bin/
cp ../aipg-cli ./usr/bin/
cp ../aipg-qt ./usr/bin/
# prepare for desktop shortcut
mkdir -p ./usr/share/icons/
cp ../AIPGCOIN_small.png ./usr/share/icons/
mkdir -p ./usr/share/applications/
echo '
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/usr/bin/aipg-qt
Name=aipgcoin
Comment= aipg coin wallet
Icon=/usr/share/icons/AIPGCOIN_small.png
' > ./usr/share/applications/aipgcoin.desktop
cd ../
# make tar ball to source folder.
tar -zcvf aipgcoin-$VERSION.tar.gz ./aipgcoin-$VERSION
cp aipgcoin-$VERSION.tar.gz ~/rpmbuild/SOURCES/
# build rpm package.
cd ~/rpmbuild
cat <<EOF > SPECS/aipgcoin.spec
# Don't try fancy stuff like debuginfo, which is useless on binary-only
# packages. Don't strip binary too
# Be sure buildpolicy set to do nothing
Summary: Aipg wallet rpm package
Name: aipgcoin
Version: $VERSION
Release: 1
License: MIT
SOURCE0 : %{name}-%{version}.tar.gz
URL: https://www.aipgcoin.net/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
%{summary}
%prep
%setup -q
%build
# Empty section.
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}
# in builddir
cp -a * %{buildroot}
%clean
rm -rf %{buildroot}
%files
/usr/share/applications/aipgcoin.desktop
/usr/share/icons/AIPGCOIN_small.png
%defattr(-,root,root,-)
%{_bindir}/*
%changelog
* Tue Aug 24 2021 Aipg Project Team.
- First Build
EOF
rpmbuild -ba SPECS/aipgcoin.spec