source: trunk/PyGreSQL.spec @ 711

Last change on this file since 711 was 711, checked in by cito, 3 years ago

Flatten the directory structure of the project

Simplified the directory structure by flattening the "module" subdirectory out
to the root directory. That way, the setup.py script can now also access the
top-level docs subdirectory, so it could also install or build the docs.
There was nothing else in the root directory anyway, except the mkdocs and
mktar scripts which could be made unnecessary through setup.py.

Also made the setup script a bit clearer. Removed the note about MinGW for
Windows since the Microsoft compiler for Python 2.7 and Visual Studio Community
are now freely available including 64bit compilers, and produce less problems.

Note that the usual structure would have been to use a "pygresql" package
directory instead of the "module" directory. But since we install PyGreSQL
as two top-level modules "pg" and "pgdb" instead of a package "pygresql",
the flattened structure reflects that much better. For historical reasons
and people don't want to rewrite import statements, we will keep it that way.

  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1# $Id: PyGreSQL.spec 711 2016-01-11 08:45:05Z cito $
2%define version 3.0
3%define release pre20000310
4%define name PyGreSQL
5%define pythonversion 1.5
6Source: %{name}-%{version}-%{release}.tgz
7Summary: A Python interface for PostgreSQL database.
8Name: %{name}
9Version: %{version}
10Release: %{release}
11#Patch:
12Group: Applications/Databases
13BuildRoot: /tmp/rpmbuild_%{name}
14Copyright: GPL-like
15Requires: python >= %{pythonversion}, postgresql
16Packager: Hartmut Goebel <hartmut@goebel.noris.de>
17Vendor: D'Arcy J.M. Cain <darcy@druid.net>
18URL: http://www.druid.net/pygresql/
19
20%changelog
21#* Tue Oct 06 1998 Fabio Coatti <cova@felix.unife.it>
22#- fixed installation directory files list
23
24%description
25PyGreSQL is a python module that interfaces to a PostgreSQL database. It
26embeds the PostgreSQL query library to allow easy use of the powerful
27PostgreSQL features from a Python script.
28
29Version 3.0 includes DB-API 2.0 support.
30
31%prep
32rm -rf $RPM_BUILD_ROOT
33
34%setup -n %{name}-%{version}-%{release}
35#%patch
36
37%build
38mkdir -p $RPM_BUILD_ROOT/usr/lib/python%{pythonversion}/lib-dynload
39cc -fpic -shared -o $RPM_BUILD_ROOT/usr/lib/python%{pythonversion}/lib-dynload/_pg.so -I/usr/include/pgsql/ -I/usr/include/python1.5 pgmodule.c -lpq
40## import fails, since _pg is not yet installed
41python -c 'import pg' || true
42python -c 'import pgdb' || true
43
44%install
45cp *.py *.pyc $RPM_BUILD_ROOT/usr/lib/python%{pythonversion}/
46
47cd $RPM_BUILD_ROOT
48find . -type f | sed 's,^\.,\%attr(-\,root\,root) ,' > $RPM_BUILD_DIR/file.list.%{name}
49find . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name}
50
51%files -f ../file.list.%{name}
52%doc %attr(-,root,root) Announce ChangeLog README tutorial
53
54
55%clean
56rm -rf $RPM_BUILD_ROOT
57cd $RPM_BUILD_DIR
58rm -rf %{name}-%{version}-%{release} file.list.%{name}
Note: See TracBrowser for help on using the repository browser.