-
Notifications
You must be signed in to change notification settings - Fork 2
/
build_debpackage.sh
44 lines (39 loc) · 1.5 KB
/
build_debpackage.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
#!/bin/bash
mkdir -p packages/DEBIAN
mkdir -p packages/usr/local/bin/
mkdir -p packages/usr/share/hvl/yusufreis/
mkdir -p logs
touch logs/yusufreis.log
echo """#!/bin/bash
python3 /usr/share/hvl/yusufreis/src/tray.py""" > packages/usr/local/bin/yusufreis
cp -r images locale src apps.gsettings-yusufreis.gschema.xml packages/usr/share/hvl/yusufreis
mkdir -p packages/usr/share/hvl/yusufreis/logs
size=$(du -s ./ | cut -f 1)
version=$(date +'%Y%m%d-%H%M%S')
date=$(date +'%d/%m/%Y-%H:%M:%S')
echo """Package: yusufreis
Version: $version
Installed-Size: $size
Maintainer: Ridvan Tulemen <ridvantulemen@gmail.com>
Date : $date
Depends: python3-pil, python3-gi, graphicsmagick-imagemagick-compat
Architecture: amd64
Description: yusufreis
""" > packages/DEBIAN/control
find ./ -type f ! -regex '.*?DEBIAN.*' -exec md5sum {} \; > packages/DEBIAN/md5sums
echo """chmod +x /usr/local/bin/yusufreis
cp /usr/share/hvl/yusufreis/apps.gsettings-yusufreis.gschema.xml /usr/share/glib-2.0/schemas/
glib-compile-schemas /usr/share/glib-2.0/schemas/
chmod -R o+w /usr/share/hvl/yusufreis/logs/""" >> packages/DEBIAN/postinst
echo """ echo \"\"\"#!/usr/bin/env xdg-open
[Desktop Entry]
Version=0.1
Type=Application
Terminal=false
Exec=/usr/local/bin/yusufreis
Name=YusufReis
Comment=YusufReis
Icon=/usr/share/hvl/yusufreis/images/Computer.png\"\"\" > /usr/share/applications/yusufreis.desktop""" >> packages/DEBIAN/postinst
chmod +x packages/DEBIAN/postinst
version=$(date +'%Y%m%d-%H%M%S')
dpkg-deb -Zgzip --build ./packages yusufreis_$version.deb