gunnar: server/make-helper fetch.mk, NONE, 1.1 openpkg-patched.mk, 1.5, 1.6 package-new.mk, 1.3, 1.4 package.mk, 1.8, 1.9 pear.mk, 1.3, 1.4
cvs at kolab.org
cvs at kolab.org
Sun Jan 17 14:03:50 CET 2010
Author: gunnar
Update of /kolabrepository/server/make-helper
In directory doto:/tmp/cvs-serv1702
Modified Files:
openpkg-patched.mk package-new.mk package.mk pear.mk
Added Files:
fetch.mk
Log Message:
Added a fetch target to download the required sources for building. Can be used to check for the availability of all sources or for downloading before unplugging the network. Additionally some minor fixes to serveral build targets to avoid duplicating work.
--- NEW FILE: fetch.mk ---
# The targets we need to download
FETCH_TARGETS = $(FETCH_SOURCE) $(FETCH_RPM)
#Fetch target
.PHONY: fetch
fetch: $(FETCH_TARGETS)
Index: openpkg-patched.mk
===================================================================
RCS file: /kolabrepository/server/make-helper/openpkg-patched.mk,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- openpkg-patched.mk 11 Jan 2010 15:52:45 -0000 1.5
+++ openpkg-patched.mk 17 Jan 2010 13:03:48 -0000 1.6
@@ -2,17 +2,27 @@
$(KOLABRPMSRC)/$(PACKAGE)/kolab.patch: $(EXTRA)
cp $(EXTRA) $(KOLABRPMSRC)/$(PACKAGE)
+FETCH_RPM = fetch-rpm
+
+# Shortcut for fetching the source rpm package
+.PHONY:fetch-rpm
+fetch-rpm: $(PACKAGE)-$(DOWNLOAD_VERSION)-$(OPENPKG_RELEASE).src.rpm
+
# Target for fetching the original openpkg package
$(PACKAGE)-$(DOWNLOAD_VERSION)-$(OPENPKG_RELEASE).src.rpm:
wget -c $(OPENPKGURI)/$(PACKAGE)-$(DOWNLOAD_VERSION)-$(OPENPKG_RELEASE).src.rpm
-# Target for the src rpm directory.
-$(KOLABRPMSRC)/$(PACKAGE): $(PACKAGE)-$(DOWNLOAD_VERSION)-$(OPENPKG_RELEASE).src.rpm
+# Target for the src rpm directory. The actual target is a .dir file
+# as the directory modification time will show the timepoint of the
+# last modified file in the directory. This would lead to remaking
+# some targets every time.
+$(KOLABRPMSRC)/$(PACKAGE)/.dir: $(PACKAGE)-$(DOWNLOAD_VERSION)-$(OPENPKG_RELEASE).src.rpm
$(RPM) -ihv $(PACKAGE)-$(DOWNLOAD_VERSION)-$(OPENPKG_RELEASE).src.rpm
touch $(KOLABRPMSRC)/$(PACKAGE)/$(PACKAGE).spec
+ touch $(KOLABRPMSRC)/$(PACKAGE)/.dir
# Target for the src rpm spec file.
-$(KOLABRPMSRC)/$(PACKAGE)/$(PACKAGE).spec: $(KOLABRPMSRC)/$(PACKAGE)
+$(KOLABRPMSRC)/$(PACKAGE)/$(PACKAGE).spec: $(KOLABRPMSRC)/$(PACKAGE)/.dir
# Target for patching the spec file
$(KOLABRPMSRC)/$(PACKAGE)/$(PACKAGE).spec.patched: $(KOLABRPMSRC)/$(PACKAGE)/$(PACKAGE).spec $(KOLABRPMSRC)/$(PACKAGE)/kolab.patch
Index: package-new.mk
===================================================================
RCS file: /kolabrepository/server/make-helper/package-new.mk,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- package-new.mk 11 Jan 2010 16:52:43 -0000 1.3
+++ package-new.mk 17 Jan 2010 13:03:48 -0000 1.4
@@ -1,17 +1,23 @@
EXTRA ?=
-# Target for the src rpm directory.
-$(KOLABRPMSRC)/$(PACKAGE):
+# Target for the src rpm directory. The actual target is a .dir file
+# as the directory modification time will show the timepoint of the
+# last modified file in the directory. This would lead to remaking
+# some targets every time.
+$(KOLABRPMSRC)/$(PACKAGE)/.dir:
mkdir -p $(KOLABRPMSRC)/$(PACKAGE)
+ touch $(KOLABRPMSRC)/$(PACKAGE)/.dir
# Target for the src rpm spec file.
-$(KOLABRPMSRC)/$(PACKAGE)/$(PACKAGE).spec: $(KOLABRPMSRC)/$(PACKAGE) $(PACKAGE).spec $(EXTRA)
+$(KOLABRPMSRC)/$(PACKAGE)/$(PACKAGE).spec: $(KOLABRPMSRC)/$(PACKAGE)/.dir $(PACKAGE).spec $(EXTRA)
cp $(PACKAGE).spec $(EXTRA) $(KOLABRPMSRC)/$(PACKAGE)
+RPM_SOURCES ?= $(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_0)
+
# Target for building the source package
-$(KOLABRPMPKG)/$(RELEASETARGET): $(KOLABRPMSRC)/$(PACKAGE)/$(PACKAGE).spec $(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_0)
+$(KOLABRPMPKG)/$(RELEASETARGET): $(KOLABRPMSRC)/$(PACKAGE)/$(PACKAGE).spec $(RPM_SOURCES)
cd $(KOLABRPMSRC)/$(PACKAGE) && $(RPM) -bs $(PACKAGE).spec
# Target for building the binary package
-$(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm: $(KOLABRPMSRC)/$(PACKAGE)/$(PACKAGE).spec $(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_0)
+$(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm: $(KOLABRPMSRC)/$(PACKAGE)/$(PACKAGE).spec $(RPM_SOURCES)
cd $(KOLABRPMSRC)/$(PACKAGE) && $(RPM) -ba $(PACKAGE).spec $(BUILD_OPTIONS)
Index: package.mk
===================================================================
RCS file: /kolabrepository/server/make-helper/package.mk,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- package.mk 11 Jan 2010 22:35:51 -0000 1.8
+++ package.mk 17 Jan 2010 13:03:48 -0000 1.9
@@ -54,10 +54,19 @@
cp $(KOLABRPMPKG)/$(RELEASETARGET) .
ifeq ($(SOURCE_0),)
+FETCH_SOURCE =
else
+SOURCES ?= $(SOURCE_0)
+
# Target for the source file in the src rpm directory.
$(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_0): $(KOLABRPMSRC)/$(PACKAGE) $(SOURCE_0)
cp $(SOURCE_0) $(KOLABRPMSRC)/$(PACKAGE)/
+
+FETCH_SOURCE = fetch-source
+
+# Shortcut for fetching the source archive
+.PHONY: fetch-source
+fetch-source: $(SOURCES)
# Target for retrieving the source package
$(SOURCE_0):
Index: pear.mk
===================================================================
RCS file: /kolabrepository/server/make-helper/pear.mk,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- pear.mk 12 Jan 2010 13:56:32 -0000 1.3
+++ pear.mk 17 Jan 2010 13:03:48 -0000 1.4
@@ -123,6 +123,7 @@
CLEAN_EXTRA = tmp $(PACKAGE).spec
include ../../make-helper/package.mk
+include ../../make-helper/fetch.mk
# Target location for the repository checkout
$(UPSTREAM)/$(SAFE_COMMIT):
@@ -175,7 +176,7 @@
endif
ifneq ($(PACKAGE_VC),)
-# Short name for the source package as a target for the command line.
+# Package the source
tmp/$(SOURCE_0): tmp/$(PACKAGE)
sed -i -e "/version/,+1 s#<release>\(.*\)</release>#<release>\1dev$(RELTAG)</release>#" tmp/$(PACKAGE)/package.xml
sed -i -e "/lead/,+1 s#<date>.*</date>#<date>$(DATE)</date>#" tmp/$(PACKAGE)/package.xml
@@ -190,11 +191,12 @@
endif
cd tmp && $(PEAR) package $(PACKAGE)/package.xml
-# Short name for the source package as a target for the command line.
+# Indicator to avoid uploading the same package twice.
tmp/.sent: tmp/$(SOURCE_0)
echo "put tmp/$(SOURCE_0)" | sftp $(FILESERVER)
touch tmp/.sent
+# Short name for uploading the snapshot.
.PHONY:snapshot
snapshot: tmp/.sent
endif
@@ -207,9 +209,9 @@
cat $$PATCH >> package.patch; \
done
-$(PACKAGE).spec: ../pear.spec.template package.info
+$(PACKAGE).spec: ../../pear/pear.spec.template package.info
source package.info && \
- cat ../pear.spec.template | \
+ cat ../../pear/pear.spec.template | \
sed -e "s#[@]pear_pkgdir[@]#$${pear_pkgdir}#g" \
-e "s#[@]pear_package[@]#$${pear_package}#g" \
-e "s#[@]package[@]#$${package}#g" \
More information about the commits
mailing list