diff options
author | Adam Stokes <adam.stokes@canonical.com> | 2012-02-21 01:28:12 +0000 |
---|---|---|
committer | Adam Stokes <adam.stokes@canonical.com> | 2012-02-21 01:30:31 +0000 |
commit | dfa1fc0d77f46a373e85a19448403da95faa27a9 (patch) | |
tree | 866b8143b4425973a8f802af621c80eee5054499 | |
parent | 9ef1a25ab2d1136eccc308d95c04424b43f0d605 (diff) | |
download | sos-dfa1fc0d77f46a373e85a19448403da95faa27a9.tar.gz |
policies: Make sure policies are included during build
There was no previous Makefile for including any additional
policy files. Also updated upstream directory in toplevel
Makefile and altered the @SOSVERSION@ string replacing to
work properly instead of zeroing out the init file
Signed-off-by: Adam Stokes <adam.stokes@canonical.com>
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | sos/__init__.py.in (renamed from sos/__init__.py) | 0 | ||||
-rw-r--r-- | sos/policies/Makefile | 20 |
3 files changed, 23 insertions, 3 deletions
@@ -5,9 +5,9 @@ NAME = sos VERSION = $(shell echo `awk '/^Version:/ {print $$2}' sos.spec`) RELEASE = $(shell echo `awk '/^Release:/ {gsub(/\%.*/,""); print $2}' sos.spec`) -REPO = http://svn.fedorahosted.org/svn/sos +REPO = http://github.com/sosreport -SUBDIRS = po sos sos/plugins +SUBDIRS = po sos sos/plugins sos/policies PYFILES = $(wildcard *.py) # OS X via brew # MSGCAT = /usr/local/Cellar/gettext/0.18.1.1/bin/msgcat @@ -47,7 +47,7 @@ install: install -m644 LICENSE README TODO $(DESTDIR)/usr/share/$(NAME)/. install -m644 $(NAME).conf $(DESTDIR)/etc/$(NAME).conf install -m644 gpgkeys/rhsupport.pub $(DESTDIR)/usr/share/$(NAME)/. - sed 's/@SOSVERSION@/$(VERSION)/g' < sos/__init__.py > sos/__init__.py + sed 's/@SOSVERSION@/$(VERSION)/g' sos/__init__.py.in > sos/__init__.py for d in $(SUBDIRS); do make DESTDIR=`cd $(DESTDIR); pwd` -C $$d install; [ $$? = 0 ] || exit 1; done $(NAME)-$(VERSION).tar.gz: clean gpgkey diff --git a/sos/__init__.py b/sos/__init__.py.in index f703a834..f703a834 100644 --- a/sos/__init__.py +++ b/sos/__init__.py.in diff --git a/sos/policies/Makefile b/sos/policies/Makefile new file mode 100644 index 00000000..8fd6a1bf --- /dev/null +++ b/sos/policies/Makefile @@ -0,0 +1,20 @@ +PYTHON=python +PACKAGE = $(shell basename `pwd`) +PYFILES = $(wildcard *.py) +PYVER := $(shell $(PYTHON) -c 'import sys; print "%.3s" %(sys.version)') +PYSYSDIR := $(shell $(PYTHON) -c 'import sys; print sys.prefix') +PYLIBDIR = $(PYSYSDIR)/lib/python$(PYVER) +PKGDIR = $(PYLIBDIR)/site-packages/sos/$(PACKAGE) + +all: + echo "nada" + +clean: + rm -f *.pyc *.pyo *~ + +install: + mkdir -p $(DESTDIR)/$(PKGDIR) + for p in $(PYFILES) ; do \ + install -m 755 $$p $(DESTDIR)/$(PKGDIR)/$$p; \ + done + $(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(PKGDIR)', 1, '$(PYDIR)', 1)" |