-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
60 lines (53 loc) · 1.99 KB
/
setup.py
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
#! /usr/bin/python
import sys, os
from distutils.core import setup
from glob import glob
from albasheer import __version__
from albasheer.core import albasheerCore, searchIndexer
# to install type:
# python setup.py install --root=/
from distutils.command.build import build
from distutils.command.clean import clean
class my_build(build):
def run(self):
build.run(self)
# generate data
from albasheer.core import albasheerCore, searchIndexer
if not os.path.isfile('albasheer-data/ix.db'):
q=albasheerCore(False)
ix=searchIndexer(True)
for n,(o,i) in enumerate(q.getAyatIter(1, 6236)):
for w in i.split(): ix.addWord(w,n+1)
d=os.path.dirname(sys.argv[0])
ix.save()
class my_clean(clean):
def run(self):
clean.run(self)
try: os.unlink('albasheer-data/ix.db')
except OSError: pass
locales=map(lambda i: ('share/'+i,[''+i+'/albasheer.mo',]),glob('locale/*/LC_MESSAGES'))
data_files=[('share/albasheer/',glob('albasheer-data/*')),('share/albasheer/tilawa_json_files',glob('tilawa_json_files/*'))]
data_files.extend(locales)
setup (name='Albasheer', version=__version__,
description='Albasheer Quran Browser',
author='Yucef Sourani',
author_email='[email protected]',
url='https://github.com/yucefsourani/albasheer-electronic-quran-browser',
license='Waqf',
packages=['albasheer'],
scripts=['albasheer-browser'],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: End Users/Desktop',
'Operating System :: POSIX',
'Programming Language :: Python',
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
cmdclass={'build': my_build, 'clean': my_clean},
data_files=data_files
)