[Skencil-commits] r778 - skencil/branches/skencil-0.6
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Sun Oct 31 00:45:05 CEST 2010
Author: igor_n
Date: 2010-10-31 00:45:05 +0200 (Sun, 31 Oct 2010)
New Revision: 778
Modified:
skencil/branches/skencil-0.6/setup.py
Log:
bdist_deb command is implemented
Modified: skencil/branches/skencil-0.6/setup.py
===================================================================
--- skencil/branches/skencil-0.6/setup.py 2010-10-30 22:42:00 UTC (rev 777)
+++ skencil/branches/skencil-0.6/setup.py 2010-10-30 22:45:05 UTC (rev 778)
@@ -155,12 +155,19 @@
if len(sys.argv)>1 and sys.argv[1]=='build©':
COPY=True
sys.argv[1]='build'
+ generate_locales()
if len(sys.argv)>1 and sys.argv[1]=='bdist_deb':
DEBIAN=True
sys.argv[1]='build'
+ generate_locales()
+
+ if len(sys.argv)>1 and sys.argv[1]=='bdist_rpm':
generate_locales()
+ if len(sys.argv)>1 and not sys.argv[1]=='sdist':
+ generate_locales()
+
from distutils.core import setup, Extension
@@ -374,4 +381,48 @@
shutil.copy('build/lib.linux-'+platform.machine()+'-'+version+'/skencil/Sketch/Modules/_type1module.so','src/Sketch/Modules/')
print '\n _type1module.so has been copied to src/ directory'
- os.system('rm -rf build')
\ No newline at end of file
+ os.system('rm -rf build')
+
+
+#################################################
+# Implementation of bdist_deb command
+#################################################
+
+if DEBIAN:
+ print '\nDEBIAN PACKAGE BUILD'
+ print '===================='
+ import string, platform
+ version=(string.split(sys.version)[0])[0:3]
+
+ arch,bin = platform.architecture()
+ if arch=='64bit':
+ arch='amd64'
+ else:
+ arch='i386'
+
+ target='build/deb-root/usr/lib/python'+version+'/dist-packages'
+
+ if os.path.lexists(os.path.join('build','deb-root')):
+ os.system('rm -rf build/deb-root')
+ os.makedirs(os.path.join('build','deb-root','DEBIAN'))
+
+ os.system("cat DEBIAN/control |sed 's/<PLATFORM>/"+arch+"/g'|sed 's/<VERSION>/"+VERSION+"/g'> build/deb-root/DEBIAN/control")
+
+ os.makedirs(target)
+ os.makedirs('build/deb-root/usr/bin')
+ os.makedirs('build/deb-root/usr/share/applications')
+ os.makedirs('build/deb-root/usr/share/pixmaps')
+
+ os.system('cp -R build/lib.linux-'+platform.machine()+'-'+version+'/skencil '+target)
+ os.system('cp src/skencil.desktop build/deb-root/usr/share/applications')
+ os.system('cp src/skencil.png build/deb-root/usr/share/pixmaps')
+ os.system('cp src/skencil.xpm build/deb-root/usr/share/pixmaps')
+ os.system('cp src/skencil build/deb-root/usr/bin')
+ os.system('chmod +x build/deb-root/usr/bin/skencil')
+
+ if os.path.lexists('dist'):
+ os.system('rm -rf dist/*.deb')
+ else:
+ os.makedirs('dist')
+
+ os.system('dpkg --build build/deb-root/ dist/python-skencil-'+VERSION+'_'+arch+'.deb')
\ No newline at end of file
More information about the Skencil-commits
mailing list