aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrisztian Litkey <krisztian.litkey@nokia.com>2010-12-07 21:36:15 +0200
committerKrisztian Litkey <krisztian.litkey@nokia.com>2010-12-07 21:36:15 +0200
commit1e5b0a1cc7be546d839d9bfbe927f1e7b71a46a3 (patch)
treea6da58ce91f7474461b1ff2fc06a327090546779
parent7f5eaf98a4f11e58ab867a6fb8527ef0e7bcac0f (diff)
Meego packaging updates.meego
-rw-r--r--meego/Makefile71
-rw-r--r--meego/libresource.spec.in3
2 files changed, 54 insertions, 20 deletions
diff --git a/meego/Makefile b/meego/Makefile
index 095789a..3d617ba 100644
--- a/meego/Makefile
+++ b/meego/Makefile
@@ -2,29 +2,43 @@ PACKAGE := libresource
VERSION := 0.1.0
THISDIR := meego
-TOPDIR := $(shell while [ ! -d $(THISDIR) -a "`pwd`" != "/" ]; do cd ..; done;\
- [ -d $(THISDIR) ] && pwd || exit 1)
+TOPDIR := $(shell \
+ while [ ! -d $(THISDIR) -a "`pwd`" != "/" ]; do \
+ cd ..; \
+ done; \
+ [ -d $(THISDIR) ] && pwd || exit 1))
-ARCH := i386
-RPM := $(PACKAGE)-$(VERSION).$(ARCH).rpm
-SPECFILE := $(TOPDIR)/$(THISDIR)/$(PACKAGE).spec
-TARBALL := $(TOPDIR)/$(THISDIR)/$(PACKAGE)-$(VERSION).tar.gz
-TARDIR := $(notdir $(TOPDIR))
+ARCH = $(shell rpm -q --queryformat "%{ARCH}\n" rpm)
+SPECFILE := $(PACKAGE).spec
+PREFIX := $(PACKAGE)-$(VERSION)
+TARBALL := $(PREFIX).tar.gz
+TARNONGZ := $(PREFIX).tar
-STAMP := $(shell date +%Y-%m-%d-%H%M%S)
-TMPDIR := /tmp/$(PACKAGE)-$(USER)/$(STAMP)
+STAMP := $(shell date +%Y-%m-%d-%H%M%S)
+TMPDIR := /tmp/$(PACKAGE)-$(USER)/$(STAMP)
+PKGDIR := $(PACKAGE)-$(VERSION)
+# tarball type to use (git = HEAD, current = working copy)
+type = git
all: rpms cleanup
+showvar:
+ @echo "$(var) = $($(var))"
+
# rule to build RPM(s) for this package
-rpms: rmtar $(SPECFILE) $(TARBALL)
- mkdir -p $(TMPDIR)/{BUILD,RPMS,SOURCES,SPECS} && \
+rpms: rmtar $(SPECFILE) tarball
+ mkdir -p $(TMPDIR)/{BUILD,RPMS,SRPMS,SOURCES,SPECS} && \
cp $(SPECFILE) $(TMPDIR)/SPECS && \
cp $(TARBALL) $(TMPDIR)/SOURCES && \
rpmbuild --define '_topdir $(TMPDIR)' \
-bb $(TMPDIR)/SPECS/$(PACKAGE).spec && \
- cp $(TMPDIR)/RPMS/$(ARCH)/*.rpm $(TOPDIR)/$(THISDIR)
+ rpmbuild --define '_topdir $(TMPDIR)' \
+ -bs $(TMPDIR)/SPECS/$(PACKAGE).spec && \
+ cp $(TMPDIR)/RPMS/*/*.rpm $(THISDIR)/.
+ cp $(TMPDIR)/SRPMS/*.rpm $(THISDIR)/.
+
+obs: tarball $(SPECFILE)
cleanup:
rm -fr $(TMPDIR) && \
@@ -38,14 +52,33 @@ $(SPECFILE): $(SPECFILE).in
sed 's/##__ARCH__##/$(ARCH)/g' \
> $@
-$(TARBALL):
- pushd $(TOPDIR) && make distclean || : && ./autogen.sh && popd && \
- pushd $(TOPDIR)/.. && \
- tar -cvzf /tmp/$(notdir $@) \
- --exclude '.*/$(THISDIR)/.*.tar.gz' $(notdir $(TARDIR)) && \
- mv /tmp/$(notdir $@) $@
+tarball: $(type)-tarball
+
+git-tarball:
+ pushd .. && \
+ git archive --format=tar --prefix=$(PACKAGE)-$(VERSION)/ HEAD \
+ > $(THISDIR)/$(TARNONGZ) && \
+ ./build-aux/git-version-gen .tarball-version \
+ > $(THISDIR)/version && \
+ popd && \
+ rm -fr $(PREFIX) && mkdir -p $(PREFIX) && \
+ cp version $(PREFIX)/.tarball-version && \
+ tar -rvf $(TARNONGZ) $(PREFIX)/.tarball-version && \
+ rm -fr $(PREFIX) && \
+ rm -f $(TARBALL) && \
+ gzip -9 $(TARNONGZ) && \
+ rm -f version
+
+current-tarball:
+ cd .. && make distclean || : && ./autogen.sh
+ cd .. && mkdir -p $(TMPDIR)/$(PKGDIR) && \
+ tar -cvf - --exclude '$(THISDIR)' \
+ --exclude '.git' . | \
+ tar -C $(TMPDIR)/$(PKGDIR) -xvf - && \
+ tar -C $(TMPDIR) -cvzf $(THISDIR)/$(TARBALL) $(PKGDIR) && \
+ rm -fr $(TMPDIR)
-meego-export: $(SPECFILE) $(TARBALL)
+rpm-export: $(SPECFILE) $(TARBALL)
rmtar:
rm -f $(TARBALL)
diff --git a/meego/libresource.spec.in b/meego/libresource.spec.in
index 7f7922c..4133da7 100644
--- a/meego/libresource.spec.in
+++ b/meego/libresource.spec.in
@@ -31,9 +31,10 @@ Resource management for MeeGo. Resource policy client library (development files
Resource management for MeeGo. This is a simple test tool to play with resource management.
%prep
-%setup -q -n ##__TARDIR__##
+%setup -q
%build
+./autogen.sh
%configure --disable-static
make