URL: https://github.com/freeipa/freeipa/pull/472 Author: tiran Title: #472: Packaging: Add placeholder packages Action: synchronized
To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/472/head:pr472 git checkout pr472
From 1d3e58c133fc00c6bd07c1018c9ab0e1ca4e0889 Mon Sep 17 00:00:00 2001 From: Christian Heimes <chei...@redhat.com> Date: Thu, 16 Feb 2017 15:27:49 +0100 Subject: [PATCH 1/4] Packaging: Add placeholder packages The ipa and freeipa packages are placeholders to prevent PyPI squashing attacks and reserve the names for future use. `pip install ipa` installs ipaclient. Signed-off-by: Christian Heimes <chei...@redhat.com> --- Makefile.am | 4 +++- Makefile.python.am | 21 +++++++++++++-------- configure.ac | 3 +++ packaging/Makefile.am | 10 ++++++++++ packaging/freeipa/Makefile.am | 3 +++ packaging/freeipa/README.txt | 2 ++ packaging/freeipa/setup.cfg | 6 ++++++ packaging/freeipa/setup.py | 23 +++++++++++++++++++++++ packaging/ipa/Makefile.am | 3 +++ packaging/ipa/README.txt | 2 ++ packaging/ipa/setup.cfg | 6 ++++++ packaging/ipa/setup.py | 23 +++++++++++++++++++++++ 12 files changed, 97 insertions(+), 9 deletions(-) create mode 100644 packaging/Makefile.am create mode 100644 packaging/freeipa/Makefile.am create mode 100644 packaging/freeipa/README.txt create mode 100644 packaging/freeipa/setup.cfg create mode 100755 packaging/freeipa/setup.py create mode 100644 packaging/ipa/Makefile.am create mode 100644 packaging/ipa/README.txt create mode 100644 packaging/ipa/setup.cfg create mode 100755 packaging/ipa/setup.py diff --git a/Makefile.am b/Makefile.am index 30ad9bb..a6faa11 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ ACLOCAL_AMFLAGS = -I m4 IPACLIENT_SUBDIRS = ipaclient ipalib ipapython -SUBDIRS = asn1 util client contrib daemons init install $(IPACLIENT_SUBDIRS) ipaplatform ipaserver ipatests po +SUBDIRS = asn1 util client contrib daemons init install $(IPACLIENT_SUBDIRS) ipaplatform ipaserver ipatests packaging po MOSTLYCLEANFILES = ipasetup.pyc ipasetup.pyo \ ignore_import_errors.pyc ignore_import_errors.pyo \ @@ -206,6 +206,8 @@ $(WHEELBUNDLEDIR): mkdir -p $(WHEELBUNDLEDIR) bdist_wheel: $(WHEELDISTDIR) + $(MAKE) $(AM_MAKEFLAGS) -C packaging/ipa bdist_wheel || exit 1; + $(MAKE) $(AM_MAKEFLAGS) -C packaging/freeipa bdist_wheel || exit 1; for dir in $(IPACLIENT_SUBDIRS); do \ $(MAKE) $(AM_MAKEFLAGS) -C $${dir} $@ || exit 1; \ done diff --git a/Makefile.python.am b/Makefile.python.am index 665893f..9c34fe3 100644 --- a/Makefile.python.am +++ b/Makefile.python.am @@ -1,5 +1,6 @@ pkgname = $(shell basename "$(abs_srcdir)") pkgpythondir = $(pythondir)/$(pkgname) +pkginstall = true if VERBOSE_MAKE VERBOSITY="--verbose" @@ -19,16 +20,20 @@ all-local: $(top_builddir)/ipasetup.py --build-base "$(abs_builddir)/build" install-exec-local: $(top_builddir)/ipasetup.py - $(PYTHON) $(srcdir)/setup.py \ - $(VERBOSITY) \ - install \ - --prefix "$(DESTDIR)$(prefix)" \ - --single-version-externally-managed \ - --record "$(DESTDIR)$(pkgpythondir)/install_files.txt" \ - --optimize 1 + if [ "x$(pkginstall)" = "xtrue" ]; then \ + $(PYTHON) $(srcdir)/setup.py \ + $(VERBOSITY) \ + install \ + --prefix "$(DESTDIR)$(prefix)" \ + --single-version-externally-managed \ + --record "$(DESTDIR)$(pkgpythondir)/install_files.txt" \ + --optimize 1; \ + fi uninstall-local: - cat "$(DESTDIR)$(pkgpythondir)/install_files.txt" | xargs rm -rf + if [ -f "$(DESTDIR)$(pkgpythondir)/install_files.txt" ]; then \ + cat "$(DESTDIR)$(pkgpythondir)/install_files.txt" | xargs rm -rf ; \ + fi rm -rf "$(DESTDIR)$(pkgpythondir)" clean-local: $(top_builddir)/ipasetup.py diff --git a/configure.ac b/configure.ac index 44dc11b..f48ba14 100644 --- a/configure.ac +++ b/configure.ac @@ -577,6 +577,9 @@ AC_CONFIG_FILES([ ipaserver/Makefile ipatests/Makefile ipatests/man/Makefile + packaging/Makefile + packaging/freeipa/Makefile + packaging/ipa/Makefile po/Makefile.in po/Makefile.hack util/Makefile diff --git a/packaging/Makefile.am b/packaging/Makefile.am new file mode 100644 index 0000000..5725ed9 --- /dev/null +++ b/packaging/Makefile.am @@ -0,0 +1,10 @@ +# This file will be processed with automake-1.7 to create Makefile.in +# +AUTOMAKE_OPTIONS = 1.7 subdir-objects + +NULL = + +SUBDIRS = \ + freeipa \ + ipa \ + $(NULL) diff --git a/packaging/freeipa/Makefile.am b/packaging/freeipa/Makefile.am new file mode 100644 index 0000000..15d86ce --- /dev/null +++ b/packaging/freeipa/Makefile.am @@ -0,0 +1,3 @@ +include $(top_srcdir)/Makefile.python.am + +pkginstall = false diff --git a/packaging/freeipa/README.txt b/packaging/freeipa/README.txt new file mode 100644 index 0000000..b58448f --- /dev/null +++ b/packaging/freeipa/README.txt @@ -0,0 +1,2 @@ +This is a dummy package for FreeIPA's ipaclient. + diff --git a/packaging/freeipa/setup.cfg b/packaging/freeipa/setup.cfg new file mode 100644 index 0000000..62f65c7 --- /dev/null +++ b/packaging/freeipa/setup.cfg @@ -0,0 +1,6 @@ +[bdist_wheel] +universal = 1 + +[aliases] +packages = clean --all egg_info bdist_wheel +release = packages register upload diff --git a/packaging/freeipa/setup.py b/packaging/freeipa/setup.py new file mode 100755 index 0000000..230fffd --- /dev/null +++ b/packaging/freeipa/setup.py @@ -0,0 +1,23 @@ +# +# Copyright (C) 2017 FreeIPA Contributors see COPYING for license +# +"""Dummy package for FreeIPA + +Please install ipaclient instead. +""" + +from os.path import abspath, dirname +import sys + +if __name__ == '__main__': + # include ../../ for ipasetup.py + sys.path.append(dirname(dirname(dirname(abspath(__file__))))) + from ipasetup import ipasetup # noqa: E402 + + ipasetup( + name='freeipa', + doc = __doc__, + install_requires=[ + "ipaclient", + ] + ) diff --git a/packaging/ipa/Makefile.am b/packaging/ipa/Makefile.am new file mode 100644 index 0000000..15d86ce --- /dev/null +++ b/packaging/ipa/Makefile.am @@ -0,0 +1,3 @@ +include $(top_srcdir)/Makefile.python.am + +pkginstall = false diff --git a/packaging/ipa/README.txt b/packaging/ipa/README.txt new file mode 100644 index 0000000..b58448f --- /dev/null +++ b/packaging/ipa/README.txt @@ -0,0 +1,2 @@ +This is a dummy package for FreeIPA's ipaclient. + diff --git a/packaging/ipa/setup.cfg b/packaging/ipa/setup.cfg new file mode 100644 index 0000000..62f65c7 --- /dev/null +++ b/packaging/ipa/setup.cfg @@ -0,0 +1,6 @@ +[bdist_wheel] +universal = 1 + +[aliases] +packages = clean --all egg_info bdist_wheel +release = packages register upload diff --git a/packaging/ipa/setup.py b/packaging/ipa/setup.py new file mode 100755 index 0000000..403389b --- /dev/null +++ b/packaging/ipa/setup.py @@ -0,0 +1,23 @@ +# +# Copyright (C) 2017 FreeIPA Contributors see COPYING for license +# +"""Dummy package for FreeIPA + +Please install ipaclient instead. +""" + +from os.path import abspath, dirname +import sys + +if __name__ == '__main__': + # include ../../ for ipasetup.py + sys.path.append(dirname(dirname(dirname(abspath(__file__))))) + from ipasetup import ipasetup # noqa: E402 + + ipasetup( + name='ipa', + doc = __doc__, + install_requires=[ + "ipaclient", + ] + ) From 0b56ace788bd080eca87c189721e8ea57ce2d73a Mon Sep 17 00:00:00 2001 From: Christian Heimes <chei...@redhat.com> Date: Fri, 17 Feb 2017 17:46:20 +0100 Subject: [PATCH 2/4] Add python-wheel as build requirement Signed-off-by: Christian Heimes <chei...@redhat.com> --- freeipa.spec.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/freeipa.spec.in b/freeipa.spec.in index 5c835ca..acc197e 100644 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -124,6 +124,16 @@ BuildRequires: python-libsss_nss_idmap BuildRequires: python-cffi # +# Build dependencies for wheel packaging +# +%if 0%{?fedora} +BuildRequires: python2-wheel +%if 0%{?with_python3} +BuildRequires: python3-wheel +%endif +%endif # Fedora + +# # Build dependencies for lint # %if 0%{?with_lint} From b95d743d4ba1d0c4e7ff8672c85e0bdf1d8f3a05 Mon Sep 17 00:00:00 2001 From: Christian Heimes <chei...@redhat.com> Date: Fri, 17 Feb 2017 17:46:42 +0100 Subject: [PATCH 3/4] Add placeholders for ipaplatform, ipaserver and ipatests I also renamed the base directory to pypi and added a new build target pypi_packages. Signed-off-by: Christian Heimes <chei...@redhat.com> --- Makefile.am | 16 ++++++++++++---- Makefile.python.am | 2 +- configure.ac | 9 ++++++--- packaging/Makefile.am | 10 ---------- packaging/freeipa/Makefile.am | 3 --- packaging/freeipa/README.txt | 2 -- packaging/freeipa/setup.cfg | 6 ------ packaging/freeipa/setup.py | 23 ----------------------- packaging/ipa/Makefile.am | 3 --- packaging/ipa/README.txt | 2 -- packaging/ipa/setup.cfg | 6 ------ packaging/ipa/setup.py | 23 ----------------------- pypi/Makefile.am | 13 +++++++++++++ pypi/freeipa/Makefile.am | 3 +++ pypi/freeipa/README.txt | 2 ++ pypi/freeipa/setup.cfg | 6 ++++++ pypi/freeipa/setup.py | 23 +++++++++++++++++++++++ pypi/ipa/Makefile.am | 3 +++ pypi/ipa/README.txt | 2 ++ pypi/ipa/setup.cfg | 6 ++++++ pypi/ipa/setup.py | 23 +++++++++++++++++++++++ pypi/ipaplatform/Makefile.am | 3 +++ pypi/ipaplatform/README.txt | 2 ++ pypi/ipaplatform/ipaplatform/__init__.py | 5 +++++ pypi/ipaplatform/setup.cfg | 6 ++++++ pypi/ipaplatform/setup.py | 26 ++++++++++++++++++++++++++ pypi/ipaserver/Makefile.am | 3 +++ pypi/ipaserver/README.txt | 2 ++ pypi/ipaserver/ipaserver/__init__.py | 5 +++++ pypi/ipaserver/setup.cfg | 6 ++++++ pypi/ipaserver/setup.py | 26 ++++++++++++++++++++++++++ pypi/ipatests/Makefile.am | 3 +++ pypi/ipatests/README.txt | 2 ++ pypi/ipatests/ipatests/__init__.py | 5 +++++ pypi/ipatests/setup.cfg | 6 ++++++ pypi/ipatests/setup.py | 26 ++++++++++++++++++++++++++ 36 files changed, 226 insertions(+), 86 deletions(-) delete mode 100644 packaging/Makefile.am delete mode 100644 packaging/freeipa/Makefile.am delete mode 100644 packaging/freeipa/README.txt delete mode 100644 packaging/freeipa/setup.cfg delete mode 100755 packaging/freeipa/setup.py delete mode 100644 packaging/ipa/Makefile.am delete mode 100644 packaging/ipa/README.txt delete mode 100644 packaging/ipa/setup.cfg delete mode 100755 packaging/ipa/setup.py create mode 100644 pypi/Makefile.am create mode 100644 pypi/freeipa/Makefile.am create mode 100644 pypi/freeipa/README.txt create mode 100644 pypi/freeipa/setup.cfg create mode 100755 pypi/freeipa/setup.py create mode 100644 pypi/ipa/Makefile.am create mode 100644 pypi/ipa/README.txt create mode 100644 pypi/ipa/setup.cfg create mode 100755 pypi/ipa/setup.py create mode 100644 pypi/ipaplatform/Makefile.am create mode 100644 pypi/ipaplatform/README.txt create mode 100644 pypi/ipaplatform/ipaplatform/__init__.py create mode 100644 pypi/ipaplatform/setup.cfg create mode 100755 pypi/ipaplatform/setup.py create mode 100644 pypi/ipaserver/Makefile.am create mode 100644 pypi/ipaserver/README.txt create mode 100644 pypi/ipaserver/ipaserver/__init__.py create mode 100644 pypi/ipaserver/setup.cfg create mode 100755 pypi/ipaserver/setup.py create mode 100644 pypi/ipatests/Makefile.am create mode 100644 pypi/ipatests/README.txt create mode 100644 pypi/ipatests/ipatests/__init__.py create mode 100644 pypi/ipatests/setup.cfg create mode 100755 pypi/ipatests/setup.py diff --git a/Makefile.am b/Makefile.am index a6faa11..4826b93 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,8 @@ ACLOCAL_AMFLAGS = -I m4 IPACLIENT_SUBDIRS = ipaclient ipalib ipapython -SUBDIRS = asn1 util client contrib daemons init install $(IPACLIENT_SUBDIRS) ipaplatform ipaserver ipatests packaging po +IPA_PLACEHOLDERS = freeipa ipa ipaplatform ipaserver ipatests +SUBDIRS = asn1 util client contrib daemons init install $(IPACLIENT_SUBDIRS) ipaplatform ipaserver ipatests pypi po MOSTLYCLEANFILES = ipasetup.pyc ipasetup.pyo \ ignore_import_errors.pyc ignore_import_errors.pyo \ @@ -195,7 +196,7 @@ jslint-html: cd $(top_srcdir)/install/html; \ jsl -nologo -nosummary -nofilelisting -conf jsl.conf -.PHONY: bdist_wheel wheel_bundle +.PHONY: bdist_wheel wheel_bundle wheel_placeholder pypi_packages WHEELDISTDIR = $(top_builddir)/dist/wheels WHEELBUNDLEDIR = $(top_builddir)/dist/bundle @@ -206,8 +207,6 @@ $(WHEELBUNDLEDIR): mkdir -p $(WHEELBUNDLEDIR) bdist_wheel: $(WHEELDISTDIR) - $(MAKE) $(AM_MAKEFLAGS) -C packaging/ipa bdist_wheel || exit 1; - $(MAKE) $(AM_MAKEFLAGS) -C packaging/freeipa bdist_wheel || exit 1; for dir in $(IPACLIENT_SUBDIRS); do \ $(MAKE) $(AM_MAKEFLAGS) -C $${dir} $@ || exit 1; \ done @@ -215,6 +214,15 @@ bdist_wheel: $(WHEELDISTDIR) wheel_bundle: $(WHEELBUNDLEDIR) bdist_wheel $(PYTHON) -m pip wheel --wheel-dir $(WHEELBUNDLEDIR) $(WHEELDISTDIR)/*.whl +wheel_placeholder: $(WHEELDISTDIR) + for dir in $(IPA_PLACEHOLDERS); do \ + $(MAKE) $(AM_MAKEFLAGS) -C $(top_srcdir)/pypi/$${dir} bdist_wheel || exit 1; \ + done + +pypi_packages: bdist_wheel wheel_placeholder + @echo -e "\n\nTo upload packages to PyPI, run:\n" + @echo -e " twine upload $(WHEELDISTDIR)/*-$(VERSION)-py2.py3-none-any.whl\n" + .PHONY: strip-po: $(MAKE) -C po strip-po diff --git a/Makefile.python.am b/Makefile.python.am index 9c34fe3..e4efc17 100644 --- a/Makefile.python.am +++ b/Makefile.python.am @@ -58,5 +58,5 @@ dist-hook: $(top_builddir)/ipasetup.py WHEELDISTDIR = $(top_builddir)/dist/wheels .PHONY: bdist_wheel bdist_wheel: $(top_builddir)/ipasetup.py - rm -rf $(WHEELDISTDIR)/$(pkgname)*.whl + rm -rf $(WHEELDISTDIR)/$(pkgname)-*.whl $(PYTHON) "$(srcdir)/setup.py" bdist_wheel --dist-dir=$(WHEELDISTDIR) diff --git a/configure.ac b/configure.ac index f48ba14..b633cba 100644 --- a/configure.ac +++ b/configure.ac @@ -577,9 +577,12 @@ AC_CONFIG_FILES([ ipaserver/Makefile ipatests/Makefile ipatests/man/Makefile - packaging/Makefile - packaging/freeipa/Makefile - packaging/ipa/Makefile + pypi/Makefile + pypi/freeipa/Makefile + pypi/ipa/Makefile + pypi/ipaplatform/Makefile + pypi/ipaserver/Makefile + pypi/ipatests/Makefile po/Makefile.in po/Makefile.hack util/Makefile diff --git a/packaging/Makefile.am b/packaging/Makefile.am deleted file mode 100644 index 5725ed9..0000000 --- a/packaging/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -# This file will be processed with automake-1.7 to create Makefile.in -# -AUTOMAKE_OPTIONS = 1.7 subdir-objects - -NULL = - -SUBDIRS = \ - freeipa \ - ipa \ - $(NULL) diff --git a/packaging/freeipa/Makefile.am b/packaging/freeipa/Makefile.am deleted file mode 100644 index 15d86ce..0000000 --- a/packaging/freeipa/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -include $(top_srcdir)/Makefile.python.am - -pkginstall = false diff --git a/packaging/freeipa/README.txt b/packaging/freeipa/README.txt deleted file mode 100644 index b58448f..0000000 --- a/packaging/freeipa/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a dummy package for FreeIPA's ipaclient. - diff --git a/packaging/freeipa/setup.cfg b/packaging/freeipa/setup.cfg deleted file mode 100644 index 62f65c7..0000000 --- a/packaging/freeipa/setup.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[bdist_wheel] -universal = 1 - -[aliases] -packages = clean --all egg_info bdist_wheel -release = packages register upload diff --git a/packaging/freeipa/setup.py b/packaging/freeipa/setup.py deleted file mode 100755 index 230fffd..0000000 --- a/packaging/freeipa/setup.py +++ /dev/null @@ -1,23 +0,0 @@ -# -# Copyright (C) 2017 FreeIPA Contributors see COPYING for license -# -"""Dummy package for FreeIPA - -Please install ipaclient instead. -""" - -from os.path import abspath, dirname -import sys - -if __name__ == '__main__': - # include ../../ for ipasetup.py - sys.path.append(dirname(dirname(dirname(abspath(__file__))))) - from ipasetup import ipasetup # noqa: E402 - - ipasetup( - name='freeipa', - doc = __doc__, - install_requires=[ - "ipaclient", - ] - ) diff --git a/packaging/ipa/Makefile.am b/packaging/ipa/Makefile.am deleted file mode 100644 index 15d86ce..0000000 --- a/packaging/ipa/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -include $(top_srcdir)/Makefile.python.am - -pkginstall = false diff --git a/packaging/ipa/README.txt b/packaging/ipa/README.txt deleted file mode 100644 index b58448f..0000000 --- a/packaging/ipa/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a dummy package for FreeIPA's ipaclient. - diff --git a/packaging/ipa/setup.cfg b/packaging/ipa/setup.cfg deleted file mode 100644 index 62f65c7..0000000 --- a/packaging/ipa/setup.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[bdist_wheel] -universal = 1 - -[aliases] -packages = clean --all egg_info bdist_wheel -release = packages register upload diff --git a/packaging/ipa/setup.py b/packaging/ipa/setup.py deleted file mode 100755 index 403389b..0000000 --- a/packaging/ipa/setup.py +++ /dev/null @@ -1,23 +0,0 @@ -# -# Copyright (C) 2017 FreeIPA Contributors see COPYING for license -# -"""Dummy package for FreeIPA - -Please install ipaclient instead. -""" - -from os.path import abspath, dirname -import sys - -if __name__ == '__main__': - # include ../../ for ipasetup.py - sys.path.append(dirname(dirname(dirname(abspath(__file__))))) - from ipasetup import ipasetup # noqa: E402 - - ipasetup( - name='ipa', - doc = __doc__, - install_requires=[ - "ipaclient", - ] - ) diff --git a/pypi/Makefile.am b/pypi/Makefile.am new file mode 100644 index 0000000..5d8be9c --- /dev/null +++ b/pypi/Makefile.am @@ -0,0 +1,13 @@ +# This file will be processed with automake-1.7 to create Makefile.in +# +AUTOMAKE_OPTIONS = 1.7 subdir-objects + +NULL = + +SUBDIRS = \ + freeipa \ + ipa \ + ipaplatform \ + ipaserver \ + ipatests \ + $(NULL) diff --git a/pypi/freeipa/Makefile.am b/pypi/freeipa/Makefile.am new file mode 100644 index 0000000..15d86ce --- /dev/null +++ b/pypi/freeipa/Makefile.am @@ -0,0 +1,3 @@ +include $(top_srcdir)/Makefile.python.am + +pkginstall = false diff --git a/pypi/freeipa/README.txt b/pypi/freeipa/README.txt new file mode 100644 index 0000000..b58448f --- /dev/null +++ b/pypi/freeipa/README.txt @@ -0,0 +1,2 @@ +This is a dummy package for FreeIPA's ipaclient. + diff --git a/pypi/freeipa/setup.cfg b/pypi/freeipa/setup.cfg new file mode 100644 index 0000000..62f65c7 --- /dev/null +++ b/pypi/freeipa/setup.cfg @@ -0,0 +1,6 @@ +[bdist_wheel] +universal = 1 + +[aliases] +packages = clean --all egg_info bdist_wheel +release = packages register upload diff --git a/pypi/freeipa/setup.py b/pypi/freeipa/setup.py new file mode 100755 index 0000000..230fffd --- /dev/null +++ b/pypi/freeipa/setup.py @@ -0,0 +1,23 @@ +# +# Copyright (C) 2017 FreeIPA Contributors see COPYING for license +# +"""Dummy package for FreeIPA + +Please install ipaclient instead. +""" + +from os.path import abspath, dirname +import sys + +if __name__ == '__main__': + # include ../../ for ipasetup.py + sys.path.append(dirname(dirname(dirname(abspath(__file__))))) + from ipasetup import ipasetup # noqa: E402 + + ipasetup( + name='freeipa', + doc = __doc__, + install_requires=[ + "ipaclient", + ] + ) diff --git a/pypi/ipa/Makefile.am b/pypi/ipa/Makefile.am new file mode 100644 index 0000000..15d86ce --- /dev/null +++ b/pypi/ipa/Makefile.am @@ -0,0 +1,3 @@ +include $(top_srcdir)/Makefile.python.am + +pkginstall = false diff --git a/pypi/ipa/README.txt b/pypi/ipa/README.txt new file mode 100644 index 0000000..b58448f --- /dev/null +++ b/pypi/ipa/README.txt @@ -0,0 +1,2 @@ +This is a dummy package for FreeIPA's ipaclient. + diff --git a/pypi/ipa/setup.cfg b/pypi/ipa/setup.cfg new file mode 100644 index 0000000..62f65c7 --- /dev/null +++ b/pypi/ipa/setup.cfg @@ -0,0 +1,6 @@ +[bdist_wheel] +universal = 1 + +[aliases] +packages = clean --all egg_info bdist_wheel +release = packages register upload diff --git a/pypi/ipa/setup.py b/pypi/ipa/setup.py new file mode 100755 index 0000000..403389b --- /dev/null +++ b/pypi/ipa/setup.py @@ -0,0 +1,23 @@ +# +# Copyright (C) 2017 FreeIPA Contributors see COPYING for license +# +"""Dummy package for FreeIPA + +Please install ipaclient instead. +""" + +from os.path import abspath, dirname +import sys + +if __name__ == '__main__': + # include ../../ for ipasetup.py + sys.path.append(dirname(dirname(dirname(abspath(__file__))))) + from ipasetup import ipasetup # noqa: E402 + + ipasetup( + name='ipa', + doc = __doc__, + install_requires=[ + "ipaclient", + ] + ) diff --git a/pypi/ipaplatform/Makefile.am b/pypi/ipaplatform/Makefile.am new file mode 100644 index 0000000..15d86ce --- /dev/null +++ b/pypi/ipaplatform/Makefile.am @@ -0,0 +1,3 @@ +include $(top_srcdir)/Makefile.python.am + +pkginstall = false diff --git a/pypi/ipaplatform/README.txt b/pypi/ipaplatform/README.txt new file mode 100644 index 0000000..15064b0 --- /dev/null +++ b/pypi/ipaplatform/README.txt @@ -0,0 +1,2 @@ +This is a dummy package for FreeIPA's ipaplatform. + diff --git a/pypi/ipaplatform/ipaplatform/__init__.py b/pypi/ipaplatform/ipaplatform/__init__.py new file mode 100644 index 0000000..3b12c8c --- /dev/null +++ b/pypi/ipaplatform/ipaplatform/__init__.py @@ -0,0 +1,5 @@ +# +# Copyright (C) 2017 FreeIPA Contributors see COPYING for license +# + +raise ImportError("ipaplatform is not yet supported as PyPI package.") diff --git a/pypi/ipaplatform/setup.cfg b/pypi/ipaplatform/setup.cfg new file mode 100644 index 0000000..62f65c7 --- /dev/null +++ b/pypi/ipaplatform/setup.cfg @@ -0,0 +1,6 @@ +[bdist_wheel] +universal = 1 + +[aliases] +packages = clean --all egg_info bdist_wheel +release = packages register upload diff --git a/pypi/ipaplatform/setup.py b/pypi/ipaplatform/setup.py new file mode 100755 index 0000000..f0fca2c --- /dev/null +++ b/pypi/ipaplatform/setup.py @@ -0,0 +1,26 @@ +# +# Copyright (C) 2017 FreeIPA Contributors see COPYING for license +# +"""Dummy package for FreeIPA + +ipaplatform is not yet available as PyPI package. +""" + +from os.path import abspath, dirname +import sys + +if __name__ == '__main__': + # include ../../ for ipasetup.py + sys.path.append(dirname(dirname(dirname(abspath(__file__))))) + from ipasetup import ipasetup # noqa: E402 + + ipasetup( + name='ipaplatform', + doc = __doc__, + packages=[ + "ipaplatform", + ], + install_requires=[ + "ipaclient", + ] + ) diff --git a/pypi/ipaserver/Makefile.am b/pypi/ipaserver/Makefile.am new file mode 100644 index 0000000..15d86ce --- /dev/null +++ b/pypi/ipaserver/Makefile.am @@ -0,0 +1,3 @@ +include $(top_srcdir)/Makefile.python.am + +pkginstall = false diff --git a/pypi/ipaserver/README.txt b/pypi/ipaserver/README.txt new file mode 100644 index 0000000..dea6ac4 --- /dev/null +++ b/pypi/ipaserver/README.txt @@ -0,0 +1,2 @@ +This is a dummy package for FreeIPA's ipaserver. + diff --git a/pypi/ipaserver/ipaserver/__init__.py b/pypi/ipaserver/ipaserver/__init__.py new file mode 100644 index 0000000..4cbf200 --- /dev/null +++ b/pypi/ipaserver/ipaserver/__init__.py @@ -0,0 +1,5 @@ +# +# Copyright (C) 2017 FreeIPA Contributors see COPYING for license +# + +raise ImportError("ipaserver is not yet supported as PyPI package.") diff --git a/pypi/ipaserver/setup.cfg b/pypi/ipaserver/setup.cfg new file mode 100644 index 0000000..62f65c7 --- /dev/null +++ b/pypi/ipaserver/setup.cfg @@ -0,0 +1,6 @@ +[bdist_wheel] +universal = 1 + +[aliases] +packages = clean --all egg_info bdist_wheel +release = packages register upload diff --git a/pypi/ipaserver/setup.py b/pypi/ipaserver/setup.py new file mode 100755 index 0000000..73e1e63 --- /dev/null +++ b/pypi/ipaserver/setup.py @@ -0,0 +1,26 @@ +# +# Copyright (C) 2017 FreeIPA Contributors see COPYING for license +# +"""Dummy package for FreeIPA + +ipatests is not yet available as PyPI package. +""" + +from os.path import abspath, dirname +import sys + +if __name__ == '__main__': + # include ../../ for ipasetup.py + sys.path.append(dirname(dirname(dirname(abspath(__file__))))) + from ipasetup import ipasetup # noqa: E402 + + ipasetup( + name='ipaserver', + doc = __doc__, + packages=[ + "ipaserver", + ], + install_requires=[ + "ipaclient", + ] + ) diff --git a/pypi/ipatests/Makefile.am b/pypi/ipatests/Makefile.am new file mode 100644 index 0000000..15d86ce --- /dev/null +++ b/pypi/ipatests/Makefile.am @@ -0,0 +1,3 @@ +include $(top_srcdir)/Makefile.python.am + +pkginstall = false diff --git a/pypi/ipatests/README.txt b/pypi/ipatests/README.txt new file mode 100644 index 0000000..3347eac --- /dev/null +++ b/pypi/ipatests/README.txt @@ -0,0 +1,2 @@ +This is a dummy package for FreeIPA's ipatests. + diff --git a/pypi/ipatests/ipatests/__init__.py b/pypi/ipatests/ipatests/__init__.py new file mode 100644 index 0000000..5592c53 --- /dev/null +++ b/pypi/ipatests/ipatests/__init__.py @@ -0,0 +1,5 @@ +# +# Copyright (C) 2017 FreeIPA Contributors see COPYING for license +# + +raise ImportError("ipatests is not yet supported as PyPI package.") diff --git a/pypi/ipatests/setup.cfg b/pypi/ipatests/setup.cfg new file mode 100644 index 0000000..62f65c7 --- /dev/null +++ b/pypi/ipatests/setup.cfg @@ -0,0 +1,6 @@ +[bdist_wheel] +universal = 1 + +[aliases] +packages = clean --all egg_info bdist_wheel +release = packages register upload diff --git a/pypi/ipatests/setup.py b/pypi/ipatests/setup.py new file mode 100755 index 0000000..808e510 --- /dev/null +++ b/pypi/ipatests/setup.py @@ -0,0 +1,26 @@ +# +# Copyright (C) 2017 FreeIPA Contributors see COPYING for license +# +"""Dummy package for FreeIPA + +ipatests is not yet available as PyPI package. +""" + +from os.path import abspath, dirname +import sys + +if __name__ == '__main__': + # include ../../ for ipasetup.py + sys.path.append(dirname(dirname(dirname(abspath(__file__))))) + from ipasetup import ipasetup # noqa: E402 + + ipasetup( + name='ipatests', + doc = __doc__, + packages=[ + "ipatests", + ], + install_requires=[ + "ipaclient", + ] + ) From 8b8a1dce0da1d61f391583ac879a8702896eec26 Mon Sep 17 00:00:00 2001 From: Christian Heimes <chei...@redhat.com> Date: Wed, 22 Feb 2017 09:21:35 +0100 Subject: [PATCH 4/4] Add with_wheels global to install wheel and PyPI packaging dependencies Signed-off-by: Christian Heimes <chei...@redhat.com> --- freeipa.spec.in | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/freeipa.spec.in b/freeipa.spec.in index acc197e..d8602c9 100644 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -17,6 +17,9 @@ %global without_jslint_option --without-jslint %endif +# Python wheel support and PyPI packages +%global with_wheels 0 + %global alt_name ipa %if 0%{?rhel} %global samba_version 4.0.5-1 @@ -124,14 +127,16 @@ BuildRequires: python-libsss_nss_idmap BuildRequires: python-cffi # -# Build dependencies for wheel packaging +# Build dependencies for wheel packaging and PyPI upload # -%if 0%{?fedora} +%if 0%{with_wheels} +BuildRequires: python2-twine BuildRequires: python2-wheel %if 0%{?with_python3} +BuildRequires: python3-twine BuildRequires: python3-wheel %endif -%endif # Fedora +%endif # with_wheels # # Build dependencies for lint
-- Manage your subscription for the Freeipa-devel mailing list: https://www.redhat.com/mailman/listinfo/freeipa-devel Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code