summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2014-06-02 07:50:12 +0200
committerPetr Viktorin <pviktori@redhat.com>2014-06-16 19:48:20 +0200
commit3bb9e1bbd5c8ae42e113b52dc88f9ec75b9b1142 (patch)
treeff5183da90063cb1cb47f249b76312baaec9da23
parenta9a4bc08485130fc1bb2257292b415e70e33bfb1 (diff)
downloadfreeipa-3bb9e1bbd5c8ae42e113b52dc88f9ec75b9b1142.tar.gz
freeipa-3bb9e1bbd5c8ae42e113b52dc88f9ec75b9b1142.tar.xz
freeipa-3bb9e1bbd5c8ae42e113b52dc88f9ec75b9b1142.zip
ipaplatform: Change makefiles to accomodate for new platform package
https://fedorahosted.org/freeipa/ticket/4052 Reviewed-By: Petr Viktorin <pviktori@redhat.com>
-rw-r--r--Makefile10
-rw-r--r--freeipa.spec.in50
-rw-r--r--ipaplatform/setup.py.in78
-rw-r--r--ipapython/Makefile2
-rw-r--r--ipapython/setup.py.in8
5 files changed, 97 insertions, 51 deletions
diff --git a/Makefile b/Makefile
index b8315fe0e..f51a89103 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ PRJ_PREFIX=freeipa
RPMBUILD ?= $(PWD)/rpmbuild
TARGET ?= master
-SUPPORTED_PLATFORM ?= redhat
+SUPPORTED_PLATFORM ?= fedora
IPA_NUM_VERSION ?= $(shell printf %d%02d%02d $(IPA_VERSION_MAJOR) $(IPA_VERSION_MINOR) $(IPA_VERSION_RELEASE))
@@ -128,6 +128,8 @@ version-update: release-update
> 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)/ ipapython/version.py.in \
> ipapython/version.py
sed -e s/__VERSION__/$(IPA_VERSION)/ ipatests/setup.py.in \
@@ -148,12 +150,6 @@ version-update: release-update
sed -e s/__VERSION__/$(IPA_VERSION)/ ipa-client/version.m4.in \
> ipa-client/version.m4
- if [ "$(SUPPORTED_PLATFORM)" != "" ]; then \
- sed -e s/SUPPORTED_PLATFORM/$(SUPPORTED_PLATFORM)/ ipapython/services.py.in \
- > ipapython/services.py; \
- touch -r ipapython/services.py.in ipapython/services.py; \
- fi
-
if [ "$(SKIP_API_VERSION_CHECK)" != "yes" ]; then \
./makeapi --validate; \
./makeaci --validate; \
diff --git a/freeipa.spec.in b/freeipa.spec.in
index b71c99435..b719b4a21 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -348,21 +348,13 @@ export JAVA_STACK_SIZE="8m"
%endif
export CFLAGS="%{optflags} $CFLAGS"
export LDFLAGS="%{__global_ldflags} $LDFLAGS"
-%if 0%{?fedora} >= 19
-export SUPPORTED_PLATFORM=fedora19
-%else
-%if 0%{?fedora} >= 18
-# use fedora18 platform which is based on fedora16 platform with systemd
-# support + fedora18 changes
-export SUPPORTED_PLATFORM=fedora18
-%else
-export SUPPORTED_PLATFORM=fedora16
-%endif
-%endif
# Force re-generate of platform support
export IPA_VENDOR_VERSION_SUFFIX=-%{release}
-rm -f ipapython/services.py ipapython/version.py
+rm -f ipapython/version.py
+rm -f ipaplatform/services.py
+rm -f ipaplatform/tasks.py
+rm -f ipaplatform/paths.py
make version-update
cd ipa-client; ../autogen.sh --prefix=%{_usr} --sysconfdir=%{_sysconfdir} --localstatedir=%{_localstatedir} --libdir=%{_libdir} --mandir=%{_mandir}; cd ..
%if ! %{ONLY_CLIENT}
@@ -378,20 +370,12 @@ make IPA_VERSION_IS_GIT_SNAPSHOT=no %{?_smp_mflags} client
%install
rm -rf %{buildroot}
-%if 0%{?fedora} >= 19
-export SUPPORTED_PLATFORM=fedora19
-%else
-%if 0%{?fedora} >= 18
-# use fedora18 platform which is based on fedora16 platform with systemd
-# support + fedora18 changes
-export SUPPORTED_PLATFORM=fedora18
-%else
-export SUPPORTED_PLATFORM=fedora16
-%endif
-%endif
# Force re-generate of platform support
export IPA_VENDOR_VERSION_SUFFIX=-%{release}
-rm -f ipapython/services.py ipapython/version.py
+rm -f ipapython/version.py
+rm -f ipaplatform/services.py
+rm -f ipaplatform/tasks.py
+rm -f ipaplatform/paths.py
make version-update
%if ! %{ONLY_CLIENT}
make install DESTDIR=%{buildroot}
@@ -844,21 +828,15 @@ fi
%defattr(-,root,root,-)
%doc COPYING README Contributors.txt
%dir %{python_sitelib}/ipapython
-%dir %{python_sitelib}/ipapython/platform
-%dir %{python_sitelib}/ipapython/platform/base
-%dir %{python_sitelib}/ipapython/platform/fedora16
-%dir %{python_sitelib}/ipapython/platform/fedora18
-%dir %{python_sitelib}/ipapython/platform/fedora19
-%dir %{python_sitelib}/ipapython/platform/redhat
%{python_sitelib}/ipapython/*.py*
-%{python_sitelib}/ipapython/platform/*.py*
-%{python_sitelib}/ipapython/platform/base/*.py*
-%{python_sitelib}/ipapython/platform/fedora16/*.py*
-%{python_sitelib}/ipapython/platform/fedora18/*.py*
-%{python_sitelib}/ipapython/platform/fedora19/*.py*
-%{python_sitelib}/ipapython/platform/redhat/*.py*
%dir %{python_sitelib}/ipalib
%{python_sitelib}/ipalib/*
+%dir %{python_sitelib}/ipaplatform
+%dir %{python_sitelib}/ipaplatform/base
+%dir %{python_sitelib}/ipaplatform/fedora
+%{python_sitelib}/ipaplatform/*
+%{python_sitelib}/ipaplatform/base/*.py*
+%{python_sitelib}/ipaplatform/fedora/*.py*
%attr(0644,root,root) %{python_sitearch}/default_encoding_utf8.so
%{python_sitelib}/ipapython-*.egg-info
%{python_sitelib}/freeipa-*.egg-info
diff --git a/ipaplatform/setup.py.in b/ipaplatform/setup.py.in
new file mode 100644
index 000000000..762e84455
--- /dev/null
+++ b/ipaplatform/setup.py.in
@@ -0,0 +1,78 @@
+#!/usr/bin/python2
+# Copyright (C) 2014 Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program 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.
+#
+# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+"""FreeIPA platform
+
+FreeIPA is a server for identity, policy, and audit.
+"""
+
+DOCLINES = __doc__.split("\n")
+
+import os
+import sys
+import distutils.sysconfig
+
+CLASSIFIERS = """\
+Development Status :: 4 - Beta
+Intended Audience :: System Environment/Base
+License :: GPL
+Programming Language :: Python
+Operating System :: POSIX
+Operating System :: Unix
+"""
+
+# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
+# update it when the contents of directories change.
+if os.path.exists('MANIFEST'):
+ os.remove('MANIFEST')
+
+def setup_package():
+
+ from distutils.core import setup
+
+ old_path = os.getcwd()
+ local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
+ os.chdir(local_path)
+ sys.path.insert(0, local_path)
+
+ try:
+ setup(
+ name = "ipaplatform",
+ version = "__VERSION__",
+ license = "GPL",
+ author = "FreeIPA Developers",
+ author_email = "freeipa-devel@redhat.com",
+ maintainer = "FreeIPA Developers",
+ maintainer_email = "freeipa-devel@redhat.com",
+ url = "http://www.freeipa.org/",
+ description = DOCLINES[0],
+ long_description = "\n".join(DOCLINES[2:]),
+ download_url = "http://www.freeipa.org/page/Downloads",
+ classifiers=filter(None, CLASSIFIERS.split('\n')),
+ package_dir = {'ipaplatform': ''},
+ packages = ["ipaplatform",
+ "ipaplatform.base",
+ "ipaplatform.fedora"],
+ )
+ finally:
+ del sys.path[0]
+ os.chdir(old_path)
+ return
+
+if __name__ == '__main__':
+ setup_package()
diff --git a/ipapython/Makefile b/ipapython/Makefile
index d1a3ff54b..e09956ad3 100644
--- a/ipapython/Makefile
+++ b/ipapython/Makefile
@@ -27,7 +27,7 @@ clean:
done
distclean: clean
- rm -f setup.py ipa-python.spec version.py services.py
+ rm -f setup.py ipa-python.spec version.py
@for subdir in $(SUBDIRS); do \
(cd $$subdir && $(MAKE) $@) || exit 1; \
done
diff --git a/ipapython/setup.py.in b/ipapython/setup.py.in
index 3acc8b8fe..a839f094a 100644
--- a/ipapython/setup.py.in
+++ b/ipapython/setup.py.in
@@ -65,13 +65,7 @@ def setup_package():
classifiers=filter(None, CLASSIFIERS.split('\n')),
platforms = ["Linux", "Solaris", "Unix"],
package_dir = {'ipapython': ''},
- packages = [ "ipapython",
- "ipapython.platform",
- "ipapython.platform.base",
- "ipapython.platform.fedora16",
- "ipapython.platform.fedora18",
- "ipapython.platform.fedora19",
- "ipapython.platform.redhat" ],
+ packages = [ "ipapython" ],
)
finally:
del sys.path[0]