[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Freeipa-devel] [PATCH] distutils for ipa-python (revised)



On Fri, 2007-10-12 at 16:37 -0400, William Jon McCann wrote:
> Hi,
> 
> Here is an updated version of the patch to add distutils support to ipa-python.
> 
> Fixes a problem with the installation directory for ipa.conf and
> updates the .spec files.
> 

Acked and pushed. For me this broke make local-dist (and dist). The
attached patch fixes that by going back to a spec file that is closer to
a standard fedora spec. Also fixed the ipa-python/Makefile to use
setup.py.

Karl
[?1034h# HG changeset patch
# User "Karl MacMillan <kmacmill redhat com>"
# Date 1192565126 14400
# Node ID f3a1245b30aa6cce8329be713217212923904b6a
# Parent  ad51bf7b1337ef3afac509c73ff8fa8157811dee
Fixups / style changes for switch to setup.py.

diff -r ad51bf7b1337 -r f3a1245b30aa ipa-python/Makefile
--- a/ipa-python/Makefile	Tue Oct 16 15:16:04 2007 -0400
+++ b/ipa-python/Makefile	Tue Oct 16 16:05:26 2007 -0400
@@ -6,11 +6,10 @@ all: ;
 all: ;
 
 install:
-	-mkdir -p $(PACKAGEDIR)
-	install -m 644 *.py $(PACKAGEDIR)
-	-mkdir -p $(CONFIGDIR)
-	if ! [ -e $(CONFIGDIR)/ipa.conf ]; then \
-		install -m 644 ipa.conf $(CONFIGDIR); \
+	if [ "$(DESTDIR)" = "" ]; then \
+		python setup.py install; \
+	else \
+		python setup.py install --root $(DESTDIR); \
 	fi
 
 clean:
diff -r ad51bf7b1337 -r f3a1245b30aa ipa-python/freeipa-python.spec
--- a/ipa-python/freeipa-python.spec	Tue Oct 16 15:16:04 2007 -0400
+++ b/ipa-python/freeipa-python.spec	Tue Oct 16 16:05:26 2007 -0400
@@ -9,12 +9,16 @@ Group:          System Environment/Base
 Group:          System Environment/Base
 License:        GPL
 URL:            http://www.freeipa.org
-Source0:        http://www.freeipa.org/downloads/%{name}-%{version}.tar.gz
+Source0:        http://www.freeipa.org/downloads/%{name}-%{version}.tgz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch: 	noarch
 BuildRequires: python >= 0:%{pyver}, python < 0:%{pynext}
 Requires: python >= 0:%{pyver}, python < 0:%{pynext}
 Requires: PyKerberos
+
+%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+
+%define pkgpythondir  %{python_sitelib}/ipa
 
 %description
 FreeIPA is a server for identity, policy, and audit.
@@ -22,22 +26,18 @@ FreeIPA is a server for identity, policy
 %prep
 %setup -q
 
-%build
-%{__python} setup.py build
-
 %install
 rm -rf %{buildroot}
-%{__python} setup.py install -O1 --root=%{buildroot} --record=INSTALLED_FILES
-sed 's|^\(.*\.pyo\)$|%ghost \1|' < INSTALLED_FILES > %{name}-%{version}.files
-find $RPM_BUILD_ROOT%{_libdir}/python%{pyver}/site-packages/* -type d \
-  | sed "s|^$RPM_BUILD_ROOT|%dir |" >> %{name}-%{version}.files
+%{__python} setup.py install --no-compile --root=%{buildroot}
 
 %clean
 rm -rf %{buildroot}
 
-%files -f %{name}-%{version}.files
+%files
 %defattr(-,root,root,-)
-%config(noreplace) %{_sysconfdir}/ipa.conf
+%dir %{pkgpythondir}
+%{pkgpythondir}/*
+%config(noreplace) %{_sysconfdir}/ipa/ipa.conf
 
 
 %changelog
diff -r ad51bf7b1337 -r f3a1245b30aa ipa-python/freeipa-python.spec.in
--- a/ipa-python/freeipa-python.spec.in	Tue Oct 16 15:16:04 2007 -0400
+++ b/ipa-python/freeipa-python.spec.in	Tue Oct 16 16:05:26 2007 -0400
@@ -3,18 +3,22 @@
 
 Name:           freeipa-python
 Version:        VERSION
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        FreeIPA authentication server
 
 Group:          System Environment/Base
 License:        GPL
 URL:            http://www.freeipa.org
-Source0:        http://www.freeipa.org/downloads/%{name}-%{version}.tar.gz
+Source0:        http://www.freeipa.org/downloads/%{name}-%{version}.tgz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch: 	noarch
 BuildRequires: python >= 0:%{pyver}, python < 0:%{pynext}
 Requires: python >= 0:%{pyver}, python < 0:%{pynext}
 Requires: PyKerberos
+
+%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+
+%define pkgpythondir  %{python_sitelib}/ipa
 
 %description
 FreeIPA is a server for identity, policy, and audit.
@@ -22,25 +26,24 @@ FreeIPA is a server for identity, policy
 %prep
 %setup -q
 
-%build
-%{__python} setup.py build
-
 %install
 rm -rf %{buildroot}
-%{__python} setup.py install -O1 --root=%{buildroot} --record=INSTALLED_FILES
-sed 's|^\(.*\.pyo\)$|%ghost \1|' < INSTALLED_FILES > %{name}-%{version}.files
-find $RPM_BUILD_ROOT%{_libdir}/python%{pyver}/site-packages/* -type d \
-  | sed "s|^$RPM_BUILD_ROOT|%dir |" >> %{name}-%{version}.files
+%{__python} setup.py install --no-compile --root=%{buildroot}
 
 %clean
 rm -rf %{buildroot}
 
-%files -f %{name}-%{version}.files
+%files
 %defattr(-,root,root,-)
-%config(noreplace) %{_sysconfdir}/ipa.conf
+%dir %{pkgpythondir}
+%{pkgpythondir}/*
+%config(noreplace) %{_sysconfdir}/ipa/ipa.conf
 
 
 %changelog
+* Tue Oct 16 2007 Karl MacMillan <kmacmill redhat com> - 0.4.0-2
+- Fix up switch to setup.py
+
 * Fri Aug 17 2007 Karl MacMillan <kmacmill redhat com> = 0.2.0-4
 - Added PyKerberos dep.
 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]