Skip to content

Commit

Permalink
Added Makefile for making rpm's and other stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashcrow committed Mar 12, 2014
1 parent 74553ec commit 00ba4ef
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ test/Test-CA/certs/
test/Test-CA/requests/
test/Test-CA/index.txt
tox/
rpm-build/

# C extensions
*.so
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ include LICENSE
include AUTHORS
include MANIFEST.in
include README.md
include tox.ini
include Makefile
include config.json
include setup.py
recursive-include contrib *
Expand Down
85 changes: 85 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
PRODUCT := "cacophony"
RPMSPECDIR := contrib/rpm
RPMSPEC := $(RPMSPECDIR)/$(PRODUCT).spec

tests: unittests pep8 pyflakes
:

unittests:
@echo "#############################################"
@echo "# Running Unit Tests"
@echo "#############################################"
nosetests -v

clean:
@find . -type f -regex ".*\.py[co]$$" -delete
@find . -type f \( -name "*~" -or -name "#*" \) -delete
@rm -fR build dist rpm-build MANIFEST

pep8:
@echo "#############################################"
@echo "# Running PEP8 Compliance Tests"
@echo "#############################################"
pep8 --ignore=E501 -r server.py

pyflakes:
@echo "#############################################"
@echo "# Running Pyflakes Sanity Tests"
@echo "# Note: most import errors may be ignored"
@echo "#############################################"
-pyflakes server.py

sdist: clean
python setup.py sdist

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

srpm5: rpmcommon
rpmbuild --define "_topdir %(pwd)/rpm-build" \
--define 'dist .el5' \
--define "_builddir %{_topdir}" \
--define "_rpmdir %{_topdir}" \
--define "_srcrpmdir %{_topdir}" \
--define "_specdir $(RPMSPECDIR)" \
--define "_sourcedir %{_topdir}" \
--define "_source_filedigest_algorithm 1" \
--define "_binary_filedigest_algorithm 1" \
--define "_binary_payload w9.gzdio" \
--define "_source_payload w9.gzdio" \
--define "_default_patch_fuzz 2" \
-bs $(RPMSPEC)
@echo "#############################################"
@echo "$(PRODUCT) SRPM is built:"
@find rpm-build -maxdepth 2 -name '$(PRODUCT)*src.rpm' | awk '{print " " $$1}'
@echo "#############################################"

srpm: rpmcommon
rpmbuild --define "_topdir %(pwd)/rpm-build" \
--define "_builddir %{_topdir}" \
--define "_rpmdir %{_topdir}" \
--define "_srcrpmdir %{_topdir}" \
--define "_specdir $(RPMSPECDIR)" \
--define "_sourcedir %{_topdir}" \
-bs $(RPMSPEC)
@echo "#############################################"
@echo "$(PRODUCT) SRPM is built:"
@find rpm-build -maxdepth 2 -name $(PRODUCT)'*src.rpm' | awk '{print " " $$1}'
@echo "#############################################"

rpm: rpmcommon
rpmbuild --define "_topdir %(pwd)/rpm-build" \
--define "_builddir %{_topdir}" \
--define "_rpmdir %{_topdir}" \
--define "_srcrpmdir %{_topdir}" \
--define "_specdir $(RPMSPECDIR)" \
--define "_sourcedir %{_topdir}" \
-ba $(RPMSPEC)
@echo "#############################################"
@echo "$(PRODUCT) RPMs are built:"
@find rpm-build/noarch -maxdepth 2 -name $(PRODUCT)'*.rpm' | awk '{print " " $$1}'
@echo "#############################################"

tag:
git tag -s -m $(TAG) cacophony-$(TAG)
4 changes: 2 additions & 2 deletions contrib/rpm/cacophony.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}

Name: python-cacophony
Name: cacophony
Version: 0.0.1
Release: 1%{?dist}
Summary: Simple REST Api for automagic SSL certificate generation
Expand All @@ -19,7 +19,7 @@ Simple REST Api for automagic SSL certificate generation.


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


%build
Expand Down

0 comments on commit 00ba4ef

Please sign in to comment.