mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1454 (Postinstall fails on Ubuntu Intrepid)
This commit is contained in:
parent
c2497c4b91
commit
6c78c33930
22
setup.py
22
setup.py
@ -47,6 +47,7 @@ main_functions = {
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
from setuptools.command.build_py import build_py as _build_py, convert_path
|
||||||
from distutils.command.build import build as _build
|
from distutils.command.build import build as _build
|
||||||
from distutils.core import Command as _Command
|
from distutils.core import Command as _Command
|
||||||
from pyqtdistutils import PyQtExtension, build_ext, Extension
|
from pyqtdistutils import PyQtExtension, build_ext, Extension
|
||||||
@ -65,6 +66,25 @@ if __name__ == '__main__':
|
|||||||
newest_source, oldest_target = max(stimes), min(ttimes)
|
newest_source, oldest_target = max(stimes), min(ttimes)
|
||||||
return newest_source > oldest_target
|
return newest_source > oldest_target
|
||||||
|
|
||||||
|
class build_py(_build_py):
|
||||||
|
|
||||||
|
def find_data_files(self, package, src_dir):
|
||||||
|
"""
|
||||||
|
Return filenames for package's data files in 'src_dir'
|
||||||
|
Modified to treat data file specs as paths not globs
|
||||||
|
"""
|
||||||
|
globs = (self.package_data.get('', [])
|
||||||
|
+ self.package_data.get(package, []))
|
||||||
|
files = self.manifest_files.get(package, [])[:]
|
||||||
|
for pattern in globs:
|
||||||
|
# Each pattern has to be converted to a platform-specific path
|
||||||
|
pattern = os.path.join(src_dir, convert_path(pattern))
|
||||||
|
next = glob.glob(pattern)
|
||||||
|
files.extend(next if next else [pattern])
|
||||||
|
|
||||||
|
return self.exclude_data_files(package, src_dir, files)
|
||||||
|
|
||||||
|
|
||||||
class Command(_Command):
|
class Command(_Command):
|
||||||
user_options = []
|
user_options = []
|
||||||
def initialize_options(self): pass
|
def initialize_options(self): pass
|
||||||
@ -413,7 +433,6 @@ if __name__ == '__main__':
|
|||||||
author_email = 'kovid@kovidgoyal.net',
|
author_email = 'kovid@kovidgoyal.net',
|
||||||
url = 'http://%s.kovidgoyal.net'%APPNAME,
|
url = 'http://%s.kovidgoyal.net'%APPNAME,
|
||||||
package_data = {'calibre':plugins},
|
package_data = {'calibre':plugins},
|
||||||
include_package_data = True,
|
|
||||||
entry_points = entry_points,
|
entry_points = entry_points,
|
||||||
zip_safe = False,
|
zip_safe = False,
|
||||||
options = { 'bdist_egg' : {'exclude_source_files': True,}, },
|
options = { 'bdist_egg' : {'exclude_source_files': True,}, },
|
||||||
@ -455,6 +474,7 @@ if __name__ == '__main__':
|
|||||||
cmdclass = {
|
cmdclass = {
|
||||||
'build_ext' : build_ext,
|
'build_ext' : build_ext,
|
||||||
'build' : build,
|
'build' : build,
|
||||||
|
'build_py' : build_py,
|
||||||
'pot' : pot,
|
'pot' : pot,
|
||||||
'manual' : manual,
|
'manual' : manual,
|
||||||
'resources' : resources,
|
'resources' : resources,
|
||||||
|
@ -237,10 +237,10 @@ def stage_three():
|
|||||||
check_call('python setup.py register')
|
check_call('python setup.py register')
|
||||||
check_call('sudo rm -rf build src/calibre/plugins/*')
|
check_call('sudo rm -rf build src/calibre/plugins/*')
|
||||||
os.mkdir('build')
|
os.mkdir('build')
|
||||||
check_call('python2.5 setup.py bdist_egg --exclude-source-files upload')
|
check_call('python2.5 setup.py build_ext bdist_egg --exclude-source-files upload')
|
||||||
check_call('sudo rm -rf build src/calibre/plugins/*')
|
check_call('sudo rm -rf build src/calibre/plugins/*')
|
||||||
os.mkdir('build')
|
os.mkdir('build')
|
||||||
check_call('python setup.py bdist_egg --exclude-source-files upload')
|
check_call('python setup.py build_ext bdist_egg --exclude-source-files upload')
|
||||||
check_call('python setup.py sdist upload')
|
check_call('python setup.py sdist upload')
|
||||||
upload_src_tarball()
|
upload_src_tarball()
|
||||||
check_call('''rm -rf dist/* build/*''')
|
check_call('''rm -rf dist/* build/*''')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user