Permalink
Browse files

new build scheme

  • Loading branch information...
1 parent b134844 commit da9deec1531e5717abdcc0e2f10e3b11c1af2000 @svinota committed Oct 12, 2012
Showing with 90 additions and 24 deletions.
  1. +3 −0 MANIFEST.in
  2. +31 −24 Makefile
  3. +12 −0 README.md
  4. +26 −0 configure.gawk
  5. +18 −0 setup.py.in
View
3 MANIFEST.in
@@ -0,0 +1,3 @@
+include python-py9p.spec
+include README*
+include LICENSE
View
55 Makefile
@@ -1,24 +1,12 @@
-# Copyright (c) 2008-2011 Peter V. Saveliev
+# Copyright (c) 2012 Peter V. Saveliev
#
-# This file is part of Connexion project.
+# This file is part of py9p project.
#
-# Connexion is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# Connexion is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Connexion; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+# For license agreement, please look into LICENSE file.
-ifndef python
- python := "python"
-endif
+version ?= "1.0"
+release ?= "1.0.1"
+python ?= "python"
ifdef root
override root := "--root=${root}"
@@ -36,14 +24,33 @@ clean:
rm -rf dist build MANIFEST
find . -name "*pyc" -exec rm -f "{}" \;
-manifest: clean
- find . ! -name setup.py -a ! -name Makefile -a ! -wholename '*.svn*' -a ! -name 'dump' >MANIFEST
+check:
+ for i in py9p examples; \
+ do pep8 $$i || exit 1; \
+ pyflakes $$i || exit 1; \
+ done
+ 2to3 py9p
+
+setup.py:
+ gawk -v version=${version} -v release=${release} -v flavor=${flavor}\
+ -f configure.gawk $@.in >$@
+
+clean-version:
+ rm -f setup.py
-dist: manifest
+update-version: setup.py
+
+force-version: clean-version update-version
+
+docs: clean force-version
+ make -C docs html
+
+dist: clean force-version
${python} setup.py sdist
-build:
- :
+rpm: dist
+ rpmbuild -ta dist/*tar.gz
-install: manifest
+install: clean force-version
${python} setup.py install ${root} ${lib}
+
View
12 README.md
@@ -0,0 +1,12 @@
+py9p
+====
+
+Clone of Andrey Mirtchovski's py9p
+
+ * Documentation: none yet
+ * Installation: make install
+ * Requirements: Python >= 2.6
+
+You can also use the library without installation, but in this case you
+should set up PYTHONPATH manually.
+
View
26 configure.gawk
@@ -0,0 +1,26 @@
+BEGIN {
+ conf["VERSION"] = version
+ conf["RELEASE"] = release
+ conf["alt", "PACKAGER"] = "Peter V. Saveliev <peet@altlinux.org>"
+ conf["rh", "PACKAGER"] = "Peter V. Saveliev <peet@redhat.com>"
+}
+
+{
+ while (1) {
+ # pick one variable
+ variable = gensub(/.*@([^@]*)@.*/,"\\1",1)
+ # no more variables left
+ if (variable == $0) break
+ # value lookup:
+ if (conf[flavor, variable]) {
+ # dist-specific
+ value = conf[flavor, variable]
+ } else {
+ # common variables
+ value = conf[variable]
+ }
+ # substitute the variable
+ gsub("@"variable"@", value)
+ }
+ print $0
+}
View
18 setup.py.in
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+
+from distutils.core import setup
+
+# bump version
+setup(name='py9p',
+ version='@RELEASE@',
+ description='9P Protocol Implementation',
+ author='Andrey Mirtchovski',
+ author_email='aamirtch@ucalgary.ca',
+ maintainer='Peter V. Saveliev',
+ maintainer_email='peet@redhat.com',
+ url='http://grid.ucalgary.ca',
+ license="MIT",
+ packages=[
+ 'py9p'
+ ]
+)

0 comments on commit da9deec

Please sign in to comment.