Skip to content

Commit

Permalink
Move packaging related things out of the root directory:
Browse files Browse the repository at this point in the history
Distutils MANIFEST.in, setup.py -> packaging/distutils/ directory.
  • Loading branch information
tbielawa committed Apr 19, 2012
1 parent 4578b17 commit 516df5f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in → packaging/distutils/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
6 changes: 4 additions & 2 deletions packaging/rpm/ansible.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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/
Expand Down

0 comments on commit 516df5f

Please sign in to comment.