Skip to content

Commit

Permalink
Merge branch 'portable-gz-non-docker' into rhel-7
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Crafts committed May 16, 2016
2 parents 860ed84 + 294a3e9 commit 5ac95d5
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 6 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ include etc/redhattools.pub.gpg
include etc/.exp.sed
include etc/*.pem
include docs/*
include redhat-access-insights-*.tar.gz
21 changes: 18 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
RPMTOP=$(shell bash -c "pwd -P")/dist
TOPDIR=$(shell bash -c "pwd -P")
RPMTOP=$(TOPDIR)/dist
PKGNAME=redhat-access-insights
SRPM=$(RPMTOP)/SRPMS/$(PKGNAME)-*.src.rpm
TARBALL=$(RPMTOP)/$(PKGNAME)-*.tar.gz
TAR_PORTABLE=$(TOPDIR)/$(PKGNAME)-*.tar.gz
RPM=$(RPMTOP)/RPMS/noarch/$(PKGNAME)*.rpm
CONSTANTS=$(TOPDIR)/redhat_access_insights/constants.py
PY_SDIST=python setup.py sdist
CONF_ORIG=default_conf_dir = '\/etc\/' + app_name + '\/'
CONF_PORT=default_conf_dir = package_path + '\/etc\/'

all: rpm

.PHONY: tarball
tarball: $(TARBALL)
$(TARBALL): Makefile
python setup.py sdist
$(PY_SDIST)

.PHONY: tar_portable
tar_portable: $(TAR_PORTABLE)
$(TAR_PORTABLE): Makefile
sed -i "s/$(CONF_ORIG)/$(CONF_PORT)/" $(CONSTANTS)
$(PY_SDIST)
sed -i "s/$(CONF_PORT)/$(CONF_ORIG)/" $(CONSTANTS)
mv $(TARBALL) $(RPMTOP)/..

.PHONY: srpm rpm
srpm: $(SRPM)
$(SRPM): $(TARBALL) $(SPEC_FILE_IN)
$(SRPM): $(TAR_PORTABLE) $(TARBALL) $(SPEC_FILE_IN)
mkdir -p $(RPMTOP)/{RPMS,SPECS,SRPMS,SOURCES,BUILD,BUILDROOT}
rpmbuild -ts --define="_topdir $(RPMTOP)" --define="_sourcedir dist" $(TARBALL)

Expand All @@ -29,4 +43,5 @@ clean:
rm -rf dist
rm -f MANIFEST
rm -rf *.egg*
rm -f $(TAR_PORTABLE)
find . -type f -name '*.pyc' -delete
3 changes: 2 additions & 1 deletion etc/redhat-access-insights.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Name: redhat-access-insights
Summary: Uploads Insights information to Red Hat on a periodic basis
Version: 1.0.9
Version: 1.0.10
Release: 1%{?dist}
Source0: https://github.com/redhataccess/insights-client/archive/redhat-access-insights-%{version}.tar.gz
Epoch: 0
Expand Down Expand Up @@ -77,6 +77,7 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root)
%{python_sitelib}/redhat_access_insights*.egg-info
%{python_sitelib}/redhat_access_insights/*.py*
%{_sharedstatedir}/redhat_access_insights/redhat-access-insights-*.tar.gz

%doc
/usr/share/man/man8/*.8.gz
Expand Down
5 changes: 4 additions & 1 deletion redhat_access_insights/constants.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
"""
Constants
"""
import os


class InsightsConstants(object):
app_name = 'redhat-access-insights'
version = '1.0.9'
version = '1.0.10'
auth_method = 'BASIC'
log_level = 'DEBUG'
package_path = os.path.dirname(
os.path.dirname(os.path.abspath(__file__)))
sleep_time = 300
user_agent = app_name + '/' + version
default_conf_dir = '/etc/' + app_name + '/'
Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def get_version():
man5path = "/usr/share/man/man5/"
man8path = "/usr/share/man/man8/"

rpmpath = "/var/lib/redhat_access_insights"

setup(
name="redhat-access-insights",
version=VERSION,
Expand Down Expand Up @@ -53,7 +55,10 @@ def get_version():
(man5path, ['docs/redhat-access-insights.conf.5']),
(man8path, ['docs/redhat-access-insights.8']),

(logpath, [])
(logpath, []),

# included portable client .gz
(rpmpath, ['redhat-access-insights-' + VERSION + '.tar.gz'])
],
description=SHORT_DESC,
long_description=LONG_DESC
Expand Down

0 comments on commit 5ac95d5

Please sign in to comment.