[drats_users] 0.3.2b6 rpmbuild
Mike Heitmann
Sun Nov 15 13:32:51 PST 2009
> > Ok Mike, Try changing your setup.py to this;
> >
> >
> > import sys
> >
> > from d_rats.version import DRATS_VERSION
> > import os
> >
> > def win32_build():
> > from distutils.core import setup
> > import py2exe
> >
> > try:
> > # if this doesn't work, try import modulefinder
> > import py2exe.mf as modulefinder
> > import win32com
> > for p in win32com.__path__[1:]:
> > modulefinder.AddPackagePath("win32com", p)
> > for extra in ["win32com.shell"]: #,"win32com.mapi"
> > __import__(extra)
> > m = sys.modules[extra]
> > for p in m.__path__[1:]:
> > modulefinder.AddPackagePath(extra, p)
> > except ImportError:
> > # no build path setup, no worries.
> > pass
> >
> >
> > opts = {
> > "py2exe" : {
> > "includes" :
> > "pango,atk,gobject,cairo,pangocairo,win32gui,win32com,win32com.shell,email.iterators,email.generator",
> > "compressed" : 1,
> > "optimize" : 2,
> > "bundle_files" : 3,
> > # "packages" : ""
> > }
> > }
> >
> > setup(
> > windows=[{'script' : 'd-rats'},
> > {'script' : 'd-rats_repeater'},
> > {'script' : 'd-rats_mapdownloader'}],
> > data_files=["C:\\GTK\\bin\\jpeg62.dll"],
> > options=opts)
> >
> > def macos_build():
> > from setuptools import setup
> > import shutil
> >
> > APP = ['d-rats-%s.py' % DRATS_VERSION]
> > shutil.copy("d-rats", APP[0])
> > DATA_FILES = [('../Frameworks',
> > ['/opt/local/lib/libpangox-1.0.0.2203.1.dylib']),
> > ('../Resources/pango/1.6.0/modules',
> > ['/opt/local/lib/pango/1.6.0/modules/pango-basic-atsui.so']),
> > ('../Resources',
> > ['images', 'ui']),
> > ]
> > OPTIONS = {'argv_emulation': True, "includes" :
> > "gtk,atk,pangocairo,cairo"}
> >
> > setup(
> > app=APP,
> > data_files=DATA_FILES,
> > options={'py2app': OPTIONS},
> > setup_requires=['py2app'],
> > )
> >
> > def default_build():
> > from distutils.core import setup
> > from glob import glob
> >
> > desktop_files = glob("share/*.desktop")
> > form_files = glob("forms/*.x?l")
> > image_files = glob("images/*")
> > ui_files = glob("ui/*")
> > _locale_files = glob("locale/*/LC_MESSAGES/D-RATS.mo")
> >
> > locale_files = []
> > for f in _locale_files:
> > locale_files.append(("/usr/share/d-rats/%s" %
> > os.path.dirname(f), [f]))
> >
> > print "LOC: %s" % str(ui_files)
> >
> > setup(
> > name="d-rats",
> > packages=["d_rats", "d_rats.geopy", "d_rats.ui",
> > "d_rats.sessions"],
> > version=DRATS_VERSION,
> > scripts=["d-rats", "d-rats_mapdownloader",
> > "d-rats_repeater"],
> > data_files=[('/usr/share/applications', desktop_files),
> >
> > ('/usr/share/d-rats/forms', form_files),
> > ('/usr/share/d-rats/images', image_files),
> > ('/usr/share/d-rats/ui', ui_files),
> >
> > ] + locale_files)
> >
> > if sys.platform == "darwin":
> > macos_build()
> > elif sys.platform == "win32":
> > win32_build()
> > else:
> > default_build()
> >
> >
> >
> > Also add "01" to bdist_rpm.py to patch Fedora python bdist_rpm to
> > match the
> > distro policy wrt .pyo files as here (find this section in
> > bdist_rpm.py and add) as has been done below;
> >
> > your path should be;
> > /usr/lib/python2.6/distutils/command/bdist_rpm.py
> >
> > section patched below;
> >
> >
> >
> > ('build', 'build_script', def_build),
> > ('install', 'install_script',
> > ("%s install "
> > "-O1 "
> > "--root=$RPM_BUILD_ROOT "
> > "--record=INSTALLED_FILES") % def_setup_call),
> > ('clean', 'clean_script', "rm -rf $RPM_BUILD_ROOT"),
> >
> >
> >
> > Then running;
> >
> >
> > python setup.py bdist_rpm --force-arch=i386 --binary-only
> >
> >
> > That should work for you.
> >
Thanks Adrian, That did it!
The patch you gave to bdist_rpm.py was already in place - either a
python 2.6 or FC11 change.
Thanks again!
73,
Mike, N0SO
n0so at att.net
mheitmann at n0so.net
More information about the drats_users
mailing list