-
Notifications
You must be signed in to change notification settings - Fork 3
/
createdebianpkg.sh
executable file
·119 lines (105 loc) · 2.92 KB
/
createdebianpkg.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
#!/bin/sh
#
# This file is part of Schumix.
#
# Copyright (C) 2010-2013 Megax <http://megax.yeahunter.hu/>
# Copyright (C) 2013-2015 Schumix Team <http://schumix.eu/>
#
# Schumix is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Schumix is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Schumix. If not, see <http://www.gnu.org/licenses/>.
#
echo "Init SubModule"
git submodule update --init --recursive
sdir=`ls -d $PWD`
if [ -e "Run" ]; then
rm -rf Run
fi
echo "Running autogen.sh"
sh autogen.sh
echo "Running configure"
./configure --prefix=/usr
echo "Running make"
make
echo "Locale make and install"
cd Po
make DESTDIR=$sdir/Run install
cd ..
if [ -e "pkg" ]; then
rm -rf pkg
fi
mkdir pkg
mkdir pkg/Share
cp -rf Share/share pkg/Share/
cp -rf Sql pkg/Share/share/schumix
cp Share/changelog pkg/Share/
cp Share/postinst pkg/Share/
cp Share/postrm pkg/Share/
cp Share/schumix pkg/Share/
cp Share/schumix-server pkg/Share/
mkdir pkg/usr
mkdir pkg/usr/bin
mv pkg/Share/schumix pkg/usr/bin/
mv pkg/Share/schumix-server pkg/usr/bin/
mv pkg/Share/share pkg/usr/
mkdir pkg/usr/share/doc
mkdir pkg/usr/share/doc/schumix
cp License pkg/usr/share/doc/schumix/
mkdir pkg/usr/lib
mkdir pkg/usr/lib/pkgconfig
mkdir pkg/usr/lib/schumix
cp -rf Scripts pkg/usr/lib/schumix/Scripts
cd Run/Release/Addons
for file in *.pc
do
echo $file;
mv $file ../../../pkg/usr/lib/pkgconfig/$file
done
cd ..
for file in *.pc
do
echo $file;
mv $file ../../pkg/usr/lib/pkgconfig/$file
done
rm Config.exe Installer.exe schumix.config schumix.installer schumix schumix.server
#for file in *.mdb
#do
# rm $file
#done
cp -rf ./ ../../pkg/usr/lib/schumix
cd ../../
cp -rf ./Run/usr/lib/schumix/locale pkg/usr/share/locale
cd pkg
#control file
cd Share
revision="$(echo $(cat ../../Core/Schumix.Framework/Config/Consts.cs) | grep -o 'SchumixVersion = ".*"; public const string SchumixFileVersion' | awk '{print substr($3, 2, length($3)-3)}')"
echo "Version: $revision"
echo "Package: schumix" >> control
echo "Version: $revision" >> control
echo "Architecture: all" >> control
echo "Maintainer: Csaba Jakosa <megax@yeahunter.hu>" >> control
echo "Depends: mono-devel (>= 2.10.8)" >> control
echo "Section: Schumix" >> control
echo "Priority: optional" >> control
echo "Description: Schumix IRC Bot and Framework" >> control
cd ..
cd usr
find . -exec md5sum '{}' \; > ../Share/md5sums
cd ..
mv Share DEBIAN
cd ..
#sudo chown -R root:root pkg
dpkg-deb --build pkg
#sudo rm -rf pkg
echo "mv pkg.deb schumix.deb"
mv pkg.deb schumix.deb
echo "Success :)"