Skip to content

Commit

Permalink
Move setup.py stuff back to top level as "make sdist" was not working…
Browse files Browse the repository at this point in the history
…, plus, it makes sources cleaner.
  • Loading branch information
mpdehaan committed Apr 21, 2012
1 parent a8d7482 commit f72114c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
File renamed without changes.
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ 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 @@ -70,15 +65,15 @@ clean:
rm -rf MANIFEST rpm-build

python:
python $(DUSETUP) build
python setup.py build

install:
mkdir -p /usr/share/ansible
cp ./library/* /usr/share/ansible/
python $(DUSETUP) install
python setup.py install

sdist: clean
python ./$(DUSETUP) sdist -t $(DUMANIFEST)
python setup.py sdist -t MANIFEST.in

rpmcommon: sdist
@mkdir -p rpm-build
Expand Down Expand Up @@ -109,3 +104,10 @@ rpm: rpmcommon
@echo "Ansible RPM is built:"
@echo " rpm-build/noarch/$(RPMNVR).noarch.rpm"
@echo "#############################################"

debian:
# stub target, FIXME!
(cd packaging/debian; dpkg-buildpackage -us -uc -rfakeroot)

# for arch or gentoo, read instructions in the appropriate 'packaging' subdirectory directory

6 changes: 2 additions & 4 deletions packaging/rpm/ansible.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
%{!?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 @@ -35,10 +33,10 @@ are transferred to managed machines automatically.
%setup -q

%build
%{__python} %{_dusetup} build
%{__python} setup.py build

%install
%{__python} %{_dusetup} install -O1 --root=$RPM_BUILD_ROOT
%{__python} setup.py 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
File renamed without changes.

0 comments on commit f72114c

Please sign in to comment.