summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2009-01-07 15:16:29 +0100
committerHans Ulrich Niedermann <hun@n-dimensional.de>2009-01-07 15:16:29 +0100
commitf6a78f38730e49fffacdc8268690d5a864df84e0 (patch)
tree5a119cd9205ae626b8f17608e98abb263d015e21
downloadphoronix-test-suite-package-f6a78f38730e49fffacdc8268690d5a864df84e0.zip
phoronix-test-suite-package-f6a78f38730e49fffacdc8268690d5a864df84e0.tar.gz
phoronix-test-suite-package-f6a78f38730e49fffacdc8268690d5a864df84e0.tar.xz
Initial commit
-rw-r--r--GNUmakefile2
-rw-r--r--git-rpm.mk170
-rw-r--r--phoronix-test-suite-1.4.2.tar.gzbin0 -> 317933 bytes
-rw-r--r--phoronix-test-suite.spec44
4 files changed, 216 insertions, 0 deletions
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 0000000..7dca9a7
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,2 @@
+NAME := phoronix-test-suite
+include git-rpm.mk
diff --git a/git-rpm.mk b/git-rpm.mk
new file mode 100644
index 0000000..760d239
--- /dev/null
+++ b/git-rpm.mk
@@ -0,0 +1,170 @@
+# How to use this file:
+# 0. run "git init"
+# 1. copy this file as git-rpm.mk
+# 2. create GNUmakefile with contents like
+# NAME = mypkg
+# include git-rpm.mk
+# 3. run "make mkdir" to created the upload directory on the web server
+# 4. write mypkg.spec, patches, Source: files, etc.
+# 5. run "make" for a test build of the rpm files
+# 6. if you do not like the result, go to 4
+# 7. make sure NVR and %changelog are updated
+# 8. Make sure you have "git commit"ed all your changes before
+# 9. run "make tag" tag the current release
+# 10. run "make upload" to upload the built rpm files to your webspace
+#
+# Settings best defined in ~/.git-rpm-settings.mk, but with potentially
+# useful defaults:
+# 1. RSYNC_USER and RSYNC_HOST or RSYNC_USHO
+# 2. RSYNC_ROOT
+#
+# Benefits:
+# 1. Reproducible local rpm builds:
+# $ make
+# 2. Automatic generation of text reports (rpmlint, rpm content list):
+# $ make check
+# 3. Easy versioning of NVRs using git tags
+# $ make tag
+# 4. Easy upload via rsync/ssh to NVR specific places, nice for package review
+# $ make upload
+
+RPMDIRS = rpm-build rpm-dist
+UPLOAD_FILES =
+
+OPTS =
+OPTS += --define "_sourcedir $${PWD}"
+OPTS += --define "_builddir $${PWD}/rpm-build"
+OPTS += --define "_srcrpmdir $${PWD}/rpm-dist" --define "_rpmdir $${PWD}/rpm-dist"
+
+NAME ?= packagename-to-be-defined
+
+SPEC = $(NAME).spec
+
+RPM_VERSION := $(shell rpm -q --specfile $(SPEC) --queryformat '%{VERSION}\n' | sed '1q')
+RPM_RELEASE := $(shell rpm -q --specfile $(SPEC) --queryformat '%{RELEASE}\n' | sed '1q')
+RPM_ARCH := $(shell rpm -q --specfile $(SPEC) --queryformat '%{ARCH}\n' | sed '1q')
+
+NVR = $(NAME)-$(RPM_VERSION)-$(RPM_RELEASE)
+
+SRPM = rpm-dist/$(NVR).src.rpm
+BRPM = rpm-dist/$(RPM_ARCH)/$(NVR).$(RPM_ARCH).rpm
+
+-include $(HOME)/.git-rpm-settings.mk
+RSYNC_USER ?= $(USER)
+RSYNC_HOST ?= fedorapeople.org
+RSYNC_USHO ?= $(RSYNC_USER)@$(RSYNC_HOST)
+RSYNC_ROOT ?= public_html/packages
+RSYNC_DIR = $(RSYNC_ROOT)/$(NAME)/$(RPM_VERSION)-$(RPM_RELEASE)
+
+SOURCE_FILES = $(shell spectool --lf $(SPEC) | cut -d' ' -f2 | xargs -l basename)
+
+.PHONY: all
+all: rpm check
+
+.PHONY: srpm
+srpm: $(SRPM)
+
+clog: $(SPEC)
+ rpm -q --specfile $(SPEC) --changelog | sed '1n; /^\*/,$$d' > $@
+ cat $@
+
+UPLOAD_FILES += $(NVR)/$(NVR).src.rpm
+$(SRPM): $(SPEC) $(SOURCE_FILES)
+ mkdir -p $(RPMDIRS)
+ rpmbuild $(OPTS) -bs $(SPEC)
+$(NVR)/$(NVR).src.rpm: $(SRPM)
+ mkdir -p $(NVR)
+ cp -p $< $@
+
+.PHONY: rpm
+rpm: $(BRPM)
+
+UPLOAD_FILES += $(NVR)/build.log
+$(BRPM) rpm-build/$(NVR).buildlog: $(SPEC) $(SOURCE_FILES)
+ mkdir -p $(RPMDIRS)
+ rpmbuild $(OPTS) -ba $(SPEC) 2>&1 | tee rpm-build/$(NVR).buildlog
+
+$(NVR)/build.log: rpm-build/$(NVR).buildlog
+ mkdir -p $(NVR)
+ sed "s|$(USER)|build|g" < $< > $@
+
+.PHONY: check
+check: $(NVR)/rpmlint.txt $(NVR)/filelist.txt
+
+UPLOAD_FILES += $(NVR)/rpmlint.txt
+$(NVR)/rpmlint.txt: $(BRPM)
+ mkdir -p $(NVR)
+ rpmlint -i $(SPEC) $(SRPM) $(BRPM) 2>&1 | tee $@
+
+UPLOAD_FILES += $(NVR)/filelist.txt
+$(NVR)/filelist.txt: rpm-build/$(NVR).buildlog
+ mkdir -p $(NVR)
+ for pkg in rpm-dist/$(NVR).src.rpm rpm-dist/$(RPM_ARCH)/$(NAME)*-$(RPM_VERSION)-$(RPM_RELEASE).$(RPM_ARCH).rpm; do \
+ echo "## $$(basename "$$pkg")"; \
+ rpm -qpl --scripts "$$pkg"; \
+ echo; \
+ done > $@.new
+ cp $@.new $@ && rm -f $@.new
+
+.PHONY: mkdir
+mkdir:
+ ssh $(RSYNC_USHO) mkdir -p $(RSYNC_ROOT)/$(NAME)
+
+.PHONY: upload
+upload: $(NVR)
+
+UPLOAD_FILES += $(NVR)/$(SPEC)
+$(NVR)/$(SPEC): $(SPEC)
+ mkdir -p $(NVR)
+ cp -p $< $@
+
+UPLOAD_FILES += $(foreach p, $(SOURCE_FILES), $(NVR)/$(p))
+$(NVR)/%: %
+ mkdir -p $(NVR)
+ cp -p $< $@
+
+$(NVR): $(UPLOAD_FILES)
+ mkdir -p $(NVR)
+ rsync -avz --delete $(NVR)/ $(RSYNC_USHO):$(RSYNC_DIR)/
+ touch $@
+
+.PHONY: clean
+clean:
+ rm -rf $(RPMDIRS)
+
+.PHONY: tag
+tag: clog
+ @echo "List of git tags:"; git tag -n20
+ @echo "Really add git tag $(NVR)? Ctrl-C to abort, Enter to continue"; read
+ git tag -a -F clog $(NVR)
+
+WORKDIR ?= $(PWD)
+MOCKDIR ?= $(WORKDIR)
+MOCKCFG ?= fedora-$(shell echo $(RPM_RELEASE) | sed -n 's/.*\.fc\([1-9][0-9]*\)$$/\1/p')-$(RPM_ARCH)
+MOCKRESULTDIR ?= $(MOCKDIR)/$(NVR).mock
+
+SCRATCHBUILD_KOJI_TAG = dist-f10
+
+.PHONY: scratch-build
+scratch-build: $(SRPM)
+ /usr/bin/koji build --scratch $(SCRATCHBUILD_KOJI_TAG) $(SRPM)
+
+.PHONY: mock-build
+mock-build: $(MOCKRESULTDIR)
+
+$(MOCKRESULTDIR): $(SRPM)
+ mock $(MOCKARGS) -r $(MOCKCFG) --resultdir=$(MOCKRESULTDIR) rebuild $(SRPM)
+
+.PHONY: help
+help:
+ @echo "NVR: $(NVR)"
+ @echo "Mock config: $(MOCKCFG)"
+ @echo "Mock result dir: $(MOCKRESULTDIR)"
+ @echo "Source RPM: $(SRPM)"
+
+# Package specific rules, best put into package specific GNUmakefile
+
+#$(NAME)-$(RPM_VERSION)-buildfixes.patch: $(wildcard $(NAME)-$(RPM_VERSION)/* $(NAME)-$(RPM_VERSION)-buildfixes/*)
+# diff -ru $(NAME)-$(RPM_VERSION) $(NAME)-$(RPM_VERSION)-buildfixes > $@;:
+
+# End of file.
diff --git a/phoronix-test-suite-1.4.2.tar.gz b/phoronix-test-suite-1.4.2.tar.gz
new file mode 100644
index 0000000..a36a1b7
--- /dev/null
+++ b/phoronix-test-suite-1.4.2.tar.gz
Binary files differ
diff --git a/phoronix-test-suite.spec b/phoronix-test-suite.spec
new file mode 100644
index 0000000..187bcf7
--- /dev/null
+++ b/phoronix-test-suite.spec
@@ -0,0 +1,44 @@
+Name: phoronix-test-suite
+Version: 1.4.2
+Release: 1%{?dist}
+Summary: Phoronix graphics card test suite
+
+Group: TBD
+License: TBD
+URL: http://www.phoronix-test-suite.com/
+# Redirected from http://www.phoronix-test-suite.com/download.php?file=%{name}-%{version}
+Source0: http://www.phoronix.net/downloads/phoronix-test-suite/releases/%{name}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+#BuildRequires:
+Requires: php-cli >= 5
+Requires: php-gd
+
+%description
+
+
+%prep
+%setup -q
+
+
+%build
+#configure
+#make %{?_smp_mflags}
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files
+%defattr(-,root,root,-)
+%doc
+
+
+
+%changelog