From 516df5f64fa12b33282848e3598031abcd6b0312 Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Thu, 19 Apr 2012 13:42:44 -0400 Subject: [PATCH] Move packaging related things out of the root directory: Distutils MANIFEST.in, setup.py -> packaging/distutils/ directory. --- Makefile | 11 ++++++++--- MANIFEST.in => packaging/distutils/MANIFEST.in | 1 + setup.py => packaging/distutils/setup.py | 0 packaging/rpm/ansible.spec | 6 ++++-- 4 files changed, 13 insertions(+), 5 deletions(-) rename MANIFEST.in => packaging/distutils/MANIFEST.in (78%) rename setup.py => packaging/distutils/setup.py (100%) diff --git a/Makefile b/Makefile index b6aa3bba8a0..dae28e5b9b9 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,11 @@ RPMVERSION := $(shell awk '/Version/{print $$2; exit}' < $(RPMSPEC) | cut -d "%" RPMRELEASE := $(shell awk '/Release/{print $$2; exit}' < $(RPMSPEC) | cut -d "%" -f1) RPMDIST = $(shell rpm --eval '%dist') RPMNVR = "$(NAME)-$(RPMVERSION)-$(RPMRELEASE)$(RPMDIST)" +# Python distutils options +DUDIR = packaging/distutils +DUSETUP = $(DUDIR)/setup.py +DUMANIFEST = $(DUDIR)/MANIFEST.in + all: clean python @@ -65,15 +70,15 @@ clean: rm -rf MANIFEST rpm-build python: - python setup.py build + python $(DUSETUP) build install: mkdir -p /usr/share/ansible cp ./library/* /usr/share/ansible/ - python setup.py install + python $(DUSETUP) install sdist: clean - python ./setup.py sdist + python ./$(DUSETUP) sdist -t $(DUMANIFEST) rpmcommon: sdist @mkdir -p rpm-build diff --git a/MANIFEST.in b/packaging/distutils/MANIFEST.in similarity index 78% rename from MANIFEST.in rename to packaging/distutils/MANIFEST.in index 60bc97f1872..4765bd548dd 100644 --- a/MANIFEST.in +++ b/packaging/distutils/MANIFEST.in @@ -1,5 +1,6 @@ include README.md packaging/rpm/ansible.spec include examples/hosts +include packaging/distutils/setup.py recursive-include docs * recursive-include library * include Makefile diff --git a/setup.py b/packaging/distutils/setup.py similarity index 100% rename from setup.py rename to packaging/distutils/setup.py diff --git a/packaging/rpm/ansible.spec b/packaging/rpm/ansible.spec index 9a394d51359..bd1350e73d6 100644 --- a/packaging/rpm/ansible.spec +++ b/packaging/rpm/ansible.spec @@ -2,6 +2,8 @@ %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot %endif +%define _dusetup packaging/distutils/setup.py + Name: ansible Release: 1%{?dist} @@ -33,10 +35,10 @@ are transferred to managed machines automatically. %setup -q %build -%{__python} setup.py build +%{__python} %{_dusetup} build %install -%{__python} setup.py install -O1 --root=$RPM_BUILD_ROOT +%{__python} %{_dusetup} install -O1 --root=$RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/etc/ansible/ cp examples/hosts $RPM_BUILD_ROOT/etc/ansible/ mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1/