[Freeipa-devel] [freeipa PR#132][synchronized] Draft for a new setup.py (WIP)

2016-10-20 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/132
Author: tiran
 Title: #132: Draft for a new setup.py (WIP)
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/132/head:pr132
git checkout pr132
From 3c8ae8e98046480904b28d367c45eeaa01f39d62 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Thu, 20 Oct 2016 11:57:08 +0200
Subject: [PATCH 1/2] Remove ipapython/ipa.conf

The file ipapython/ipa.conf is no longer used and not installed.

Signed-off-by: Christian Heimes 
---
 ipapython/MANIFEST.in | 2 --
 ipapython/ipa.conf| 3 ---
 2 files changed, 5 deletions(-)
 delete mode 100644 ipapython/MANIFEST.in
 delete mode 100644 ipapython/ipa.conf

diff --git a/ipapython/MANIFEST.in b/ipapython/MANIFEST.in
deleted file mode 100644
index d178f08..000
--- a/ipapython/MANIFEST.in
+++ /dev/null
@@ -1,2 +0,0 @@
-include *.conf
-
diff --git a/ipapython/ipa.conf b/ipapython/ipa.conf
deleted file mode 100644
index 516f764..000
--- a/ipapython/ipa.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-[defaults]
-# realm = EXAMPLE.COM
-# server = ipa.example.com

From 2982ce5180337f9249c216ec6bc84e48e5f99b39 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Tue, 4 Oct 2016 13:23:22 +0200
Subject: [PATCH 2/2] Port all setup.py to setuptools

All setup.py files are now using setuptools through a common file
ipasetup.py. The file is auto-generated and contain all common
settings.

Signed-off-by: Christian Heimes 
---
 .gitignore  | 11 ++
 MANIFEST.in |  2 -
 Makefile| 57 +
 ipaclient/setup.cfg |  5 +++
 ipaclient/setup.py  | 44 ++
 ipaclient/setup.py.in   | 80 
 ipalib/Makefile |  2 +-
 ipalib/setup.cfg|  5 +++
 ipalib/setup.py | 38 +++
 ipalib/setup.py.in  | 71 
 ipaplatform/setup.cfg   |  5 +++
 ipaplatform/setup.py| 42 +
 ipaplatform/setup.py.in | 79 
 ipapython/Makefile  |  2 +-
 ipapython/setup.cfg |  5 +++
 ipapython/setup.py  | 41 +
 ipapython/setup.py.in   | 79 
 ipasetup.py.in  | 71 
 ipatests/setup.cfg  |  5 +++
 ipatests/setup.py   | 60 ++
 ipatests/setup.py.in| 97 -
 setup.cfg   |  5 +++
 setup.py|  8 ++--
 23 files changed, 370 insertions(+), 444 deletions(-)
 delete mode 100644 MANIFEST.in
 create mode 100644 ipaclient/setup.cfg
 create mode 100644 ipaclient/setup.py
 delete mode 100644 ipaclient/setup.py.in
 create mode 100644 ipalib/setup.cfg
 create mode 100644 ipalib/setup.py
 delete mode 100644 ipalib/setup.py.in
 create mode 100644 ipaplatform/setup.cfg
 create mode 100644 ipaplatform/setup.py
 delete mode 100644 ipaplatform/setup.py.in
 create mode 100644 ipapython/setup.cfg
 create mode 100755 ipapython/setup.py
 delete mode 100755 ipapython/setup.py.in
 create mode 100644 ipasetup.py.in
 create mode 100644 ipatests/setup.cfg
 create mode 100644 ipatests/setup.py
 delete mode 100644 ipatests/setup.py.in
 create mode 100644 setup.cfg

diff --git a/.gitignore b/.gitignore
index 9b15475..e471371 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,8 +39,12 @@ freeipa2-dev-doc
 /freeipa.spec
 !/Makefile
 /dist/
+/*/dist/
 /RELEASE
 /rpmbuild/
+# Build
+/ipasetup.py
+*.egg-info
 
 # Subdirectories
 /daemons/ipa-otpd/ipa-otpd
@@ -64,16 +68,9 @@ freeipa2-dev-doc
 /client/ipa-join
 /client/ipa-rmkeytab
 
-/ipatests/setup.py
-
-/ipaclient/setup.py
-
-/ipalib/setup.py
 !/ipalib/Makefile
 
-/ipapython/setup.py
 /ipapython/version.py
 !/ipapython/Makefile
 
 /ipaplatform/__init__.py
-/ipaplatform/setup.py
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index dd76e10..000
--- a/MANIFEST.in
+++ /dev/null
@@ -1,2 +0,0 @@
-include COPYING TODO lite-server.py
-include tests/*/*.py
diff --git a/Makefile b/Makefile
index 0435fe9..2c3c325 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ include VERSION
 SUBDIRS=asn1 daemons install ipapython ipalib
 CLIENTDIRS=ipapython ipalib client asn1
 CLIENTPYDIRS=ipaclient ipaplatform
+PYPKGDIRS=$(CLIENTPYDIRS) ipalib ipapython ipatests
 
 PRJ_PREFIX=freeipa
 
@@ -74,6 +75,10 @@ all: bootstrap-autogen server tests
 		(cd $$subdir && $(MAKE) $@) || exit 1; \
 	done
 
+# empty target to force executation
+.PHONY=FORCE
+FORCE:
+
 client: client-autogen
 	@for subdir in $(CLIENTDIRS); do \
 		(cd $$subdir && $(MAKE) all) || exit 1; \
@@ -161,31 +166,41 @@ test:
 release-update:
 	if [ ! -e RELEASE ]; then echo 0 > RELEASE; fi
 
-version-update: release-update
+ipapython/version.py: ipapython/version.py.in FORCE
+	sed -e s/__VERSION__/$(IPA_VERSION)/ $< > $@
+	sed -i -e "s:__NUM_

[Freeipa-devel] [freeipa PR#132][synchronized] Draft for a new setup.py (WIP)

2016-10-20 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/132
Author: tiran
 Title: #132: Draft for a new setup.py (WIP)
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/132/head:pr132
git checkout pr132
From 4c59f8a49e9a2cceb922585b1b39abbc2302aa04 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Tue, 4 Oct 2016 13:23:22 +0200
Subject: [PATCH] Port all setup.py to setuptools

All setup.py files are now using setuptools through a common file
ipasetup.py. The file is auto-generated and contain all common
settings.

Signed-off-by: Christian Heimes 
---
 .gitignore  | 11 ++
 MANIFEST.in |  2 -
 Makefile| 57 +
 ipaclient/setup.cfg |  5 +++
 ipaclient/setup.py  | 44 ++
 ipaclient/setup.py.in   | 80 
 ipalib/Makefile |  2 +-
 ipalib/setup.cfg|  5 +++
 ipalib/setup.py | 38 +++
 ipalib/setup.py.in  | 71 
 ipaplatform/setup.cfg   |  5 +++
 ipaplatform/setup.py| 42 +
 ipaplatform/setup.py.in | 79 
 ipapython/MANIFEST.in   |  2 -
 ipapython/Makefile  |  2 +-
 ipapython/ipa.conf  |  3 --
 ipapython/setup.cfg |  5 +++
 ipapython/setup.py  | 41 +
 ipapython/setup.py.in   | 79 
 ipasetup.py.in  | 71 
 ipatests/setup.cfg  |  5 +++
 ipatests/setup.py   | 60 ++
 ipatests/setup.py.in| 97 -
 setup.cfg   |  5 +++
 setup.py|  8 ++--
 25 files changed, 370 insertions(+), 449 deletions(-)
 delete mode 100644 MANIFEST.in
 create mode 100644 ipaclient/setup.cfg
 create mode 100644 ipaclient/setup.py
 delete mode 100644 ipaclient/setup.py.in
 create mode 100644 ipalib/setup.cfg
 create mode 100644 ipalib/setup.py
 delete mode 100644 ipalib/setup.py.in
 create mode 100644 ipaplatform/setup.cfg
 create mode 100644 ipaplatform/setup.py
 delete mode 100644 ipaplatform/setup.py.in
 delete mode 100644 ipapython/MANIFEST.in
 delete mode 100644 ipapython/ipa.conf
 create mode 100644 ipapython/setup.cfg
 create mode 100755 ipapython/setup.py
 delete mode 100755 ipapython/setup.py.in
 create mode 100644 ipasetup.py.in
 create mode 100644 ipatests/setup.cfg
 create mode 100644 ipatests/setup.py
 delete mode 100644 ipatests/setup.py.in
 create mode 100644 setup.cfg

diff --git a/.gitignore b/.gitignore
index 9b15475..e471371 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,8 +39,12 @@ freeipa2-dev-doc
 /freeipa.spec
 !/Makefile
 /dist/
+/*/dist/
 /RELEASE
 /rpmbuild/
+# Build
+/ipasetup.py
+*.egg-info
 
 # Subdirectories
 /daemons/ipa-otpd/ipa-otpd
@@ -64,16 +68,9 @@ freeipa2-dev-doc
 /client/ipa-join
 /client/ipa-rmkeytab
 
-/ipatests/setup.py
-
-/ipaclient/setup.py
-
-/ipalib/setup.py
 !/ipalib/Makefile
 
-/ipapython/setup.py
 /ipapython/version.py
 !/ipapython/Makefile
 
 /ipaplatform/__init__.py
-/ipaplatform/setup.py
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index dd76e10..000
--- a/MANIFEST.in
+++ /dev/null
@@ -1,2 +0,0 @@
-include COPYING TODO lite-server.py
-include tests/*/*.py
diff --git a/Makefile b/Makefile
index 0435fe9..2c3c325 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ include VERSION
 SUBDIRS=asn1 daemons install ipapython ipalib
 CLIENTDIRS=ipapython ipalib client asn1
 CLIENTPYDIRS=ipaclient ipaplatform
+PYPKGDIRS=$(CLIENTPYDIRS) ipalib ipapython ipatests
 
 PRJ_PREFIX=freeipa
 
@@ -74,6 +75,10 @@ all: bootstrap-autogen server tests
 		(cd $$subdir && $(MAKE) $@) || exit 1; \
 	done
 
+# empty target to force executation
+.PHONY=FORCE
+FORCE:
+
 client: client-autogen
 	@for subdir in $(CLIENTDIRS); do \
 		(cd $$subdir && $(MAKE) all) || exit 1; \
@@ -161,31 +166,41 @@ test:
 release-update:
 	if [ ! -e RELEASE ]; then echo 0 > RELEASE; fi
 
-version-update: release-update
+ipapython/version.py: ipapython/version.py.in FORCE
+	sed -e s/__VERSION__/$(IPA_VERSION)/ $< > $@
+	sed -i -e "s:__NUM_VERSION__:$(IPA_NUM_VERSION):" $@
+	sed -i -e "s:__VENDOR_VERSION__:$(IPA_VENDOR_VERSION):" $@
+	sed -i -e "s:__API_VERSION__:$(IPA_API_VERSION_MAJOR).$(IPA_API_VERSION_MINOR):" $@
+	grep -Po '(?<=default: ).*' API.txt | sed -n -i -e "/__DEFAULT_PLUGINS__/!{p;b};r /dev/stdin" $@
+	touch -r $< $@
+
+ipasetup.py: ipasetup.py.in FORCE
+	sed -e s/__VERSION__/$(IPA_VERSION)/ $< > $@
+
+ipaplatform/__init__.py: ipaplatform/__init__.py.in FORCE
+	if [ "$(SUPPORTED_PLATFORM)" != "" ]; then \
+	sed -e s/__PLATFORM__/$(SUPPORTED_PLATFORM)/ \
+	$< > $@; \
+	rm -f ipaplatform/constants.py ipaplatform/paths.py ipaplatform/services.py ipaplatform/tasks.py ; \
+	fi
+
+.PHONY: egg_info
+egg_info: ipapython/versi

[Freeipa-devel] [freeipa PR#132][synchronized] Draft for a new setup.py (WIP)

2016-10-20 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/132
Author: tiran
 Title: #132: Draft for a new setup.py (WIP)
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/132/head:pr132
git checkout pr132
From 6a6cdf9a01c7d042c881edd54afc354de96c0247 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Tue, 4 Oct 2016 13:23:22 +0200
Subject: [PATCH] Draft for a new setup.py

Signed-off-by: Christian Heimes 
---
 .gitignore  | 11 ++
 MANIFEST.in |  2 -
 Makefile| 57 +
 ipaclient/setup.cfg |  5 +++
 ipaclient/setup.py  | 44 ++
 ipaclient/setup.py.in   | 80 
 ipalib/Makefile |  2 +-
 ipalib/setup.cfg|  5 +++
 ipalib/setup.py | 38 +++
 ipalib/setup.py.in  | 71 
 ipaplatform/setup.cfg   |  5 +++
 ipaplatform/setup.py| 42 +
 ipaplatform/setup.py.in | 79 
 ipapython/MANIFEST.in   |  2 -
 ipapython/Makefile  |  2 +-
 ipapython/setup.cfg |  5 +++
 ipapython/setup.py  | 44 ++
 ipapython/setup.py.in   | 79 
 ipasetup.py.in  | 71 
 ipatests/setup.cfg  |  5 +++
 ipatests/setup.py   | 60 ++
 ipatests/setup.py.in| 97 -
 setup.cfg   |  5 +++
 setup.py|  8 ++--
 24 files changed, 373 insertions(+), 446 deletions(-)
 delete mode 100644 MANIFEST.in
 create mode 100644 ipaclient/setup.cfg
 create mode 100644 ipaclient/setup.py
 delete mode 100644 ipaclient/setup.py.in
 create mode 100644 ipalib/setup.cfg
 create mode 100644 ipalib/setup.py
 delete mode 100644 ipalib/setup.py.in
 create mode 100644 ipaplatform/setup.cfg
 create mode 100644 ipaplatform/setup.py
 delete mode 100644 ipaplatform/setup.py.in
 delete mode 100644 ipapython/MANIFEST.in
 create mode 100644 ipapython/setup.cfg
 create mode 100755 ipapython/setup.py
 delete mode 100755 ipapython/setup.py.in
 create mode 100644 ipasetup.py.in
 create mode 100644 ipatests/setup.cfg
 create mode 100644 ipatests/setup.py
 delete mode 100644 ipatests/setup.py.in
 create mode 100644 setup.cfg

diff --git a/.gitignore b/.gitignore
index 9b15475..e471371 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,8 +39,12 @@ freeipa2-dev-doc
 /freeipa.spec
 !/Makefile
 /dist/
+/*/dist/
 /RELEASE
 /rpmbuild/
+# Build
+/ipasetup.py
+*.egg-info
 
 # Subdirectories
 /daemons/ipa-otpd/ipa-otpd
@@ -64,16 +68,9 @@ freeipa2-dev-doc
 /client/ipa-join
 /client/ipa-rmkeytab
 
-/ipatests/setup.py
-
-/ipaclient/setup.py
-
-/ipalib/setup.py
 !/ipalib/Makefile
 
-/ipapython/setup.py
 /ipapython/version.py
 !/ipapython/Makefile
 
 /ipaplatform/__init__.py
-/ipaplatform/setup.py
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index dd76e10..000
--- a/MANIFEST.in
+++ /dev/null
@@ -1,2 +0,0 @@
-include COPYING TODO lite-server.py
-include tests/*/*.py
diff --git a/Makefile b/Makefile
index 0435fe9..2c3c325 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ include VERSION
 SUBDIRS=asn1 daemons install ipapython ipalib
 CLIENTDIRS=ipapython ipalib client asn1
 CLIENTPYDIRS=ipaclient ipaplatform
+PYPKGDIRS=$(CLIENTPYDIRS) ipalib ipapython ipatests
 
 PRJ_PREFIX=freeipa
 
@@ -74,6 +75,10 @@ all: bootstrap-autogen server tests
 		(cd $$subdir && $(MAKE) $@) || exit 1; \
 	done
 
+# empty target to force executation
+.PHONY=FORCE
+FORCE:
+
 client: client-autogen
 	@for subdir in $(CLIENTDIRS); do \
 		(cd $$subdir && $(MAKE) all) || exit 1; \
@@ -161,31 +166,41 @@ test:
 release-update:
 	if [ ! -e RELEASE ]; then echo 0 > RELEASE; fi
 
-version-update: release-update
+ipapython/version.py: ipapython/version.py.in FORCE
+	sed -e s/__VERSION__/$(IPA_VERSION)/ $< > $@
+	sed -i -e "s:__NUM_VERSION__:$(IPA_NUM_VERSION):" $@
+	sed -i -e "s:__VENDOR_VERSION__:$(IPA_VENDOR_VERSION):" $@
+	sed -i -e "s:__API_VERSION__:$(IPA_API_VERSION_MAJOR).$(IPA_API_VERSION_MINOR):" $@
+	grep -Po '(?<=default: ).*' API.txt | sed -n -i -e "/__DEFAULT_PLUGINS__/!{p;b};r /dev/stdin" $@
+	touch -r $< $@
+
+ipasetup.py: ipasetup.py.in FORCE
+	sed -e s/__VERSION__/$(IPA_VERSION)/ $< > $@
+
+ipaplatform/__init__.py: ipaplatform/__init__.py.in FORCE
+	if [ "$(SUPPORTED_PLATFORM)" != "" ]; then \
+	sed -e s/__PLATFORM__/$(SUPPORTED_PLATFORM)/ \
+	$< > $@; \
+	rm -f ipaplatform/constants.py ipaplatform/paths.py ipaplatform/services.py ipaplatform/tasks.py ; \
+	fi
+
+.PHONY: egg_info
+egg_info: ipapython/version.py ipaplatform/__init__.py ipasetup.py
+	$(PYTHON) setup.py egg_info $(EXTRA_SETUP)
+	for directory in $(PYPKGDIRS); do \
+	pushd $${directory} ; \
+	$(PYTHON) setup.py egg_info $(EXTRA_SETUP); \
+	popd 

[Freeipa-devel] [freeipa PR#132][synchronized] Draft for a new setup.py (WIP)

2016-10-19 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/132
Author: tiran
 Title: #132: Draft for a new setup.py (WIP)
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/132/head:pr132
git checkout pr132
From 6973e69e17cdee5816ab81f31fd7385b86dfed33 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Tue, 4 Oct 2016 13:23:22 +0200
Subject: [PATCH] Draft for a new setup.py

Signed-off-by: Christian Heimes 
---
 .gitignore  | 11 ++
 MANIFEST.in |  2 -
 Makefile| 66 +++--
 ipaclient/setup.cfg |  5 +++
 ipaclient/setup.py  | 44 ++
 ipaclient/setup.py.in   | 80 
 ipalib/Makefile |  2 +-
 ipalib/setup.cfg|  5 +++
 ipalib/setup.py | 38 +++
 ipalib/setup.py.in  | 71 
 ipaplatform/setup.cfg   |  5 +++
 ipaplatform/setup.py| 42 +
 ipaplatform/setup.py.in | 79 
 ipapython/MANIFEST.in   |  2 -
 ipapython/Makefile  |  2 +-
 ipapython/setup.cfg |  5 +++
 ipapython/setup.py  | 44 ++
 ipapython/setup.py.in   | 79 
 ipasetup.py.in  | 71 
 ipatests/setup.cfg  |  5 +++
 ipatests/setup.py   | 60 ++
 ipatests/setup.py.in| 97 -
 setup.cfg   |  5 +++
 setup.py|  8 ++--
 24 files changed, 377 insertions(+), 451 deletions(-)
 delete mode 100644 MANIFEST.in
 create mode 100644 ipaclient/setup.cfg
 create mode 100644 ipaclient/setup.py
 delete mode 100644 ipaclient/setup.py.in
 create mode 100644 ipalib/setup.cfg
 create mode 100644 ipalib/setup.py
 delete mode 100644 ipalib/setup.py.in
 create mode 100644 ipaplatform/setup.cfg
 create mode 100644 ipaplatform/setup.py
 delete mode 100644 ipaplatform/setup.py.in
 delete mode 100644 ipapython/MANIFEST.in
 create mode 100644 ipapython/setup.cfg
 create mode 100755 ipapython/setup.py
 delete mode 100755 ipapython/setup.py.in
 create mode 100644 ipasetup.py.in
 create mode 100644 ipatests/setup.cfg
 create mode 100644 ipatests/setup.py
 delete mode 100644 ipatests/setup.py.in
 create mode 100644 setup.cfg

diff --git a/.gitignore b/.gitignore
index 61054de..37b8004 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,8 +39,12 @@ freeipa2-dev-doc
 /freeipa.spec
 !/Makefile
 /dist/
+/*/dist/
 /RELEASE
 /rpmbuild/
+# Build
+/ipasetup.py
+*.egg-info
 
 # Subdirectories
 /daemons/ipa-otpd/ipa-otpd
@@ -64,19 +68,12 @@ freeipa2-dev-doc
 /client/ipa-join
 /client/ipa-rmkeytab
 
-/ipatests/setup.py
-
-/ipaclient/setup.py
-
-/ipalib/setup.py
 !/ipalib/Makefile
 
-/ipapython/setup.py
 /ipapython/version.py
 !/ipapython/Makefile
 
 /ipaplatform/__init__.py
-/ipaplatform/setup.py
 /ipaplatform/tasks.py
 /ipaplatform/services.py
 /ipaplatform/paths.py
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index dd76e10..000
--- a/MANIFEST.in
+++ /dev/null
@@ -1,2 +0,0 @@
-include COPYING TODO lite-server.py
-include tests/*/*.py
diff --git a/Makefile b/Makefile
index 6324308..324086d 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ include VERSION
 SUBDIRS=asn1 daemons install ipapython ipalib
 CLIENTDIRS=ipapython ipalib client asn1
 CLIENTPYDIRS=ipaclient ipaplatform
+PYPKGDIRS=$(CLIENTPYDIRS) ipalib ipapython ipatests
 
 PRJ_PREFIX=freeipa
 
@@ -74,6 +75,10 @@ all: bootstrap-autogen server tests
 		(cd $$subdir && $(MAKE) $@) || exit 1; \
 	done
 
+# empty target to force executation
+.PHONY=FORCE
+FORCE:
+
 client: client-autogen
 	@for subdir in $(CLIENTDIRS); do \
 		(cd $$subdir && $(MAKE) all) || exit 1; \
@@ -161,31 +166,45 @@ test:
 release-update:
 	if [ ! -e RELEASE ]; then echo 0 > RELEASE; fi
 
-version-update: release-update
+ipapython/version.py: ipapython/version.py.in FORCE
+	sed -e s/__VERSION__/$(IPA_VERSION)/ $< > $@
+	sed -i -e "s:__NUM_VERSION__:$(IPA_NUM_VERSION):" $@
+	sed -i -e "s:__VENDOR_VERSION__:$(IPA_VENDOR_VERSION):" $@
+	sed -i -e "s:__API_VERSION__:$(IPA_API_VERSION_MAJOR).$(IPA_API_VERSION_MINOR):" $@
+	grep -Po '(?<=default: ).*' API.txt | sed -n -i -e "/__DEFAULT_PLUGINS__/!{p;b};r /dev/stdin" $@
+	touch -r $< $@
+
+ipasetup.py: ipasetup.py.in FORCE
+	sed -e s/__VERSION__/$(IPA_VERSION)/ $< > $@
+
+ipaplatform/__init__.py: ipaplatform/__init__.py.in FORCE
+	if [ "$(SUPPORTED_PLATFORM)" != "" ]; then \
+		sed -e s/__PLATFORM__/$(SUPPORTED_PLATFORM)/ \
+			$< > $@; \
+		rm -f ipaplatform/paths.py ipaplatform/services.py ipaplatform/tasks.py ipaplatform/constants.py; \
+		ln -s $(SUPPORTED_PLATFORM)/paths.py ipaplatform/paths.py; \
+		ln -s $(SUPPORTED_PLATFORM)/services.py ipaplatform/services.py; \
+		ln -s $(SUPPORTED_PLATFORM)/tasks.py ipaplatform/tasks.py; \
+		ln -

[Freeipa-devel] [freeipa PR#132][synchronized] Draft for a new setup.py (WIP)

2016-10-19 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/132
Author: tiran
 Title: #132: Draft for a new setup.py (WIP)
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/132/head:pr132
git checkout pr132
From e85fd89e975d2491489e3eae8e7b347ec4490aff Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Tue, 4 Oct 2016 13:23:22 +0200
Subject: [PATCH] Draft for a new setup.py

Signed-off-by: Christian Heimes 
---
 .gitignore  | 13 +++
 MANIFEST.in |  2 -
 Makefile| 66 +++--
 ipaclient/setup.cfg |  5 +++
 ipaclient/setup.py  | 44 ++
 ipaclient/setup.py.in   | 80 
 ipalib/Makefile |  2 +-
 ipalib/setup.cfg|  5 +++
 ipalib/setup.py | 38 +++
 ipalib/setup.py.in  | 71 
 ipaplatform/setup.cfg   |  5 +++
 ipaplatform/setup.py| 42 +
 ipaplatform/setup.py.in | 79 
 ipapython/MANIFEST.in   |  2 -
 ipapython/Makefile  |  2 +-
 ipapython/setup.cfg |  5 +++
 ipapython/setup.py  | 44 ++
 ipapython/setup.py.in   | 79 
 ipasetup.py.in  | 71 
 ipatests/setup.cfg  |  5 +++
 ipatests/setup.py   | 60 ++
 ipatests/setup.py.in| 97 -
 setup.cfg   |  5 +++
 setup.py|  8 ++--
 24 files changed, 378 insertions(+), 452 deletions(-)
 delete mode 100644 MANIFEST.in
 create mode 100644 ipaclient/setup.cfg
 create mode 100644 ipaclient/setup.py
 delete mode 100644 ipaclient/setup.py.in
 create mode 100644 ipalib/setup.cfg
 create mode 100644 ipalib/setup.py
 delete mode 100644 ipalib/setup.py.in
 create mode 100644 ipaplatform/setup.cfg
 create mode 100644 ipaplatform/setup.py
 delete mode 100644 ipaplatform/setup.py.in
 delete mode 100644 ipapython/MANIFEST.in
 create mode 100644 ipapython/setup.cfg
 create mode 100755 ipapython/setup.py
 delete mode 100755 ipapython/setup.py.in
 create mode 100644 ipasetup.py.in
 create mode 100644 ipatests/setup.cfg
 create mode 100644 ipatests/setup.py
 delete mode 100644 ipatests/setup.py.in
 create mode 100644 setup.cfg

diff --git a/.gitignore b/.gitignore
index 61054de..9bdaa93 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,8 +39,12 @@ freeipa2-dev-doc
 /freeipa.spec
 !/Makefile
 /dist/
+/*/dist/
 /RELEASE
 /rpmbuild/
+# Build
+/ipasetup.py
+*.egg-info
 
 # Subdirectories
 /daemons/ipa-otpd/ipa-otpd
@@ -64,20 +68,13 @@ freeipa2-dev-doc
 /client/ipa-join
 /client/ipa-rmkeytab
 
-/ipatests/setup.py
-
-/ipaclient/setup.py
-
-/ipalib/setup.py
 !/ipalib/Makefile
 
-/ipapython/setup.py
 /ipapython/version.py
 !/ipapython/Makefile
 
 /ipaplatform/__init__.py
-/ipaplatform/setup.py
+/ipaplatform/constants.py
 /ipaplatform/tasks.py
 /ipaplatform/services.py
 /ipaplatform/paths.py
-/ipaplatform/constants.py
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index dd76e10..000
--- a/MANIFEST.in
+++ /dev/null
@@ -1,2 +0,0 @@
-include COPYING TODO lite-server.py
-include tests/*/*.py
diff --git a/Makefile b/Makefile
index 6324308..3ff25b0 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ include VERSION
 SUBDIRS=asn1 daemons install ipapython ipalib
 CLIENTDIRS=ipapython ipalib client asn1
 CLIENTPYDIRS=ipaclient ipaplatform
+PYPKGDIRS=$(CLIENTPYDIRS) ipalib ipapython ipatests
 
 PRJ_PREFIX=freeipa
 
@@ -74,6 +75,10 @@ all: bootstrap-autogen server tests
 		(cd $$subdir && $(MAKE) $@) || exit 1; \
 	done
 
+# empty target to force executation
+.PHONY=FORCE
+FORCE:
+
 client: client-autogen
 	@for subdir in $(CLIENTDIRS); do \
 		(cd $$subdir && $(MAKE) all) || exit 1; \
@@ -161,31 +166,45 @@ test:
 release-update:
 	if [ ! -e RELEASE ]; then echo 0 > RELEASE; fi
 
-version-update: release-update
+ipapython/version.py: ipapython/version.py.in FORCE
+	sed -e s/__VERSION__/$(IPA_VERSION)/ $< > $@
+	sed -i -e "s:__NUM_VERSION__:$(IPA_NUM_VERSION):" $@
+	sed -i -e "s:__VENDOR_VERSION__:$(IPA_VENDOR_VERSION):" $@
+	sed -i -e "s:__API_VERSION__:$(IPA_API_VERSION_MAJOR).$(IPA_API_VERSION_MINOR):" $@
+	grep -Po '(?<=default: ).*' API.txt | sed -n -i -e "/__DEFAULT_PLUGINS__/!{p;b};r /dev/stdin" $@
+	touch -r $< $@
+
+ipasetup.py: ipasetup.py.in FORCE
+	sed -e s/__VERSION__/$(IPA_VERSION)/ $< > $@
+
+ipaplatform/__init__.py: ipaplatform/__init__.py.in FORCE
+	if [ "$(SUPPORTED_PLATFORM)" != "" ]; then \
+		sed -e s/__PLATFORM__/$(SUPPORTED_PLATFORM)/ \
+			$< > $@; \
+		rm -f ipaplatform/paths.py ipaplatform/services.py ipaplatform/tasks.py ipaplatform/constants.py; \
+		ln -s $(SUPPORTED_PLATFORM)/paths.py ipaplatform/paths.py; \
+		ln -s $(SUPPORTED_PLATFORM)/services.py ipaplatform/services.py; \
+		ln -s $(SUPPO

[Freeipa-devel] [freeipa PR#132][synchronized] Draft for a new setup.py (WIP)

2016-10-19 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/132
Author: tiran
 Title: #132: Draft for a new setup.py (WIP)
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/132/head:pr132
git checkout pr132
From b21ed18d045e19d588ae9b42688daf2615eb9c7f Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Tue, 4 Oct 2016 13:23:22 +0200
Subject: [PATCH] Draft for a new setup.py

Signed-off-by: Christian Heimes 
---
 .gitignore  | 15 ++--
 MANIFEST.in |  2 -
 Makefile| 45 ++-
 ipaclient/setup.cfg |  5 +++
 ipaclient/setup.py  | 44 ++
 ipaclient/setup.py.in   | 80 
 ipalib/Makefile |  2 +-
 ipalib/setup.cfg|  5 +++
 ipalib/setup.py | 38 +++
 ipalib/setup.py.in  | 71 
 ipaplatform/setup.cfg   |  5 +++
 ipaplatform/setup.py| 42 +
 ipaplatform/setup.py.in | 79 
 ipapython/MANIFEST.in   |  2 -
 ipapython/Makefile  |  2 +-
 ipapython/setup.cfg |  5 +++
 ipapython/setup.py  | 44 ++
 ipapython/setup.py.in   | 79 
 ipasetup.py.in  | 71 
 ipatests/setup.cfg  |  5 +++
 ipatests/setup.py   | 60 ++
 ipatests/setup.py.in| 97 -
 setup.cfg   |  5 +++
 setup.py|  8 ++--
 24 files changed, 366 insertions(+), 445 deletions(-)
 delete mode 100644 MANIFEST.in
 create mode 100644 ipaclient/setup.cfg
 create mode 100644 ipaclient/setup.py
 delete mode 100644 ipaclient/setup.py.in
 create mode 100644 ipalib/setup.cfg
 create mode 100644 ipalib/setup.py
 delete mode 100644 ipalib/setup.py.in
 create mode 100644 ipaplatform/setup.cfg
 create mode 100644 ipaplatform/setup.py
 delete mode 100644 ipaplatform/setup.py.in
 delete mode 100644 ipapython/MANIFEST.in
 create mode 100644 ipapython/setup.cfg
 create mode 100755 ipapython/setup.py
 delete mode 100755 ipapython/setup.py.in
 create mode 100644 ipasetup.py.in
 create mode 100644 ipatests/setup.cfg
 create mode 100644 ipatests/setup.py
 delete mode 100644 ipatests/setup.py.in
 create mode 100644 setup.cfg

diff --git a/.gitignore b/.gitignore
index 61054de..e471371 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,8 +39,12 @@ freeipa2-dev-doc
 /freeipa.spec
 !/Makefile
 /dist/
+/*/dist/
 /RELEASE
 /rpmbuild/
+# Build
+/ipasetup.py
+*.egg-info
 
 # Subdirectories
 /daemons/ipa-otpd/ipa-otpd
@@ -64,20 +68,9 @@ freeipa2-dev-doc
 /client/ipa-join
 /client/ipa-rmkeytab
 
-/ipatests/setup.py
-
-/ipaclient/setup.py
-
-/ipalib/setup.py
 !/ipalib/Makefile
 
-/ipapython/setup.py
 /ipapython/version.py
 !/ipapython/Makefile
 
 /ipaplatform/__init__.py
-/ipaplatform/setup.py
-/ipaplatform/tasks.py
-/ipaplatform/services.py
-/ipaplatform/paths.py
-/ipaplatform/constants.py
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index dd76e10..000
--- a/MANIFEST.in
+++ /dev/null
@@ -1,2 +0,0 @@
-include COPYING TODO lite-server.py
-include tests/*/*.py
diff --git a/Makefile b/Makefile
index 6324308..4e6844b 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ include VERSION
 SUBDIRS=asn1 daemons install ipapython ipalib
 CLIENTDIRS=ipapython ipalib client asn1
 CLIENTPYDIRS=ipaclient ipaplatform
+PYPKGDIRS=$(CLIENTPYDIRS) ipalib ipapython ipatests
 
 PRJ_PREFIX=freeipa
 
@@ -74,6 +75,10 @@ all: bootstrap-autogen server tests
 		(cd $$subdir && $(MAKE) $@) || exit 1; \
 	done
 
+# empty target to force executation
+.PHONY=FORCE
+FORCE:
+
 client: client-autogen
 	@for subdir in $(CLIENTDIRS); do \
 		(cd $$subdir && $(MAKE) all) || exit 1; \
@@ -161,31 +166,34 @@ test:
 release-update:
 	if [ ! -e RELEASE ]; then echo 0 > RELEASE; fi
 
-version-update: release-update
+ipapython/version.py: ipapython/version.py.in FORCE
+	sed -e s/__VERSION__/$(IPA_VERSION)/ $< > $@
+	sed -i -e "s:__NUM_VERSION__:$(IPA_NUM_VERSION):" $@
+	sed -i -e "s:__VENDOR_VERSION__:$(IPA_VENDOR_VERSION):" $@
+	sed -i -e "s:__API_VERSION__:$(IPA_API_VERSION_MAJOR).$(IPA_API_VERSION_MINOR):" $@
+	grep -Po '(?<=default: ).*' API.txt | sed -n -i -e "/__DEFAULT_PLUGINS__/!{p;b};r /dev/stdin" $@
+	touch -r $< $@
+
+ipasetup.py: ipasetup.py.in ipapython/version.py FORCE
+	sed -e s/__VERSION__/$(IPA_VERSION)/ $< > $@
+
+.PHONY: egg_info
+egg_info: ipasetup.py
+	$(PYTHON) setup.py egg_info $(EXTRA_SETUP)
+	for directory in $(PYPKGDIRS); do \
+	pushd $${directory} ; \
+	$(PYTHON) setup.py egg_info $(EXTRA_SETUP); \
+	popd ; \
+	done
+
+version-update: release-update ipapython/version.py ipasetup.py egg_info
 	sed -e s/__VERSION__/$(IPA_VERSION)/ -e s/__RELEASE__/$(IPA_RPM_RELEASE)/ \
 		freeipa.spec.in > freeipa.spec
 	sed -e s/__VERSION__/$

[Freeipa-devel] [freeipa PR#132][synchronized] Draft for a new setup.py (WIP)

2016-10-19 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/132
Author: tiran
 Title: #132: Draft for a new setup.py (WIP)
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/132/head:pr132
git checkout pr132
From 4de782d1aa48df9326d4c86c6c64939a1dbe7685 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Tue, 4 Oct 2016 13:23:22 +0200
Subject: [PATCH] Draft for a new setup.py

Signed-off-by: Christian Heimes 
---
 .gitignore  | 11 ++
 MANIFEST.in |  2 -
 Makefile| 45 ++-
 ipaclient/setup.cfg |  5 +++
 ipaclient/setup.py  | 44 ++
 ipaclient/setup.py.in   | 80 
 ipalib/Makefile |  2 +-
 ipalib/setup.cfg|  5 +++
 ipalib/setup.py | 38 +++
 ipalib/setup.py.in  | 71 
 ipaplatform/setup.cfg   |  5 +++
 ipaplatform/setup.py| 42 +
 ipaplatform/setup.py.in | 79 
 ipapython/MANIFEST.in   |  2 -
 ipapython/Makefile  |  2 +-
 ipapython/setup.cfg |  5 +++
 ipapython/setup.py  | 44 ++
 ipapython/setup.py.in   | 79 
 ipasetup.py.in  | 71 
 ipatests/setup.cfg  |  5 +++
 ipatests/setup.py   | 60 ++
 ipatests/setup.py.in| 97 -
 setup.cfg   |  5 +++
 setup.py|  8 ++--
 24 files changed, 366 insertions(+), 441 deletions(-)
 delete mode 100644 MANIFEST.in
 create mode 100644 ipaclient/setup.cfg
 create mode 100644 ipaclient/setup.py
 delete mode 100644 ipaclient/setup.py.in
 create mode 100644 ipalib/setup.cfg
 create mode 100644 ipalib/setup.py
 delete mode 100644 ipalib/setup.py.in
 create mode 100644 ipaplatform/setup.cfg
 create mode 100644 ipaplatform/setup.py
 delete mode 100644 ipaplatform/setup.py.in
 delete mode 100644 ipapython/MANIFEST.in
 create mode 100644 ipapython/setup.cfg
 create mode 100755 ipapython/setup.py
 delete mode 100755 ipapython/setup.py.in
 create mode 100644 ipasetup.py.in
 create mode 100644 ipatests/setup.cfg
 create mode 100644 ipatests/setup.py
 delete mode 100644 ipatests/setup.py.in
 create mode 100644 setup.cfg

diff --git a/.gitignore b/.gitignore
index 61054de..37b8004 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,8 +39,12 @@ freeipa2-dev-doc
 /freeipa.spec
 !/Makefile
 /dist/
+/*/dist/
 /RELEASE
 /rpmbuild/
+# Build
+/ipasetup.py
+*.egg-info
 
 # Subdirectories
 /daemons/ipa-otpd/ipa-otpd
@@ -64,19 +68,12 @@ freeipa2-dev-doc
 /client/ipa-join
 /client/ipa-rmkeytab
 
-/ipatests/setup.py
-
-/ipaclient/setup.py
-
-/ipalib/setup.py
 !/ipalib/Makefile
 
-/ipapython/setup.py
 /ipapython/version.py
 !/ipapython/Makefile
 
 /ipaplatform/__init__.py
-/ipaplatform/setup.py
 /ipaplatform/tasks.py
 /ipaplatform/services.py
 /ipaplatform/paths.py
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index dd76e10..000
--- a/MANIFEST.in
+++ /dev/null
@@ -1,2 +0,0 @@
-include COPYING TODO lite-server.py
-include tests/*/*.py
diff --git a/Makefile b/Makefile
index 6324308..4e6844b 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ include VERSION
 SUBDIRS=asn1 daemons install ipapython ipalib
 CLIENTDIRS=ipapython ipalib client asn1
 CLIENTPYDIRS=ipaclient ipaplatform
+PYPKGDIRS=$(CLIENTPYDIRS) ipalib ipapython ipatests
 
 PRJ_PREFIX=freeipa
 
@@ -74,6 +75,10 @@ all: bootstrap-autogen server tests
 		(cd $$subdir && $(MAKE) $@) || exit 1; \
 	done
 
+# empty target to force executation
+.PHONY=FORCE
+FORCE:
+
 client: client-autogen
 	@for subdir in $(CLIENTDIRS); do \
 		(cd $$subdir && $(MAKE) all) || exit 1; \
@@ -161,31 +166,34 @@ test:
 release-update:
 	if [ ! -e RELEASE ]; then echo 0 > RELEASE; fi
 
-version-update: release-update
+ipapython/version.py: ipapython/version.py.in FORCE
+	sed -e s/__VERSION__/$(IPA_VERSION)/ $< > $@
+	sed -i -e "s:__NUM_VERSION__:$(IPA_NUM_VERSION):" $@
+	sed -i -e "s:__VENDOR_VERSION__:$(IPA_VENDOR_VERSION):" $@
+	sed -i -e "s:__API_VERSION__:$(IPA_API_VERSION_MAJOR).$(IPA_API_VERSION_MINOR):" $@
+	grep -Po '(?<=default: ).*' API.txt | sed -n -i -e "/__DEFAULT_PLUGINS__/!{p;b};r /dev/stdin" $@
+	touch -r $< $@
+
+ipasetup.py: ipasetup.py.in ipapython/version.py FORCE
+	sed -e s/__VERSION__/$(IPA_VERSION)/ $< > $@
+
+.PHONY: egg_info
+egg_info: ipasetup.py
+	$(PYTHON) setup.py egg_info $(EXTRA_SETUP)
+	for directory in $(PYPKGDIRS); do \
+	pushd $${directory} ; \
+	$(PYTHON) setup.py egg_info $(EXTRA_SETUP); \
+	popd ; \
+	done
+
+version-update: release-update ipapython/version.py ipasetup.py egg_info
 	sed -e s/__VERSION__/$(IPA_VERSION)/ -e s/__RELEASE__/$(IPA_RPM_RELEASE)/ \
 		freeipa.spec.in > freeipa.spec
 	sed -e s/__VERSION__/$(IPA_VERSION)/ version.m4.in

[Freeipa-devel] [freeipa PR#132][synchronized] Draft for a new setup.py (WIP)

2016-10-17 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/132
Author: tiran
 Title: #132: Draft for a new setup.py (WIP)
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/132/head:pr132
git checkout pr132
From c23f7ac7bb3b84aa43613741903d99f07d839903 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Tue, 4 Oct 2016 13:23:22 +0200
Subject: [PATCH] Draft for a new setup.py

Signed-off-by: Christian Heimes 
---
 .gitignore  | 10 ++---
 MANIFEST.in |  3 +-
 Makefile| 43 +-
 ipaclient/setup.py  | 38 +++
 ipaclient/setup.py.in   | 80 
 ipalib/Makefile |  2 +-
 ipalib/setup.py | 32 
 ipalib/setup.py.in  | 71 
 ipaplatform/setup.py| 36 ++
 ipaplatform/setup.py.in | 79 
 ipapython/Makefile  |  2 +-
 ipapython/setup.py  | 35 ++
 ipapython/setup.py.in   | 79 
 ipasetup.py.in  | 71 
 ipatests/setup.py   | 54 +++
 ipatests/setup.py.in| 97 -
 setup.py|  8 ++--
 17 files changed, 301 insertions(+), 439 deletions(-)
 create mode 100644 ipaclient/setup.py
 delete mode 100644 ipaclient/setup.py.in
 create mode 100644 ipalib/setup.py
 delete mode 100644 ipalib/setup.py.in
 create mode 100644 ipaplatform/setup.py
 delete mode 100644 ipaplatform/setup.py.in
 create mode 100755 ipapython/setup.py
 delete mode 100755 ipapython/setup.py.in
 create mode 100644 ipasetup.py.in
 create mode 100644 ipatests/setup.py
 delete mode 100644 ipatests/setup.py.in

diff --git a/.gitignore b/.gitignore
index 61054de..0e63640 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,6 +41,9 @@ freeipa2-dev-doc
 /dist/
 /RELEASE
 /rpmbuild/
+# Build
+ipasetup.py
+*.egg-info
 
 # Subdirectories
 /daemons/ipa-otpd/ipa-otpd
@@ -64,19 +67,12 @@ freeipa2-dev-doc
 /client/ipa-join
 /client/ipa-rmkeytab
 
-/ipatests/setup.py
-
-/ipaclient/setup.py
-
-/ipalib/setup.py
 !/ipalib/Makefile
 
-/ipapython/setup.py
 /ipapython/version.py
 !/ipapython/Makefile
 
 /ipaplatform/__init__.py
-/ipaplatform/setup.py
 /ipaplatform/tasks.py
 /ipaplatform/services.py
 /ipaplatform/paths.py
diff --git a/MANIFEST.in b/MANIFEST.in
index dd76e10..f34cc7e 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,2 +1 @@
-include COPYING TODO lite-server.py
-include tests/*/*.py
+include COPYING lite-server.py
diff --git a/Makefile b/Makefile
index 6324308..33f49b2 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ include VERSION
 SUBDIRS=asn1 daemons install ipapython ipalib
 CLIENTDIRS=ipapython ipalib client asn1
 CLIENTPYDIRS=ipaclient ipaplatform
+PYPKGDIRS=$(CLIENTPYDIRS) ipalib ipapython ipatests
 
 PRJ_PREFIX=freeipa
 
@@ -74,6 +75,10 @@ all: bootstrap-autogen server tests
 		(cd $$subdir && $(MAKE) $@) || exit 1; \
 	done
 
+# empty target to force executation
+.PHONY=FORCE
+FORCE:
+
 client: client-autogen
 	@for subdir in $(CLIENTDIRS); do \
 		(cd $$subdir && $(MAKE) all) || exit 1; \
@@ -161,31 +166,32 @@ test:
 release-update:
 	if [ ! -e RELEASE ]; then echo 0 > RELEASE; fi
 
-version-update: release-update
+ipapython/version.py: ipapython/version.py.in FORCE
+	sed -e s/__VERSION__/$(IPA_VERSION)/ $< > $@
+	sed -i -e "s:__NUM_VERSION__:$(IPA_NUM_VERSION):" $@
+	sed -i -e "s:__VENDOR_VERSION__:$(IPA_VENDOR_VERSION):" $@
+	sed -i -e "s:__API_VERSION__:$(IPA_API_VERSION_MAJOR).$(IPA_API_VERSION_MINOR):" $@
+	grep -Po '(?<=default: ).*' API.txt | sed -n -i -e "/__DEFAULT_PLUGINS__/!{p;b};r /dev/stdin" $@
+	touch -r $< $@
+
+ipasetup.py: ipasetup.py.in ipapython/version.py FORCE
+	sed -e s/__VERSION__/$(IPA_VERSION)/ $< > $@
+	$(PYTHON) setup.py egg_info
+	for directory in $(PYPKGDIRS); do \
+	cp $@ $${directory} ; \
+	pushd $${directory} ; \
+	$(PYTHON) setup.py egg_info ; \
+	popd ; \
+	done
+
+version-update: release-update ipapython/version.py ipasetup.py
 	sed -e s/__VERSION__/$(IPA_VERSION)/ -e s/__RELEASE__/$(IPA_RPM_RELEASE)/ \
 		freeipa.spec.in > freeipa.spec
 	sed -e s/__VERSION__/$(IPA_VERSION)/ version.m4.in \
 		> version.m4
-	sed -e s/__VERSION__/$(IPA_VERSION)/ ipapython/setup.py.in \
-		> ipapython/setup.py
-	sed -e s/__VERSION__/$(IPA_VERSION)/ ipaplatform/setup.py.in \
-		> ipaplatform/setup.py
-	sed -e s/__VERSION__/$(IPA_VERSION)/ ipalib/setup.py.in \
-		> ipalib/setup.py
-	sed -e s/__VERSION__/$(IPA_VERSION)/ ipapython/version.py.in \
-		> ipapython/version.py
-	sed -e s/__VERSION__/$(IPA_VERSION)/ ipatests/setup.py.in \
-		> ipatests/setup.py
-	sed -e s/__VERSION__/$(IPA_VERSION)/ ipaclient/setup.py.in \
-		> ipaclient/setup.py
 	sed -e s/__NUM_VERSION__/$(IPA_NUM_VERSION)/ install/ui/src/libs/loader.js.in \
 		> i

[Freeipa-devel] [freeipa PR#132][synchronized] Draft for a new setup.py (WIP)

2016-10-06 Thread tiran
   URL: https://github.com/freeipa/freeipa/pull/132
Author: tiran
 Title: #132: Draft for a new setup.py (WIP)
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/132/head:pr132
git checkout pr132
From 0e2692dc1b26d57f9bd6809c9c2c44282d8d5f28 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Tue, 4 Oct 2016 13:23:22 +0200
Subject: [PATCH] Draft for a new setup.py

Signed-off-by: Christian Heimes 
---
 .gitignore  |  10 +--
 MANIFEST.in |   3 +-
 Makefile|  25 +++---
 client/man/Makefile.am  |   3 +-
 client/man/ipa.1| 204 
 ipa.1   | 204 
 ipaclient/setup.py  |  38 +
 ipaclient/setup.py.in   |  81 ---
 ipalib/Makefile |   2 +-
 ipalib/setup.py |  32 
 ipalib/setup.py.in  |  71 -
 ipaplatform/setup.py|  36 +
 ipaplatform/setup.py.in |  79 ---
 ipapython/Makefile  |   2 +-
 ipapython/setup.py  |  35 +
 ipapython/setup.py.in   |  79 ---
 ipasetup.py.in  |  71 +
 ipatests/setup.py   |  54 +
 ipatests/setup.py.in|  97 ---
 setup.py|  51 +---
 20 files changed, 496 insertions(+), 681 deletions(-)
 create mode 100644 client/man/ipa.1
 delete mode 100644 ipa.1
 create mode 100644 ipaclient/setup.py
 delete mode 100644 ipaclient/setup.py.in
 create mode 100644 ipalib/setup.py
 delete mode 100644 ipalib/setup.py.in
 create mode 100644 ipaplatform/setup.py
 delete mode 100644 ipaplatform/setup.py.in
 create mode 100755 ipapython/setup.py
 delete mode 100755 ipapython/setup.py.in
 create mode 100644 ipasetup.py.in
 create mode 100644 ipatests/setup.py
 delete mode 100644 ipatests/setup.py.in

diff --git a/.gitignore b/.gitignore
index 61054de..0e63640 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,6 +41,9 @@ freeipa2-dev-doc
 /dist/
 /RELEASE
 /rpmbuild/
+# Build
+ipasetup.py
+*.egg-info
 
 # Subdirectories
 /daemons/ipa-otpd/ipa-otpd
@@ -64,19 +67,12 @@ freeipa2-dev-doc
 /client/ipa-join
 /client/ipa-rmkeytab
 
-/ipatests/setup.py
-
-/ipaclient/setup.py
-
-/ipalib/setup.py
 !/ipalib/Makefile
 
-/ipapython/setup.py
 /ipapython/version.py
 !/ipapython/Makefile
 
 /ipaplatform/__init__.py
-/ipaplatform/setup.py
 /ipaplatform/tasks.py
 /ipaplatform/services.py
 /ipaplatform/paths.py
diff --git a/MANIFEST.in b/MANIFEST.in
index dd76e10..f34cc7e 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,2 +1 @@
-include COPYING TODO lite-server.py
-include tests/*/*.py
+include COPYING lite-server.py
diff --git a/Makefile b/Makefile
index 6324308..794226c 100644
--- a/Makefile
+++ b/Makefile
@@ -161,23 +161,25 @@ test:
 release-update:
 	if [ ! -e RELEASE ]; then echo 0 > RELEASE; fi
 
-version-update: release-update
+.PHONY: ipasetup
+ipasetup:
+	sed -e s/__VERSION__/$(IPA_VERSION)/ ipasetup.py.in \
+		> ipasetup.py
+	$(PYTHON) setup.py egg_info
+	for directory in ipaclient ipalib ipaplatform ipapython ipatests; do \
+	pushd $${directory} ; \
+	cp ../ipasetup.py . ; \
+	$(PYTHON) setup.py egg_info ; \
+	popd ; \
+	done
+
+version-update: release-update ipasetup
 	sed -e s/__VERSION__/$(IPA_VERSION)/ -e s/__RELEASE__/$(IPA_RPM_RELEASE)/ \
 		freeipa.spec.in > freeipa.spec
 	sed -e s/__VERSION__/$(IPA_VERSION)/ version.m4.in \
 		> version.m4
-	sed -e s/__VERSION__/$(IPA_VERSION)/ ipapython/setup.py.in \
-		> ipapython/setup.py
-	sed -e s/__VERSION__/$(IPA_VERSION)/ ipaplatform/setup.py.in \
-		> ipaplatform/setup.py
-	sed -e s/__VERSION__/$(IPA_VERSION)/ ipalib/setup.py.in \
-		> ipalib/setup.py
 	sed -e s/__VERSION__/$(IPA_VERSION)/ ipapython/version.py.in \
 		> ipapython/version.py
-	sed -e s/__VERSION__/$(IPA_VERSION)/ ipatests/setup.py.in \
-		> ipatests/setup.py
-	sed -e s/__VERSION__/$(IPA_VERSION)/ ipaclient/setup.py.in \
-		> ipaclient/setup.py
 	sed -e s/__NUM_VERSION__/$(IPA_NUM_VERSION)/ install/ui/src/libs/loader.js.in \
 		> install/ui/src/libs/loader.js
 	sed -i -e "s:__API_VERSION__:$(IPA_API_VERSION_MAJOR).$(IPA_API_VERSION_MINOR):" install/ui/src/libs/loader.js
@@ -301,6 +303,7 @@ clean: version-update
 	@for subdir in $(SUBDIRS); do \
 		(cd $$subdir && $(MAKE) $@) || exit 1; \
 	done
+	find . -name 'ipasetup.py' -or -name 'ipasetup.py[co]' | xargs rm -f
 	rm -f *~
 
 distclean: version-update
diff --git a/client/man/Makefile.am b/client/man/Makefile.am
index 9d8a9c0..1f067ab 100644
--- a/client/man/Makefile.am
+++ b/client/man/Makefile.am
@@ -10,7 +10,8 @@ man1_MANS = \
 		ipa-client-install.1	\
 		ipa-client-automount.1	\
 		ipa-certupdate.1	\
-		ipa-join.1
+		ipa-join.1		\
+		ipa.1
 
 man5_MANS =\
 		default.conf.5
diff --git a/client/man/ipa.1 b/client/man/ipa.1
new file mode 100644
index 000..9194ca0
--- /dev/null
+++ b