-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
98 lines (78 loc) · 2.65 KB
/
Copy pathsetup.py
File metadata and controls
98 lines (78 loc) · 2.65 KB
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
import subprocess
def generate_mo_files():
podir = "po"
mo = []
for po in os.listdir(podir):
if po.endswith(".po"):
os.makedirs("{}/{}/LC_MESSAGES".format(podir,
po.split(".po")[0]), exist_ok=True)
mo_file = "{}/{}/LC_MESSAGES/{}".format(
podir, po.split(".po")[0], "holy-quran.mo")
msgfmt_cmd = 'msgfmt {} -o {}'.format(podir + "/" + po, mo_file)
subprocess.call(msgfmt_cmd, shell=True)
mo.append(("/usr/share/locale/" + po.split(".po")[0] + "/LC_MESSAGES",
["po/" + po.split(".po")[0] + "/LC_MESSAGES/holy-quran.mo"]))
return mo
changelog = "debian/changelog"
if os.path.exists(changelog):
head = open(changelog).readline()
try:
version = head.split("(")[1].split(")")[0]
except:
print("debian/changelog format is wrong for get version")
version = "0.0.0"
f = open("data/version", "w")
f.write(version)
f.close()
data_files = [
("/usr/bin", ["holy-quran"]),
("/usr/share/fonts/", ["KuranKerimFontHamdullah.ttf"]),
("/usr/share/applications",
["tr.org.bismih.holy-quran.desktop"]),
("/usr/share/icons",
["data/img/holy-quran.png"]),
("/usr/share/icons/hicolor/scalable/apps/",
["data/img/holy-quran.png"]),
("/usr/share/holy-quran/src/",
["src/player.py",
"src/theme.py",
"src/window.py",
"src/window_continue.py"]),
("/usr/share/holy-quran/src/custom_widgets/",
["src/custom_widgets/Ayat_label.py",
"src/custom_widgets/Btn_ico.py"]),
("/usr/share/holy-quran/src/db/",
["src/db/db_external_pro.py",
"src/db/db_presets.py"]),
("/usr/share/holy-quran/src/static/",
["src/static/colors.py",
"src/static/stc1.py"]),
("/usr/share/holy-quran/data/",
["data/version"]),
("/usr/share/holy-quran/data/img/",
["data/img/holy-quran.png"]),
("/usr/share/holy-quran/data/img/icons/",
["data/img/icons/search.svg"]),
("/usr/share/holy-quran/",
["Kuran.db",
"LICENSE",
"main.py"]),
] + generate_mo_files()
setup(
name="holy-quran",
version=version,
packages=find_packages(),
scripts=["holy-quran"],
install_requires=["PyGObject", "PySide6==6.5.0", "pygame"],
data_files=data_files,
author="Muhammet Halak",
author_email="halakmuhammet145@gmail.com",
description="Translate pot file easily",
license="GPLv3",
keywords="holy-quran , Quran , Holy , Kuran",
url="https://github.com/halak0013/Kuran-I_Kerim_app",
)