5 |
# Copyright (C) 2004-2005 Red Hat, Inc. |
# Copyright (C) 2004-2005 Red Hat, Inc. |
6 |
# Copyright (C) 2005 Fedora Foundation |
# Copyright (C) 2005 Fedora Foundation |
7 |
# |
# |
8 |
# $Id: Makefile.common,v 1.4 2007/11/02 22:32:27 slords Exp $ |
# $Id: Makefile.common,v 1.2 2008/03/12 04:42:45 slords Exp $ |
9 |
|
|
10 |
# Define the common dir. |
# Define the common dir. |
11 |
# This needs to happen first. |
# This needs to happen first. |
25 |
DIST = $(word 2, $(BRANCHINFO)) |
DIST = $(word 2, $(BRANCHINFO)) |
26 |
DISTVAR = $(word 3, $(BRANCHINFO)) |
DISTVAR = $(word 3, $(BRANCHINFO)) |
27 |
DISTVAL = $(word 4, $(BRANCHINFO)) |
DISTVAL = $(word 4, $(BRANCHINFO)) |
28 |
DIST_DEFINES = --define "dist $(DIST)" --define "$(DISTVAR) $(DISTVAL)" |
SMEVAL = $(word 5, $(BRANCHINFO)) |
29 |
|
DIST_DEFINES = --define "dist $(DIST)" --define "$(DISTVAR) $(DISTVAL)" --define "sme $(SMEVAL)" |
|
BUILD_FLAGS ?= $(shell echo $(KOJI_FLAGS)) |
|
30 |
|
|
31 |
## a base directory where we'll put as much temporary working stuff as we can |
## a base directory where we'll put as much temporary working stuff as we can |
32 |
ifndef WORKDIR |
ifndef WORKDIR |
40 |
BUILDDIR ?= $(WORKDIR) |
BUILDDIR ?= $(WORKDIR) |
41 |
RPMDIR ?= $(WORKDIR) |
RPMDIR ?= $(WORKDIR) |
42 |
MOCKDIR ?= $(WORKDIR) |
MOCKDIR ?= $(WORKDIR) |
43 |
ifeq ($(DISTVAR),epel) |
MOCKCFG ?= smeserver-$(SMEVAL)-$(BUILDARCH)-contribs |
|
DISTVAR := rhel |
|
|
MOCKCFG ?= fedora-$(DISTVAL)-$(BUILDARCH)-epel.cfg |
|
|
else |
|
|
MOCKCFG ?= fedora-$(DISTVAL)-$(BUILDARCH)-core.cfg |
|
|
endif |
|
44 |
## SOURCEDIR is special; it has to match the CVS checkout directory, |
## SOURCEDIR is special; it has to match the CVS checkout directory, |
45 |
## because the CVS checkout directory contains the patch files. So it basically |
## because the CVS checkout directory contains the patch files. So it basically |
46 |
## can't be overridden without breaking things. But we leave it a variable |
## can't be overridden without breaking things. But we leave it a variable |
76 |
# default target: just make sure we've got the sources |
# default target: just make sure we've got the sources |
77 |
all: sources |
all: sources |
78 |
|
|
|
# user specific configuration |
|
|
CVS_EXTRAS_RC := $(shell if test -f $(HOME)/.cvspkgsrc ; then echo $(HOME)/.cvspkgsrc ; fi) |
|
|
ifdef CVS_EXTRAS_RC |
|
|
include $(CVS_EXTRAS_RC) |
|
|
endif |
|
|
|
|
79 |
# The repository and the clients we use for the files |
# The repository and the clients we use for the files |
80 |
REPOSITORY ?= http://lordsfam.net/yum/builds/source |
REPOSITORY ?= http://lordsfam.net/yum/builds/source |
81 |
UPLOAD_REPOSITORY ?= /builds/source |
UPLOAD_REPOSITORY ?= /builds/source |
86 |
WGET ?= $(shell if test -f /usr/bin/wget ; then echo "wget -nd -m" ; fi) |
WGET ?= $(shell if test -f /usr/bin/wget ; then echo "wget -nd -m" ; fi) |
87 |
CLIENT ?= $(if $(CURL),$(CURL),$(if $(WGET),$(WGET))) |
CLIENT ?= $(if $(CURL),$(CURL),$(if $(WGET),$(WGET))) |
88 |
PLAGUE_CLIENT ?= $(shell which plague-client 2>/dev/null) |
PLAGUE_CLIENT ?= $(shell which plague-client 2>/dev/null) |
|
BUILD_CLIENT ?= $(shell which koji 2>/dev/null) |
|
89 |
|
|
90 |
# RPM with all the overrides in place; you can override this in your |
# RPM with all the overrides in place |
|
# .cvspkgsrc also, to use a default rpm setup |
|
|
# the rpm build command line |
|
91 |
ifndef RPM |
ifndef RPM |
92 |
RPM := $(shell if test -f /usr/bin/rpmbuild ; then echo rpmbuild ; else echo rpm ; fi) |
RPM := $(shell if test -f /usr/bin/rpmbuild ; then echo rpmbuild ; else echo rpm ; fi) |
93 |
endif |
endif |
118 |
endef |
endef |
119 |
|
|
120 |
# list the possible targets for valid arches |
# list the possible targets for valid arches |
121 |
ARCHES = noarch i386 i586 i686 x86_64 ia64 s390 s390x ppc ppc64 pseries ppc64pseries iseries ppc64iseries # athlon alpha alphaev6 sparc sparc64 sparcv9 i164 mac sh mips |
ARCHES = noarch i386 i586 i686 x86_64 # ia64 s390 s390x ppc ppc64 pseries ppc64pseries iseries ppc64iseries athlon alpha alphaev6 sparc sparc64 sparcv9 i164 mac sh mips |
122 |
|
|
123 |
# for the modules that do different "make prep" depending on what arch we build for |
# for the modules that do different "make prep" depending on what arch we build for |
124 |
PREP_ARCHES = $(addprefix prep-,$(ARCHES)) |
PREP_ARCHES = $(addprefix prep-,$(ARCHES)) |
125 |
|
|
126 |
## list all our bogus targets |
## list all our bogus targets |
127 |
.PHONY :: $(ARCHES) sources uploadsource upload export check build-check plague koji build test-srpm srpm tag force-tag verrel new clean patch prep compile install-short compile-short FORCE local |
.PHONY :: $(ARCHES) commit sources uploadsource upload export check build-check plague build test-srpm srpm tag force-tag verrel new clean patch prep compile install-short compile-short FORCE local |
128 |
|
|
129 |
# The TARGETS define is meant for local module targets that should be |
# The TARGETS define is meant for local module targets that should be |
130 |
# made in addition to the SOURCEFILES whenever needed |
# made in addition to the SOURCEFILES whenever needed |
319 |
@if [ ! -x "$(PLAGUE_CLIENT)" ]; then echo "Must have plague-client installed - see http://fedoraproject.org/wiki/Extras/BuildSystemClientSetup"; exit 1; fi |
@if [ ! -x "$(PLAGUE_CLIENT)" ]; then echo "Must have plague-client installed - see http://fedoraproject.org/wiki/Extras/BuildSystemClientSetup"; exit 1; fi |
320 |
@$(PLAGUE_CLIENT) build $(NAME) $(TAG) $(TARGET) |
@$(PLAGUE_CLIENT) build $(NAME) $(TAG) $(TARGET) |
321 |
|
|
|
koji: build-check $(COMMON_DIR)/branches |
|
|
@if [ ! -x "$(BUILD_CLIENT)" ]; then echo "Must have koji installed - see http://fedoraproject.org/wiki/BuildSystemClientSetup"; exit 1; fi |
|
|
@$(BUILD_CLIENT) build $(BUILD_FLAGS) $(TARGET) 'cvs://smecontribs.cvs.sourceforge.net/cvsroot/smecontribs?$(CVS_REPOSITORY)#$(TAG)' |
|
|
|
|
322 |
build: plague |
build: plague |
323 |
|
|
324 |
# "make new | less" to see what has changed since the last tag was assigned |
# "make new | less" to see what has changed since the last tag was assigned |
379 |
clog: $(SPECFILE) |
clog: $(SPECFILE) |
380 |
@sed -n '/^%changelog/,/^$$/{/^%/d;/^$$/d;s/%%/%/g;p}' $(SPECFILE) | tee $@ |
@sed -n '/^%changelog/,/^$$/{/^%/d;/^$$/d;s/%%/%/g;p}' $(SPECFILE) | tee $@ |
381 |
|
|
382 |
|
commit: clog |
383 |
|
@cvs commit -F $? |
384 |
|
|
385 |
help: |
help: |
386 |
@echo "Usage: make <target>" |
@echo "Usage: make <target>" |
387 |
@echo "Available targets are:" |
@echo "Available targets are:" |
404 |
@echo " verrel Echo \"$(NAME)-$(VERSION)-$(RELEASE)\"" |
@echo " verrel Echo \"$(NAME)-$(VERSION)-$(RELEASE)\"" |
405 |
@echo " new Diff against last tag" |
@echo " new Diff against last tag" |
406 |
@echo " clog Make a clog file containing top changelog entry" |
@echo " clog Make a clog file containing top changelog entry" |
407 |
|
@echo " commit Commit to CVS using the clog file as the log message" |
408 |
@echo " clean Remove srcs ($(SOURCEFILES)), export dir (cvs-$(TAG)) and srpm ($(NAME)-$(VERSION)-$(RELEASE).src.rpm)" |
@echo " clean Remove srcs ($(SOURCEFILES)), export dir (cvs-$(TAG)) and srpm ($(NAME)-$(VERSION)-$(RELEASE).src.rpm)" |
409 |
@echo " patch SUFFIX=<suff> Create and add a gendiff patch file" |
@echo " patch SUFFIX=<suff> Create and add a gendiff patch file" |
410 |
@echo " rediff SUFFIX=<suff> Recreates a gendiff patch file, retaining comments" |
@echo " rediff SUFFIX=<suff> Recreates a gendiff patch file, retaining comments" |