This is a series of 3 patches. Please view them at origin/stage_build or here.I did not use RB because it can't do patch series and the changes would be confusing if combined into a single patch.
We already stumbled onto a problem that we need to update spec file every time we want to update staging environment. That's really bad, ideally we want to update after every major commit (like my yesterday's patch). I have modified Makefile (I officially announce that I hate the syntax) to allow us to create development autoqa builds without modifying spec file. You just execute:
make archive DEVEL=1 or make srpm DEVEL=1 pr make mock DEVEL=1
and here we go. The rpm file then looks like this 'autoqa-0.7.1_devel_v0.5.0_1_63_g5a41715-1.fc16.noarch.rpm'. Pretty long, but its an ascending sequence, which suffices. This can be built directly on stage server and then installed. No need to change the spec file, no need to commit it to git. Voila.
Kamil Páral (3): autoqa.spec: replace $(NAME) with 'autoqa' Makefile: allow creating DEVEL builds autoqa.spec: remove pre-release statements in changelog
Makefile | 172 ++++++++++++++++++++++++++++++++--------------------------- autoqa.spec | 18 ------ 2 files changed, 93 insertions(+), 97 deletions(-)
There's no reason to have another level of inderection for project name, it just makes the spec file more obscure. --- Makefile | 100 ++++++++++++++++++++++++++++++------------------------------- 1 files changed, 49 insertions(+), 51 deletions(-)
diff --git a/Makefile b/Makefile index 11ec691..8ddbc62 100644 --- a/Makefile +++ b/Makefile @@ -16,12 +16,10 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #
-NAME=autoqa - # Common autoqa paths PREFIX= -EVENT_DIR=/usr/share/$(NAME)/events -WATCHER_DIR=/usr/share/$(NAME)/watchers +EVENT_DIR=/usr/share/autoqa/events +WATCHER_DIR=/usr/share/autoqa/watchers AUTOTEST_DIR=/usr/share/autotest TEST_DIR=$(AUTOTEST_DIR)/client/site_tests HTTPCONF_DIR=/etc/httpd/conf.d/ @@ -49,7 +47,7 @@ EL5_DEFINES= --define "_source_filedigest_algorithm 1" \ --define "_binary_filedigest_algorithm 1"
# Variables used for packaging -SPECFILE=$(NAME).spec +SPECFILE=autoqa.spec BASEARCH=$(shell uname -i) VERSION=$(shell echo `gawk '$$1~/^Version:/{print $$2}' $(SPECFILE)`)
@@ -92,61 +90,61 @@ all: build
clean: find . -name "*.py[co]" -exec rm -f {} + - rm -f $(NAME)-$(VERSION).tar.gz - rm -rf lib/$(NAME)/build + rm -f autoqa-$(VERSION).tar.gz + rm -rf lib/autoqa/build rm -rf $(WORKDIR)
install: build install -d $(PREFIX)/usr/bin - install -d -m 0775 $(PREFIX)/var/cache/$(NAME) - install $(NAME) $(PREFIX)/usr/bin/ - install -d $(PREFIX)/etc/$(NAME) - [ -f $(PREFIX)/etc/$(NAME)/$(NAME).conf ] || install -m 0644 conf/$(NAME).conf $(PREFIX)/etc/$(NAME)/ - [ -f $(PREFIX)/etc/$(NAME)/fas.conf ] || install -m 0640 conf/fas.conf $(PREFIX)/etc/$(NAME) - [ -f $(PREFIX)/etc/$(NAME)/yourls.conf ] || install -m 0640 conf/yourls.conf $(PREFIX)/etc/$(NAME) + install -d -m 0775 $(PREFIX)/var/cache/autoqa + install autoqa $(PREFIX)/usr/bin/ + install -d $(PREFIX)/etc/autoqa + [ -f $(PREFIX)/etc/autoqa/autoqa.conf ] || install -m 0644 conf/autoqa.conf $(PREFIX)/etc/autoqa/ + [ -f $(PREFIX)/etc/autoqa/fas.conf ] || install -m 0640 conf/fas.conf $(PREFIX)/etc/autoqa + [ -f $(PREFIX)/etc/autoqa/yourls.conf ] || install -m 0640 conf/yourls.conf $(PREFIX)/etc/autoqa # if running under root, then we're not building the package in mock, but rather \ # installing from source on a developer machine; because rpm will not change \ # configs' ownership for us, we have to do it manually here \ - if [ `id -u` -eq 0 ]; then chgrp autotest $(PREFIX)/etc/$(NAME)/{fas,yourls}.conf; fi - install -m 0644 conf/repoinfo.conf $(PREFIX)/etc/$(NAME)/ - install -m 0644 conf/log_template.html $(PREFIX)/etc/$(NAME)/ - install -m 0644 conf/client-deps.conf $(PREFIX)/etc/$(NAME)/ + if [ `id -u` -eq 0 ]; then chgrp autotest $(PREFIX)/etc/autoqa/{fas,yourls}.conf; fi + install -m 0644 conf/repoinfo.conf $(PREFIX)/etc/autoqa/ + install -m 0644 conf/log_template.html $(PREFIX)/etc/autoqa/ + install -m 0644 conf/client-deps.conf $(PREFIX)/etc/autoqa/ ## run directory - install -d $(PREFIX)/var/run/$(NAME) + install -d $(PREFIX)/var/run/autoqa ## logrotate conf install -d $(PREFIX)/etc/logrotate.d install -m 0644 conf/logrotate.d/autoqa $(PREFIX)/etc/logrotate.d/ ## log directory - install -d $(PREFIX)/var/log/$(NAME) + install -d $(PREFIX)/var/log/autoqa install -d $(PREFIX)$(EVENT_DIR) for h in events/*; do cp -a $$h $(PREFIX)$(EVENT_DIR); done install -d $(PREFIX)$(WATCHER_DIR) for h in watchers/*; do cp -a $$h $(PREFIX)$(WATCHER_DIR); done ## git-post-receive setup install -d $(PREFIX)/usr/sbin - mv $(PREFIX)$(WATCHER_DIR)/git-post-receive/$(NAME)-git-hook.wsgi $(PREFIX)/usr/sbin/ + mv $(PREFIX)$(WATCHER_DIR)/git-post-receive/autoqa-git-hook.wsgi $(PREFIX)/usr/sbin/ install -d $(PREFIX)/$(HTTPCONF_DIR) - mv $(PREFIX)$(WATCHER_DIR)/git-post-receive/$(NAME)-git-hook.conf $(PREFIX)/$(HTTPCONF_DIR)/ - [ -f $(PREFIX)$(WATCHER_DIR)/$(NAME).cron ] || install -m 0644 conf/$(NAME).cron $(PREFIX)$(WATCHER_DIR)/ + mv $(PREFIX)$(WATCHER_DIR)/git-post-receive/autoqa-git-hook.conf $(PREFIX)/$(HTTPCONF_DIR)/ + [ -f $(PREFIX)$(WATCHER_DIR)/autoqa.cron ] || install -m 0644 conf/autoqa.cron $(PREFIX)$(WATCHER_DIR)/ install -d $(PREFIX)$(TEST_DIR) for t in tests/*; do cp -a $$t $(PREFIX)$(TEST_DIR); done install -d $(PREFIX)$(AUTOTEST_DIR)/client/{bin,common_lib} install -m 0644 lib/autotest/site_utils.py $(PREFIX)$(AUTOTEST_DIR)/client/bin/ install -d $(PREFIX)$(AUTOTEST_DIR)/server install -m 0644 lib/autotest/site_autotest.py $(PREFIX)$(AUTOTEST_DIR)/server/ - ( cd lib/$(NAME); $(PYTHON) setup.py install --skip-build --root $(PREFIX)/ ) + ( cd lib/autoqa; $(PYTHON) setup.py install --skip-build --root $(PREFIX)/ ) ## 404 page install -d $(PREFIX)$(ERRDOCS_DIR) install -m 0644 static/404.html $(PREFIX)$(ERRDOCS_DIR) - install -m 0644 -T conf/autoqa-apache.conf $(PREFIX)/etc/httpd/conf.d/$(NAME).conf + install -m 0644 -T conf/autoqa-apache.conf $(PREFIX)/etc/httpd/conf.d/autoqa.conf ## populate client-deps.conf # we don't need some packages on the client, filter them out - echo "$(REQS)" | grep -Ev '^(autotest|mod_wsgi|httpd|yourls)$$' >> $(PREFIX)/etc/$(NAME)/client-deps.conf + echo "$(REQS)" | grep -Ev '^(autotest|mod_wsgi|httpd|yourls)$$' >> $(PREFIX)/etc/autoqa/client-deps.conf
-build: lib/$(NAME)/build +build: lib/autoqa/build
-lib/$(NAME)/build: - ( cd lib/$(NAME); $(PYTHON) setup.py build ) +lib/autoqa/build: + ( cd lib/autoqa; $(PYTHON) setup.py build )
test: bash runtests.sh @@ -155,22 +153,22 @@ test: # Tarball #
-archive: $(SOURCEDIR)/$(NAME)-$(VERSION).tar.gz +archive: $(SOURCEDIR)/autoqa-$(VERSION).tar.gz
-upload: $(SOURCEDIR)/$(NAME)-$(VERSION).tar.gz - @scp $(SOURCEDIR)/$(NAME)-$(VERSION).tar.gz fedorahosted.org:$(NAME) +upload: $(SOURCEDIR)/autoqa-$(VERSION).tar.gz + @scp $(SOURCEDIR)/autoqa-$(VERSION).tar.gz fedorahosted.org:autoqa
-$(SOURCEDIR)/$(NAME)-$(VERSION).tar.gz: $(SPECDIR)/$(SPECFILE) +$(SOURCEDIR)/autoqa-$(VERSION).tar.gz: $(SPECDIR)/$(SPECFILE) [ -d .git ] # CHECKING TO SEE IF THIS IS A GIT TREE mkdir -p $(SOURCEDIR) - git archive HEAD --prefix=$(NAME)-$(VERSION)/ | gzip -c9 > /$@ + git archive HEAD --prefix=autoqa-$(VERSION)/ | gzip -c9 > /$@
# # BUILD RPMS either with or without the EL5_DEFINES (EPEL-5) #
nvr: - @echo $(NAME)-$(VERSION)-$(RELEASE)$(DIST) + @echo autoqa-$(VERSION)-$(RELEASE)$(DIST)
list-requires: @echo "$(REQS)" @@ -190,29 +188,29 @@ $(SPECDIR)/$(SPECFILE): $(SPECFILE) @mkdir -p $(SPECDIR) @cp $(SPECFILE) $(SPECDIR)/
-$(SRCRPMDIR)/$(NAME)-$(VERSION)-$(RELEASE).fc%.src.rpm: $(SPECDIR)/$(SPECFILE) $(SOURCEDIR)/$(NAME)-$(VERSION).tar.gz +$(SRCRPMDIR)/autoqa-$(VERSION)-$(RELEASE).fc%.src.rpm: $(SPECDIR)/$(SPECFILE) $(SOURCEDIR)/autoqa-$(VERSION).tar.gz mkdir -p $(SRCRPMDIR) $(BUILDDIR) $(RPMDIR) rpmbuild $(RPM_DEFINES) -bs --nodeps $<
-$(RPMDIR)/noarch/$(NAME)-$(VERSION)-$(RELEASE).fc%.noarch.rpm: $(SPECDIR)/$(SPECFILE) $(SOURCEDIR)/$(NAME)-$(VERSION).tar.gz +$(RPMDIR)/noarch/autoqa-$(VERSION)-$(RELEASE).fc%.noarch.rpm: $(SPECDIR)/$(SPECFILE) $(SOURCEDIR)/autoqa-$(VERSION).tar.gz mkdir -p $(SRCRPMDIR) $(BUILDDIR) $(RPMDIR) rpmbuild $(RPM_DEFINES) -ba $<
-$(SRCRPMDIR)/$(NAME)-$(VERSION)-$(RELEASE).el%.src.rpm: $(SPECDIR)/$(SPECFILE) $(SOURCEDIR)/$(NAME)-$(VERSION).tar.gz +$(SRCRPMDIR)/autoqa-$(VERSION)-$(RELEASE).el%.src.rpm: $(SPECDIR)/$(SPECFILE) $(SOURCEDIR)/autoqa-$(VERSION).tar.gz mkdir -p $(SRCRPMDIR) $(BUILDDIR) $(RPMDIR) rpmbuild $(RPM_DEFINES) $(EL5_DEFINES) -bs --nodeps $<
-$(RPMDIR)/noarch/$(NAME)-$(VERSION)-$(RELEASE).el%.noarch.rpm: $(SPECDIR)/$(SPECFILE) $(SOURCEDIR)/$(NAME)-$(VERSION).tar.gz +$(RPMDIR)/noarch/autoqa-$(VERSION)-$(RELEASE).el%.noarch.rpm: $(SPECDIR)/$(SPECFILE) $(SOURCEDIR)/autoqa-$(VERSION).tar.gz mkdir -p $(SRCRPMDIR) $(BUILDDIR) $(RPMDIR) rpmbuild $(RPM_DEFINES) $(EL5_DEFINES) -ba $<
-srpm: $(SRCRPMDIR)/$(NAME)-$(VERSION)-$(RELEASE)$(DIST).src.rpm -rpm: $(RPMDIR)/noarch/$(NAME)-$(VERSION)-$(RELEASE)$(DIST).noarch.rpm +srpm: $(SRCRPMDIR)/autoqa-$(VERSION)-$(RELEASE)$(DIST).src.rpm +rpm: $(RPMDIR)/noarch/autoqa-$(VERSION)-$(RELEASE)$(DIST).noarch.rpm
-srpm.el5: $(SRCRPMDIR)/$(NAME)-$(VERSION)-$(RELEASE).el5.src.rpm -rpm.el5: $(RPMDIR)/noarch/$(NAME)-$(VERSION)-$(RELEASE).el5.noarch.rpm -srpm.el6: $(SRCRPMDIR)/$(NAME)-$(VERSION)-$(RELEASE).el6.src.rpm -rpm.el6: $(RPMDIR)/noarch/$(NAME)-$(VERSION)-$(RELEASE).el6.noarch.rpm +srpm.el5: $(SRCRPMDIR)/autoqa-$(VERSION)-$(RELEASE).el5.src.rpm +rpm.el5: $(RPMDIR)/noarch/autoqa-$(VERSION)-$(RELEASE).el5.noarch.rpm +srpm.el6: $(SRCRPMDIR)/autoqa-$(VERSION)-$(RELEASE).el6.src.rpm +rpm.el6: $(RPMDIR)/noarch/autoqa-$(VERSION)-$(RELEASE).el6.noarch.rpm
# # Mock builds @@ -229,7 +227,7 @@ RELEASEVER=fedora-$(subst .fc,,$(DIST)) endif RELEASEVER?=fedora-devel
-$(MOCKDIR)/$(RELEASEVER)-$(BASEARCH): $(SRCRPMDIR)/$(NAME)-$(VERSION)-$(RELEASE)$(DIST).src.rpm +$(MOCKDIR)/$(RELEASEVER)-$(BASEARCH): $(SRCRPMDIR)/autoqa-$(VERSION)-$(RELEASE)$(DIST).src.rpm mock -r $(RELEASEVER)-$(BASEARCH) --rebuild --resultdir=$(MOCKDIR)/$(RELEASEVER)-$(BASEARCH) $<
mock: $(MOCKDIR)/$(RELEASEVER)-$(BASEARCH) @@ -246,17 +244,17 @@ help: @echo "General targets:" @echo " help Show this text" @echo " clean Remove any interim build files and the build directory ($(WORKDIR))" - @echo " build Run python setup.py to build $(NAME) python library" + @echo " build Run python setup.py to build autoqa python library" @echo " test Execute self-tests" @echo " install Install source files into system-wide locations" - @echo " archive Create source tarball $(NAME)-$(VERSION).tar.gz" - @echo " upload Upload source tarball to fedorahosted.org" + @echo " archive Create source tarball autoqa-$(VERSION).tar.gz" + @echo " upload Upload source tarball to https://fedorahosted.org/released/autoqa/" @echo @echo "RPM targets:" @echo " srpm [DIST=<val>]" - @echo " Create a srpm ($(SRCRPMDIR)/$(NAME)-$(VERSION)-$(RELEASE)$(DIST).src.rpm)" + @echo " Create a srpm ($(SRCRPMDIR)/autoqa-$(VERSION)-$(RELEASE)$(DIST).src.rpm)" @echo " rpm [DIST=<val>]" - @echo " Create a rpm ($(RPMDIR)/noarch/$(NAME)-$(VERSION)-$(RELEASE)$(DIST).noarch.rpm" + @echo " Create a rpm ($(RPMDIR)/noarch/autoqa-$(VERSION)-$(RELEASE)$(DIST).noarch.rpm" @echo " nvr [DIST=<val>]" @echo " Display '%{name}-%{version}-%{release}' used for packaging" @echo " list-requires " @@ -277,4 +275,4 @@ help: @echo "https://fedoraproject.org/wiki/AutoQA_Release_Process" @echo @echo "For AutoQA bug reports or patch submissions, please use the TRAC" - @echo "instance at https://fedorahosted.org/$(NAME)" + @echo "instance at https://fedorahosted.org/autoqa"
On Tue, 6 Dec 2011 17:57:14 +0100 Kamil Páral kparal@redhat.com wrote:
There's no reason to have another level of inderection for project name, it just makes the spec file more obscure.
Thr use of a variable really doesn't bother me much, was there a reason that it was put in to the Makefile in the first place?
Tim
On Tue, 6 Dec 2011 17:57:14 +0100 Kamil Páral kparal@redhat.com wrote:
There's no reason to have another level of inderection for project name, it just makes the spec file more obscure.
Thr use of a variable really doesn't bother me much, was there a reason that it was put in to the Makefile in the first place?
Tim
It was part of a big Makefile re-do [1]. I decided to revert this particular change, because translating "$(NAME).conf" to "autoqa.conf" all the time when reading the Makefile is annoying and I see no benefit in that. Of course this is not the crucial commit in my patchset - it doesn't have to be accepted and everything will still work.
[1] commit 6de5e3a0ec2d60e050fa3c372ec25e43cc0d3621 Author: James Laska jlaska@redhat.com Date: Wed Jul 6 13:12:59 2011 -0400
Updated Makefile targets for improved package builds/updates
On Wed, 07 Dec 2011 03:52:39 -0500 (EST) Kamil Paral kparal@redhat.com wrote:
On Tue, 6 Dec 2011 17:57:14 +0100 Kamil Páral kparal@redhat.com wrote:
There's no reason to have another level of inderection for project name, it just makes the spec file more obscure.
Thr use of a variable really doesn't bother me much, was there a reason that it was put in to the Makefile in the first place?
Tim
It was part of a big Makefile re-do [1]. I decided to revert this particular change, because translating "$(NAME).conf" to "autoqa.conf" all the time when reading the Makefile is annoying and I see no benefit in that. Of course this is not the crucial commit in my patchset - it doesn't have to be accepted and everything will still work.
K, I don't have any really strong feelings either way. Then again, I don't spend a whole lot of time with the makefile.
Tim
On Tue, 2011-12-06 at 10:20 -0700, Tim Flink wrote:
On Tue, 6 Dec 2011 17:57:14 +0100 Kamil Páral kparal@redhat.com wrote:
There's no reason to have another level of inderection for project name, it just makes the spec file more obscure.
Thr use of a variable really doesn't bother me much, was there a reason that it was put in to the Makefile in the first place?
You can blame Mr. Variable ... me :) Completely arbitrary, I don't see the need for changing the autoqa project name any time soon.
Thanks, James
Development builds are versioned using 'git describe' instead of static numbers extracted from spec file. This allows us to easily build new RPMs from every commit and deploy them to staging server (automatically some day).
Devel builds are created like this: `make mock DEVEL=1` --- Makefile | 86 ++++++++++++++++++++++++++++++++++++------------------------- 1 files changed, 51 insertions(+), 35 deletions(-)
diff --git a/Makefile b/Makefile index 8ddbc62..15cbc17 100644 --- a/Makefile +++ b/Makefile @@ -29,13 +29,11 @@ PYTHON=python # Packaging defaults WORKDIR := $(shell pwd)/build SRCRPMDIR = $(WORKDIR)/SRPMS -## SRCRPMDIR_MD5 = $(WORKDIR)/SRPMS_MD5 BUILDDIR = $(WORKDIR)/BUILD BUILDROOTDIR = $(WORKDIR)/BUILDROOT SOURCEDIR = $(WORKDIR)/SOURCES SPECDIR = $(WORKDIR)/SPECS RPMDIR = $(WORKDIR)/RPMS -## RPMDIR_MD5 = $(WORKDIR)/RPMS_MD5 MOCKDIR = $(WORKDIR)/MOCK RPM_DEFINES = --define "_specdir $(SPECDIR)" \ --define "_sourcedir $(SOURCEDIR)" \ @@ -48,8 +46,16 @@ EL5_DEFINES= --define "_source_filedigest_algorithm 1" \
# Variables used for packaging SPECFILE=autoqa.spec -BASEARCH=$(shell uname -i) -VERSION=$(shell echo `gawk '$$1~/^Version:/{print $$2}' $(SPECFILE)`) +BASEARCH:=$(shell uname -i) +VERSION:=$(shell echo `gawk '$$1~/^Version:/{print $$2}' $(SPECFILE)`) + +# Redefine VERSION if we are doing a development release +DEVEL= +ifneq (,$(DEVEL)) +GIT_DESC:=$(shell git describe --tags) +GIT_DESC:=$(subst -,_,$(GIT_DESC)) +VERSION:=$(VERSION)_devel_$(GIT_DESC) +endif
# If a DIST was provided, use it in all rpm commands ifneq (,$(DIST)) @@ -64,11 +70,6 @@ ifeq (,$(VER_REL)) $(error "Unable to parse $(SPECFILE) using 'rpm --specfile', is rpm-build package installed?") endif
-# Do the Makefile and SPECFILE agree? -ifneq ($(strip $(VERSION)),$(strip $(word 1, $(VER_REL)))) -$(error "VERSION in Makefile does not match VERSION in spec file") -endif - # Determine DIST DIST := $(shell rpm --eval '%{dist}') # Does the DIST provided look sane? @@ -80,9 +81,12 @@ endif RELEASE= $(subst $(DIST),,$(word 2,$(VER_REL)))
# Variables for requirements handling -REQS = $$(grep ^Requires: $(SPECFILE) | cut -d ' ' -f 2-) -BUILD_REQS = $$(grep ^BuildRequires: $(SPECFILE) | cut -d ' ' -f 2-) +REQS := $$(grep ^Requires: $(SPECFILE) | cut -d ' ' -f 2-) +BUILD_REQS := $$(grep ^BuildRequires: $(SPECFILE) | cut -d ' ' -f 2-)
+# +# Build and install +#
.PHONY: all
@@ -146,6 +150,10 @@ build: lib/autoqa/build lib/autoqa/build: ( cd lib/autoqa; $(PYTHON) setup.py build )
+# +# Test +# + test: bash runtests.sh
@@ -153,23 +161,31 @@ test: # Tarball #
-archive: $(SOURCEDIR)/autoqa-$(VERSION).tar.gz +nvr: + @echo autoqa-$(VERSION)-$(RELEASE)$(DIST)
-upload: $(SOURCEDIR)/autoqa-$(VERSION).tar.gz - @scp $(SOURCEDIR)/autoqa-$(VERSION).tar.gz fedorahosted.org:autoqa +# Extra level of indirection to allow for pre-processing (aka variable +# substitution) of the spec file +$(SPECDIR)/$(SPECFILE): $(SPECFILE) + @mkdir -p $(SPECDIR) + @cp $(SPECFILE) $(SPECDIR)/ + # change Version in DEVEL mode + if [ -n "$(DEVEL)" ]; then sed -i 's/^Version:.*/Version: $(VERSION)/' $(SPECDIR)/$(SPECFILE); fi + +archive: $(SOURCEDIR)/autoqa-$(VERSION).tar.gz
$(SOURCEDIR)/autoqa-$(VERSION).tar.gz: $(SPECDIR)/$(SPECFILE) [ -d .git ] # CHECKING TO SEE IF THIS IS A GIT TREE mkdir -p $(SOURCEDIR) git archive HEAD --prefix=autoqa-$(VERSION)/ | gzip -c9 > /$@
+upload: $(SOURCEDIR)/autoqa-$(VERSION).tar.gz + @scp $(SOURCEDIR)/autoqa-$(VERSION).tar.gz fedorahosted.org:autoqa + # -# BUILD RPMS either with or without the EL5_DEFINES (EPEL-5) +# List or install (build) requirements #
-nvr: - @echo autoqa-$(VERSION)-$(RELEASE)$(DIST) - list-requires: @echo "$(REQS)"
@@ -182,11 +198,9 @@ install-requires: install-buildrequires: (IFS=$$'\n'; yum install $$(echo "$(BUILD_REQS)"))
-# Extra level of indirection to allow for pre-processing (aka variable -# substitution) of the spec file -$(SPECDIR)/$(SPECFILE): $(SPECFILE) - @mkdir -p $(SPECDIR) - @cp $(SPECFILE) $(SPECDIR)/ +# +# Build RPMS +#
$(SRCRPMDIR)/autoqa-$(VERSION)-$(RELEASE).fc%.src.rpm: $(SPECDIR)/$(SPECFILE) $(SOURCEDIR)/autoqa-$(VERSION).tar.gz mkdir -p $(SRCRPMDIR) $(BUILDDIR) $(RPMDIR) @@ -207,8 +221,6 @@ $(RPMDIR)/noarch/autoqa-$(VERSION)-$(RELEASE).el%.noarch.rpm: $(SPECDIR)/$(SPECF srpm: $(SRCRPMDIR)/autoqa-$(VERSION)-$(RELEASE)$(DIST).src.rpm rpm: $(RPMDIR)/noarch/autoqa-$(VERSION)-$(RELEASE)$(DIST).noarch.rpm
-srpm.el5: $(SRCRPMDIR)/autoqa-$(VERSION)-$(RELEASE).el5.src.rpm -rpm.el5: $(RPMDIR)/noarch/autoqa-$(VERSION)-$(RELEASE).el5.noarch.rpm srpm.el6: $(SRCRPMDIR)/autoqa-$(VERSION)-$(RELEASE).el6.src.rpm rpm.el6: $(RPMDIR)/noarch/autoqa-$(VERSION)-$(RELEASE).el6.noarch.rpm
@@ -232,12 +244,13 @@ $(MOCKDIR)/$(RELEASEVER)-$(BASEARCH): $(SRCRPMDIR)/autoqa-$(VERSION)-$(RELEASE)$
mock: $(MOCKDIR)/$(RELEASEVER)-$(BASEARCH)
-mock.el5: - $(MAKE) DIST=.el5 mock - mock.el6: $(MAKE) DIST=.el6 mock
+# +# Help +# + help: @echo "Usage: make <target>" @echo @@ -251,11 +264,15 @@ help: @echo " upload Upload source tarball to https://fedorahosted.org/released/autoqa/" @echo @echo "RPM targets:" - @echo " srpm [DIST=<val>]" + @echo " srpm [DIST=<val>] [DEVEL=1]" @echo " Create a srpm ($(SRCRPMDIR)/autoqa-$(VERSION)-$(RELEASE)$(DIST).src.rpm)" - @echo " rpm [DIST=<val>]" - @echo " Create a rpm ($(RPMDIR)/noarch/autoqa-$(VERSION)-$(RELEASE)$(DIST).noarch.rpm" - @echo " nvr [DIST=<val>]" + @echo " DIST values are described at https://fedoraproject.org/wiki/Packaging:DistTag" + @echo " (defaults to current system)" + @echo " DEVEL=1 uses a development versioning scheme instead of" + @echo " extracting version from $(SPECFILE)" + @echo " rpm [DIST=<val>] [DEVEL=1]" + @echo " Create a rpm ($(RPMDIR)/noarch/autoqa-$(VERSION)-$(RELEASE)$(DIST).noarch.rpm)" + @echo " nvr [DIST=<val>] [DEVEL=1]" @echo " Display '%{name}-%{version}-%{release}' used for packaging" @echo " list-requires " @echo " List package requirements listed in $(SPECFILE)" @@ -267,9 +284,8 @@ help: @echo " Install package build dependencies listed in $(SPECFILE)" @echo @echo "MOCK build targets:" - @echo " mock [DIST=<val>]" - @echo " Build packages inside a mock chroot for the" - @echo " specified DIST (defaults to current system)" + @echo " mock [DIST=<val>] [DEVEL=1]" + @echo " Build packages inside a mock chroot for the specified DIST" @echo @echo "For guidance on building and releasing AutoQA, consult" @echo "https://fedoraproject.org/wiki/AutoQA_Release_Process"
--- autoqa.spec | 18 ------------------ 1 files changed, 0 insertions(+), 18 deletions(-)
diff --git a/autoqa.spec b/autoqa.spec index 1bb0b06..9308b0a 100644 --- a/autoqa.spec +++ b/autoqa.spec @@ -103,15 +103,6 @@ rm -rf $RPM_BUILD_ROOT * Tue Nov 29 2011 Kamil Paral kparal@redhat.com - 0.7.0-1 - Release of autoqa-0.7.0
-* Wed Nov 23 2011 Tim Flink tflink@redhat.com - 0.7.0-0.3.pre - - Updated to use new python-yourls and more fine grained error handling - -* Wed Nov 16 2011 Tim Flink tflink@redhat.com - 0.7.0-0.2.pre - - Added logrotate.d configuration and log file declarations - -* Fri Nov 11 2011 Tim Flink tflink@redhat.com - 0.7.0-0.1.pre - - Updated for pre-release testing of 0.7.0 - * Thu Aug 11 2011 Kamil Paral kparal@redhat.com - 0.6.1-1 - Release of autoqa-0.6.1
@@ -124,15 +115,6 @@ rm -rf $RPM_BUILD_ROOT * Thu Jun 27 2011 James Laska jlaska@redhat.com - 0.5.0-1 - Release of autoqa-0.5.0
-* Thu Jun 23 2011 James Laska jlaska@redhat.com - 0.5.0-0.3.pre - - Pre-release of 0.5.0 - -* Mon Jun 13 2011 James Laska jlaska@redhat.com - 0.5.0-0.2.pre - - Pre-release of 0.5.0 - -* Fri Jun 10 2011 James Laska jlaska@redhat.com - 0.5.0-0.1.pre - - Pre-release of 0.5.0 - * Thu Apr 28 2011 James Laska jlaska@redhat.com - 0.4.7-1 - Release of autoqa-0.4.7
On Tue, 6 Dec 2011 17:57:13 +0100 Kamil Páral kparal@redhat.com wrote:
This is a series of 3 patches. Please view them at origin/stage_build or here.I did not use RB because it can't do patch series and the changes would be confusing if combined into a single patch.
We already stumbled onto a problem that we need to update spec file every time we want to update staging environment. That's really bad, ideally we want to update after every major commit (like my yesterday's patch). I have modified Makefile (I officially announce that I hate the syntax) to allow us to create development autoqa builds without modifying spec file. You just execute:
make archive DEVEL=1 or make srpm DEVEL=1 pr make mock DEVEL=1
and here we go. The rpm file then looks like this 'autoqa-0.7.1_devel_v0.5.0_1_63_g5a41715-1.fc16.noarch.rpm'. Pretty long, but its an ascending sequence, which suffices. This can be built directly on stage server and then installed. No need to change the spec file, no need to commit it to git. Voila.
Nice, that has been a pain to deal with for a while now. I like being able to build RPMs easily without committing spec and code changes first.
I'm fine with the patch and welcome the new functionality.
Tim
This is a series of 3 patches. Please view them at origin/stage_build or here.I did not use RB because it can't do patch series and the changes would be confusing if combined into a single patch.
We already stumbled onto a problem that we need to update spec file every time we want to update staging environment. That's really bad, ideally we want to update after every major commit (like my yesterday's patch). I have modified Makefile (I officially announce that I hate the syntax) to allow us to create development autoqa builds without modifying spec file. You just execute:
make archive DEVEL=1 or make srpm DEVEL=1 pr make mock DEVEL=1
and here we go. The rpm file then looks like this 'autoqa-0.7.1_devel_v0.5.0_1_63_g5a41715-1.fc16.noarch.rpm'. Pretty long, but its an ascending sequence, which suffices. This can be built directly on stage server and then installed. No need to change the spec file, no need to commit it to git. Voila.
Kamil Páral (3): autoqa.spec: replace $(NAME) with 'autoqa' Makefile: allow creating DEVEL builds autoqa.spec: remove pre-release statements in changelog
Makefile | 172 ++++++++++++++++++++++++++++++++--------------------------- autoqa.spec | 18 ------ 2 files changed, 93 insertions(+), 97 deletions(-)
Pushed to master. I also adjusted our documentation:
https://fedoraproject.org/wiki/AutoQA_Release_Process#Testing_release
autoqa-devel@lists.fedorahosted.org