VERSION=1.2.15 ifndef ARCH ARCH := $(shell uname -i) export ARCH endif PREFIX=$(HOME)/rpm.eprints.org/xapian/6 TOPDIR=$(PWD)/$(VERSION) SRCDIR=$(VERSION)/build/SOURCES SPECDIR=$(VERSION)/build/SPECS BUILDOPTS="--define \"_topdir $(TOPDIR)/build\" --define \"_rpmdir $(TOPDIR)\" --define \"_srcrpmdir $(TOPDIR)/SRPMS\"" XAPIAN_CORE_TGZ=xapian-core-$(VERSION).tar.gz XAPIAN_BINDINGS_TGZ=xapian-bindings-$(VERSION).tar.gz XAPIAN_OMEGA_TGZ=xapian-omega-$(VERSION).tar.gz XAPIAN_PERL_TGZ=Search-Xapian-$(VERSION).0.tar.gz .PHONY: all clean rpms install all: rpms rm -f $(TOPDIR)/$(ARCH)/*-debuginfo-* rpm --addsign $(TOPDIR)/$(ARCH)/*.rpm $(TOPDIR)/SRPMS/*.rpm install: all cp -a $(TOPDIR)/$(ARCH)/*.rpm $(PREFIX)/$(ARCH)/ cp -a $(TOPDIR)/SRPMS/*.rpm $(PREFIX)/SRPMS/ pushd $(PREFIX) createrepo . popd clean: rm -rf $(TOPDIR) rpms: $(VERSION)/$(ARCH)/xapian-core-$(VERSION)-1.$(ARCH).rpm $(VERSION)/$(ARCH)/xapian-bindings-$(VERSION)-1.$(ARCH).rpm $(VERSION)/$(ARCH)/xapian-omega-$(VERSION)-1.$(ARCH).rpm $(VERSION)/$(ARCH)/Search-Xapian-$(VERSION).0-1.$(ARCH).rpm $(VERSION)/$(ARCH)/xapian-core-$(VERSION)-1.$(ARCH).rpm: $(SRCDIR)/$(XAPIAN_CORE_TGZ) eval rpmbuild $(BUILDOPTS) -ta $< rpm -Uvh $(VERSION)/$(ARCH)/xapian-core-$(VERSION)-1.$(ARCH).rpm $(VERSION)/$(ARCH)/xapian-core-devel-$(VERSION)-1.$(ARCH).rpm $(VERSION)/$(ARCH)/xapian-core-libs-$(VERSION)-1.$(ARCH).rpm || /bin/true $(VERSION)/$(ARCH)/xapian-bindings-$(VERSION)-1.$(ARCH).rpm: $(SRCDIR)/$(XAPIAN_BINDINGS_TGZ) eval rpmbuild --without csharp $(BUILDOPTS) -ta $< $(VERSION)/$(ARCH)/xapian-omega-$(VERSION)-1.$(ARCH).rpm: $(SRCDIR)/$(XAPIAN_OMEGA_TGZ) eval rpmbuild $(BUILDOPTS) -ta $< $(VERSION)/$(ARCH)/Search-Xapian-$(VERSION).0-1.$(ARCH).rpm: $(SRCDIR)/$(XAPIAN_PERL_TGZ) sed "s/^Version:.*$$/Version: $(VERSION).0/" perl-Search-Xapian.spec > $(SPECDIR)/perl-Search-Xapian.spec eval rpmbuild $(BUILDOPTS) -ba $(SPECDIR)/perl-Search-Xapian.spec $(SRCDIR)/$(XAPIAN_CORE_TGZ): mkdir -p $(SRCDIR) wget -q http://oligarchy.co.uk/xapian/$(VERSION)/$(XAPIAN_CORE_TGZ) -O $(SRCDIR)/$(XAPIAN_CORE_TGZ) $(SRCDIR)/$(XAPIAN_BINDINGS_TGZ): mkdir -p $(SRCDIR) wget -q http://oligarchy.co.uk/xapian/$(VERSION)/$(XAPIAN_BINDINGS_TGZ) -O $(SRCDIR)/$(XAPIAN_BINDINGS_TGZ) $(SRCDIR)/$(XAPIAN_OMEGA_TGZ): mkdir -p $(SRCDIR) wget -q http://oligarchy.co.uk/xapian/$(VERSION)/$(XAPIAN_OMEGA_TGZ) -O $(SRCDIR)/$(XAPIAN_OMEGA_TGZ) $(SRCDIR)/$(XAPIAN_PERL_TGZ): mkdir -p $(SRCDIR) wget -q http://oligarchy.co.uk/xapian/$(VERSION)/$(XAPIAN_PERL_TGZ) -O $(SRCDIR)/$(XAPIAN_PERL_TGZ)