Browse code

Move packaging related things out of the root directory:

Distutils MANIFEST.in, setup.py -> packaging/distutils/ directory.

Tim Bielawa authored on 2012/04/20 02:42:44
Showing 6 changed files
1 1
deleted file mode 100644
... ...
@@ -1,5 +0,0 @@
1
-include README.md packaging/rpm/ansible.spec
2
-include examples/hosts
3
-recursive-include docs *
4
-recursive-include library *
5
-include Makefile
... ...
@@ -16,6 +16,11 @@ RPMVERSION := $(shell awk '/Version/{print $$2; exit}' < $(RPMSPEC) | cut -d "%"
16 16
 RPMRELEASE := $(shell awk '/Release/{print $$2; exit}' < $(RPMSPEC) | cut -d "%" -f1)
17 17
 RPMDIST = $(shell rpm --eval '%dist')
18 18
 RPMNVR = "$(NAME)-$(RPMVERSION)-$(RPMRELEASE)$(RPMDIST)"
19
+# Python distutils options
20
+DUDIR = packaging/distutils
21
+DUSETUP = $(DUDIR)/setup.py
22
+DUMANIFEST = $(DUDIR)/MANIFEST.in
23
+
19 24
 
20 25
 all: clean python
21 26
 
... ...
@@ -65,15 +70,15 @@ clean:
65 65
 	rm -rf MANIFEST rpm-build
66 66
 
67 67
 python:
68
-	python setup.py build
68
+	python $(DUSETUP) build
69 69
 
70 70
 install:
71 71
 	mkdir -p /usr/share/ansible
72 72
 	cp ./library/* /usr/share/ansible/
73
-	python setup.py install
73
+	python $(DUSETUP) install
74 74
 
75 75
 sdist: clean
76
-	python ./setup.py sdist
76
+	python ./$(DUSETUP) sdist -t $(DUMANIFEST)
77 77
 
78 78
 rpmcommon: sdist
79 79
 	@mkdir -p rpm-build
80 80
new file mode 100644
... ...
@@ -0,0 +1,6 @@
0
+include README.md packaging/rpm/ansible.spec
1
+include examples/hosts
2
+include packaging/distutils/setup.py
3
+recursive-include docs *
4
+recursive-include library *
5
+include Makefile
0 6
new file mode 100644
... ...
@@ -0,0 +1,30 @@
0
+#!/usr/bin/env python
1
+
2
+# NOTE: setup.py does NOT install the contents of the library dir
3
+# for you, you should go through "make install" or "make RPMs" 
4
+# for that, or manually copy modules over.
5
+
6
+import glob
7
+import os
8
+import sys
9
+
10
+sys.path.insert(0, os.path.abspath('lib'))
11
+from ansible import __version__, __author__
12
+from distutils.core import setup
13
+
14
+setup(name='ansible',
15
+      version=__version__,
16
+      description='Minimal SSH command and control',
17
+      author=__author__,
18
+      author_email='michael.dehaan@gmail.com',
19
+      url='http://ansible.github.com/',
20
+      license='GPLv3',
21
+      package_dir = { 'ansible' : 'lib/ansible' },
22
+      packages=[
23
+         'ansible',
24
+      ],
25
+      scripts=[
26
+         'bin/ansible',
27
+         'bin/ansible-playbook'
28
+      ]
29
+)
... ...
@@ -2,6 +2,8 @@
2 2
 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
3 3
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
4 4
 %endif
5
+%define _dusetup   packaging/distutils/setup.py
6
+
5 7
 
6 8
 Name: ansible
7 9
 Release: 1%{?dist}
... ...
@@ -33,10 +35,10 @@ are transferred to managed machines automatically.
33 33
 %setup -q
34 34
 
35 35
 %build
36
-%{__python} setup.py build
36
+%{__python} %{_dusetup} build
37 37
 
38 38
 %install
39
-%{__python} setup.py install -O1 --root=$RPM_BUILD_ROOT
39
+%{__python} %{_dusetup} install -O1 --root=$RPM_BUILD_ROOT
40 40
 mkdir -p $RPM_BUILD_ROOT/etc/ansible/
41 41
 cp examples/hosts $RPM_BUILD_ROOT/etc/ansible/
42 42
 mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1/
43 43
deleted file mode 100644
... ...
@@ -1,30 +0,0 @@
1
-#!/usr/bin/env python
2
-
3
-# NOTE: setup.py does NOT install the contents of the library dir
4
-# for you, you should go through "make install" or "make RPMs" 
5
-# for that, or manually copy modules over.
6
-
7
-import glob
8
-import os
9
-import sys
10
-
11
-sys.path.insert(0, os.path.abspath('lib'))
12
-from ansible import __version__, __author__
13
-from distutils.core import setup
14
-
15
-setup(name='ansible',
16
-      version=__version__,
17
-      description='Minimal SSH command and control',
18
-      author=__author__,
19
-      author_email='michael.dehaan@gmail.com',
20
-      url='http://ansible.github.com/',
21
-      license='GPLv3',
22
-      package_dir = { 'ansible' : 'lib/ansible' },
23
-      packages=[
24
-         'ansible',
25
-      ],
26
-      scripts=[
27
-         'bin/ansible',
28
-         'bin/ansible-playbook'
29
-      ]
30
-)