Skip to content

Commit

Permalink
Fixup RPM building: Makefile, Spec File, .gitignore
Browse files Browse the repository at this point in the history
Fixup distutils: setup.py

Clean old cruft: section 5 man pages
  • Loading branch information
tbielawa committed Mar 10, 2012
1 parent 8808c81 commit 3f24549
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 397 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ build
# Emacs backup files...
*~
.\#*
# (s)rpm building stuff
MANIFEST
dist
rpm-build
45 changes: 38 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/usr/bin/make

NAME = "ansible"
ASCII2MAN = a2x -D $(dir $@) -d manpage -f manpage $<
ASCII2HTMLMAN = a2x -D docs/html/man/ -d manpage -f xhtml
MANPAGES := docs/man/man1/ansible.1 docs/man/man1/ansible-playbook.1
SITELIB = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
RPMVERSION := $(shell awk '/Version/{print $$2; exit}' < ansible.spec | cut -d "%" -f1)
RPMRELEASE := $(shell awk '/Release/{print $$2; exit}' < ansible.spec | cut -d "%" -f1)
RPMNVR = "$(NAME)-$(RPMVERSION)-$(RPMRELEASE)"

all: clean python

Expand Down Expand Up @@ -45,20 +49,47 @@ clean:
find ./docs/man -type f \( -name "*.xml" -or -regex ".*\.[0-9]$$" \) -delete
@echo "Cleaning up output from test runs"
-rm -rf test/test_data
@echo "Cleaning up RPM stuff"
-rm MANIFEST
@echo "Cleaning up RPM building stuff"
-rm -rf MANIFEST rpm-build

python: docs
python setup.py build

install: docs
python setup.py install

rpm:
python setup.py sdist
rpmbuild -ta dist/ansible-1.0.tar.gz
sdist: clean
python ./setup.py sdist

rpmcommon: sdist
@mkdir -p rpm-build
@cp dist/*.gz rpm-build/

srpm: rpmcommon
@rpmbuild --define "_topdir %(pwd)/rpm-build" \
--define "_builddir %{_topdir}" \
--define "_rpmdir %{_topdir}" \
--define "_srcrpmdir %{_topdir}" \
--define "_specdir %{_topdir}" \
--define "_sourcedir %{_topdir}" \
-bs ansible.spec
@echo "#############################################"
@echo "Ansible SRPM is built:"
@echo " rpm-build/$(RPMNVR).src.rpm"
@echo "#############################################"

rpm: rpmcommon
@rpmbuild --define "_topdir %(pwd)/rpm-build" \
--define "_builddir %{_topdir}" \
--define "_rpmdir %{_topdir}" \
--define "_srcrpmdir %{_topdir}" \
--define "_specdir %{_topdir}" \
--define "_sourcedir %{_topdir}" \
-ba ansible.spec
@echo "#############################################"
@echo "Ansible RPM is built:"
@echo " rpm-build/noarch/$(RPMNVR).noarch.rpm"
@echo "#############################################"

.PHONEY: docs manual clean pep8
vpath %.asciidoc docs/man/man1


24 changes: 13 additions & 11 deletions ansible.spec
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}

Summary: Minimal SSH command and control
Name: ansible
Version: 1.0
Release: 1
Source0: ansible-%{version}.tar.gz
License: GPLv3
Group: Development/Libraries
Summary: Minimal SSH command and control
Version: 0.0.1

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Group: Development/Libraries
License: GPLv3
Prefix: %{_prefix}
Source0: ansible-%{version}.tar.gz
Url: http://ansible.github.com

BuildArch: noarch
Url: http://github.com/mpdehaan/ansible/
BuildRequires: asciidoc
BuildRequires: python-devel

Requires: python-paramiko
Requires: python-jinja2

Expand All @@ -21,7 +25,7 @@ executing commands, running "modules", or executing larger 'playbooks' that
can serve as a configuration management or deployment system.

%prep
%setup -n %{name}-%{version}
%setup -q -n %{name}-%{version}

%build
python setup.py build
Expand All @@ -38,13 +42,11 @@ rm -rf $RPM_BUILD_ROOT
%doc README.md AUTHORS.md PKG-INFO
%defattr(-,root,root)
%{_mandir}/man1/*.gz
%{_mandir}/man5/*.gz
%{python_sitelib}/*
%{_bindir}/ansible*
%{_datadir}/ansible/*
%{_sysconfdir}/ansible/

%changelog
* Mon Mar 5 2012 Seth Vidal <skvidal at fedoraproject.org>
- spec file

* Sat Mar 10 2012 <[email protected]> - 0.0.1-1
- Release of 0.0.1
2 changes: 2 additions & 0 deletions docs/man/man1/ansible-playbook.1.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ Ansible is released under the terms of the GPLv3 License.
SEE ALSO
--------

*ansible*(1)

Extensive documentation as well as IRC and mailing list info
is available on the ansible home page: <https://ansible.github.com/>

Expand Down
5 changes: 2 additions & 3 deletions docs/man/man1/ansible.1.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ Ansible is released under the terms of the GPLv3 License.
SEE ALSO
--------

*ansible-playbook*(1)

Extensive documentation as well as IRC and mailing list info
is available on the ansible home page: <https://ansible.github.com/>



235 changes: 0 additions & 235 deletions docs/man/man5/ansible-modules.5.asciidoc

This file was deleted.

Loading

0 comments on commit 3f24549

Please sign in to comment.