rpms/PyX/devel PyX-0.8.1-siteconfig.patch, NONE, 1.1 PyX.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Michael A. Peters (mpeters) fedora-extras-commits at redhat.com
Tue May 2 13:49:33 UTC 2006


Author: mpeters

Update of /cvs/extras/rpms/PyX/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8150/devel

Modified Files:
	.cvsignore sources 
Added Files:
	PyX-0.8.1-siteconfig.patch PyX.spec 
Log Message:
auto-import PyX-0.8.1-4 on branch devel from PyX-0.8.1-4.src.rpm

PyX-0.8.1-siteconfig.patch:

--- NEW FILE PyX-0.8.1-siteconfig.patch ---
diff -ur PyX-0.8.1/setup.py PyX-0.8.1-patched/setup.py
--- PyX-0.8.1/setup.py	2005-08-13 05:32:46.000000000 -0700
+++ PyX-0.8.1-patched/setup.py	2006-04-29 02:49:37.000000000 -0700
@@ -15,8 +15,6 @@
     log = None
 from distutils.core import setup, Extension
 from distutils.util import change_root, convert_path
-from distutils.command.build_py import build_py
-from distutils.command.install_data import install_data
 from distutils.command.install_lib import install_lib
 import ConfigParser
 import sys, os
@@ -81,79 +79,21 @@
 # extend install commands to overwrite siteconfig.py during build and install
 #
 
-
-class pyx_build_py(build_py):
-
-    def build_module(self, module, module_file, package):
-        if package == "pyx" and module == "siteconfig":
-            # generate path information as the original build_module does it
-            outfile = self.get_module_outfile(self.build_lib, [package], module)
-            outdir = os.path.dirname(outfile)
-            self.mkpath(outdir)
-
-            if log:
-                log.info("creating proper %s" % outfile)
-
-            # create the additional relative path parts to be inserted into the
-            # os.path.join methods in the original siteconfig.py
-            indir = os.path.dirname(module_file)
-            addjoinstring = ", ".join(["'..'" for d in outdir.split(os.path.sep)] +
-                                      ["'%s'" % d for d in indir.split(os.path.sep)])
-
-            # write a modifed version of siteconfig.py
-            fin = open(module_file, "r")
-            fout = open(outfile, "w")
-            for line in fin.readlines():
-                fout.write(line.replace("os.path.join(os.path.dirname(__file__), ",
-                                        "os.path.join(os.path.dirname(__file__), %s, " % addjoinstring))
-            fin.close()
-            fout.close()
-        else:
-            return build_py.build_module(self, module, module_file, package)
-
-
-class pyx_install_data(install_data):
-
-    def run(self):
-        self.siteconfiglines = []
-        for dir, files in self.data_files:
-            # append siteconfiglines by "<siteconfigname> = <dir>"
-
-            # get the install directory
-            # (the following four lines are copied from within the install_data.run loop)
-            dir = convert_path(dir)
-            if not os.path.isabs(dir):
-                dir = os.path.join(self.install_dir, dir)
-            elif self.root:
-                dir = change_root(self.root, dir)
-
-            self.siteconfiglines.append("%s = '%s'\n" % (siteconfignames[files], dir))
-
-        install_data.run(self)
-
-
 class pyx_install_lib(install_lib):
 
-    def run(self):
-        # siteconfig.py depends on install_data:
-        self.run_command('install_data')
-        install_lib.run(self)
-
     def install(self):
-        # first we perform the tree_copy
         result = install_lib.install(self)
-
-        # siteconfiglines have been created by install_data
-        siteconfiglines = self.distribution.command_obj["install_data"].siteconfiglines
-
-        # such that we can easily overwrite siteconfig.py
+        root = self.get_finalized_command('install').root
+        if root == None:
+            root = ''
+        pyx_lfsdir = pyx_sharedir = os.path.join(sys.prefix, "share", "pyx")
+        pyx_pyxrc = os.path.join("/", "etc", "pyxrc")
         outfile = os.path.join(self.install_dir, "pyx", "siteconfig.py")
-        if log:
-            log.info("creating proper %s" % outfile)
         f = open(outfile, "w")
-        f.writelines(siteconfiglines)
+        f.write("lfsdir = %r\n" % pyx_lfsdir)
+        f.write("sharedir = %r\n" % pyx_sharedir)
+        f.write("pyxrcdir = %r\n" % pyx_pyxrc)
         f.close()
-
         return result
 
 ################################################################################
@@ -193,7 +133,5 @@
       packages=["pyx", "pyx/graph", "pyx/graph/axis", "pyx/t1strip", "pyx/pykpathsea"],
       ext_modules=ext_modules,
       data_files=data_files,
-      cmdclass = {"build_py": pyx_build_py,
-                  "install_data": pyx_install_data,
-                  "install_lib": pyx_install_lib},
+      cmdclass = {"install_lib": pyx_install_lib},
       **addargs)


--- NEW FILE PyX.spec ---
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Name:           PyX
Version:        0.8.1
Release:        4%{?dist}
Summary:        Python graphics package

Group:          Applications/Publishing
License:        GPL
URL:            http://pyx.sourceforge.net/
Source0:        http://easynews.dl.sourceforge.net/sourceforge/pyx/PyX-%{version}.tar.gz
# Fedora doesn't seem to ship with the python mkhowto script needed to generate
# the manual at build time. The manual here is from:
# http://pyx.sourceforge.net/manual.pdf
Source1:	%{name}-%{version}-manual.pdf
# Fix the install root in the siteconfig.py
Patch0:         PyX-0.8.1-siteconfig.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  python-devel >= 2.2
BuildRequires:  tetex-latex
Requires:   python-abi = %(%{__python} -c "import sys ; print sys.version[:3]")
Requires:   tetex

%description
PyX is a Python package for the creation of PostScript and PDF files. It
combines an abstraction of the PostScript drawing model with a TeX/LaTeX
interface. Complex tasks like 2d and 3d plots in publication-ready quality are
built out of these primitives.

%prep
%setup -q
%patch0 -p1


%build
%{__sed} -i 's?^build_t1strip=.*?build_t1strip=1?' setup.cfg
# Bug #150085 excludes x86_64 - don't enable pykpathsea C module for x86_64
%ifnarch x86_64
%{__sed} -i 's?^build_pykpathsea=.*?build_pykpathsea=1?' setup.cfg
%endif

CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build

# turn on ipc in config file
%{__sed} -i 's?^texipc =.*?texipc = 1?' pyxrc

pushd faq
make
popd

pushd manual
## Nope - fedora doesn't ship with mkhowto
## Bug #177349
# ln -s /path/to/python/mkhowto .
# make
cp %{SOURCE1} ./manual.pdf
popd

%install
rm -rf %{buildroot}
%{__python} setup.py install -O1 --skip-build --root %{buildroot}

# Fix the non-exec with shellbang rpmlint errors
for file in `find %{buildroot}%{python_sitearch}/pyx -type f -name "*.py"`; do
  [ ! -x ${file} ] && %{__sed} -i 's?^#!?##?' ${file}
done
 
%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root,-)
%doc AUTHORS CHANGES LICENSE PKG-INFO README faq/pyxfaq.pdf manual/manual.pdf
%doc contrib/ examples/
%config(noreplace) %{_sysconfdir}/pyxrc
%{_datadir}/pyx/
%dir %{python_sitearch}/pyx
%{python_sitearch}/pyx/*.py
%{python_sitearch}/pyx/*.pyc
%ghost %{python_sitearch}/pyx/*.pyo
%dir %{python_sitearch}/pyx/graph
%{python_sitearch}/pyx/graph/*.py
%{python_sitearch}/pyx/graph/*.pyc
%ghost %{python_sitearch}/pyx/graph/*.pyo
%dir %{python_sitearch}/pyx/graph/axis
%{python_sitearch}/pyx/graph/axis/*.py
%{python_sitearch}/pyx/graph/axis/*.pyc
%ghost %{python_sitearch}/pyx/graph/axis/*.pyo
%dir %{python_sitearch}/pyx/pykpathsea
%{python_sitearch}/pyx/pykpathsea/*.py
%{python_sitearch}/pyx/pykpathsea/*.pyc
%ghost %{python_sitearch}/pyx/pykpathsea/*.pyo
%ifnarch x86_64
%{python_sitearch}/pyx/pykpathsea/*.so
%endif
%dir %{python_sitearch}/pyx/t1strip
%{python_sitearch}/pyx/t1strip/*.py
%{python_sitearch}/pyx/t1strip/*.pyc
%ghost %{python_sitearch}/pyx/t1strip/*.pyo
%{python_sitearch}/pyx/t1strip/*.so


%changelog
* Sun Apr 30 2006 Michael A. Peters <mpeters at mac.com> - 0.8.1-4
- Fixed rpmlint errors noted in 190247#3
- Don't build pykpathsea C module for x86_64 (Bug #150085)

* Sat Apr 29 2006 Michael A. Peters <mpeters at mac.com> - 0.8.1-3
- Fixed a typo in the borrowed SuSE patch

* Sat Apr 29 2006 Michael A. Peters <mpeters at mac.com> - 0.8.1-2
- Fix improper siteconfig.py (Patch0, borrowed from SuSE)
- alter default config file (turn texipc on)
- BuildRequires python-devel >= 2.2

* Sat Apr 29 2006 Michael A. Peters <mpeters at mac.com> - 0.8.1-1
- Initial packaging for Fedora Extras


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/PyX/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	2 May 2006 13:47:52 -0000	1.1
+++ .cvsignore	2 May 2006 13:49:32 -0000	1.2
@@ -0,0 +1,2 @@
+PyX-0.8.1-manual.pdf
+PyX-0.8.1.tar.gz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/PyX/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	2 May 2006 13:47:52 -0000	1.1
+++ sources	2 May 2006 13:49:32 -0000	1.2
@@ -0,0 +1,2 @@
+bfab7bbc4f3442c946f489133df515f0  PyX-0.8.1-manual.pdf
+5e751cef8d62774a6fc659cc9a03c231  PyX-0.8.1.tar.gz




More information about the fedora-extras-commits mailing list