Skip to content

Commit

Permalink
Makefile: add rpm target
Browse files Browse the repository at this point in the history
Mostly useful for development.
  • Loading branch information
dmnks committed Feb 12, 2019
1 parent 9dde5c6 commit 387685e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ docs/sphinxdocs/_build
.project
.pydevproject
asthelper.completions
build
21 changes: 20 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ PYTHON=python
WEBHOST = yum.baseurl.org
WEB_DOC_PATH = /srv/projects/yum/web/download/docs/yum-api/

BUILDDIR = build
MOCK_CONF = epel-7-x86_64

all: subdirs

clean:
rm -f *.pyc *.pyo *~ *.bak
rm -f $(BUILDDIR)/{SOURCES,SRPMS,RPMS}/*
mock -r $(MOCK_CONF) --clean
for d in $(SUBDIRS); do make -C $$d clean ; done
cd test; rm -f *.pyc *.pyo *~ *.bak

Expand Down Expand Up @@ -58,7 +63,7 @@ transifex:
make transifex-push
git commit -a -m 'Transifex push, yum.pot update'

.PHONY: docs test
.PHONY: docs test srpm rpm

DOCS = yum rpmUtils callback.py yumcommands.py shell.py output.py cli.py utils.py\
yummain.py
Expand Down Expand Up @@ -122,3 +127,17 @@ _archive:
@rm -rf /tmp/${PKGNAME}-$(VERSION)
@echo "The archive is in ${PKGNAME}-$(VERSION).tar.gz"

### RPM packaging ###

$(BUILDDIR):
@mkdir -p $@/{SOURCES,SRPMS,RPMS}

srpm: archive $(BUILDDIR)
@cp $(PKGNAME)-$(VERSION).tar.gz $(BUILDDIR)/SOURCES/
@rpmbuild --define '_topdir $(BUILDDIR)' -bs yum.spec

rpm: srpm
@mock -r $(MOCK_CONF) --resultdir=$(BUILDDIR)/RPMS \
--no-clean --no-cleanup-after \
$(BUILDDIR)/SRPMS/$(PKGNAME)-$(VERSION)-$(RELEASE).src.rpm
@echo "The RPMs are in $(BUILDDIR)/RPMS"
7 changes: 7 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@ wiki: http:https://yum.baseurl.org/wiki
Starting commit is roughly: a3c91d7f6a15f31a42d020127b2da2877dfc137d
E.g. git diff a3c91d7f6a15f31a42d020127b2da2877dfc137d

Development:

You can build an RPM package by running:

$ make rpm

Note: Make sure you have mock and lynx installed.

0 comments on commit 387685e

Please sign in to comment.