FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Build System

 
 
LinkBack Thread Tools
 
Old 09-30-2008, 03:08 PM
Petr Lautrbach
 
Default Makefile.common autodetermine RPM_BUILD_DIR from spec file

Hello.

make patch and make rediff don't work if %setup macro defines with -n other
directory than $(NAME)-$(VERSION).



Petr






--
Fedora-buildsys-list mailing list
Fedora-buildsys-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list
 
Old 09-30-2008, 03:10 PM
Petr Lautrbach
 
Default Makefile.common autodetermine RPM_BUILD_DIR from spec file

Petr Lautrbach wrote:

Hello.

make patch and make rediff don't work if %setup macro defines with -n
other

directory than $(NAME)-$(VERSION).




patch in attachment

Petr
diff -up common/Makefile.common.patch-rediff common/Makefile.common
--- common/Makefile.common.patch-rediff 2008-09-30 14:19:22.000000000 +0200
+++ common/Makefile.common 2008-09-30 16:59:59.000000000 +0200
@@ -108,7 +108,12 @@ endif

# this is used in make patch, maybe make clean eventually.
# would be nicer to autodetermine from the spec file...
-RPM_BUILD_DIR ?= $(BUILDDIR)/$(NAME)-$(VERSION)
+# look for %setup -n SOURCE_DIR in .spec and use it instead of default if exists
+NAME_VER_DIR := $(shell sed -ne '/^%setup .*-n/{s/.*-n ([^ ]*)/1/;s/%{name}/$(NAME)/;s/%{version}/$(VERSION)/;p}' $(SPECFILE))
+ifndef NAME_VER_DIR
+NAME_VER_DIR := $(NAME)-$(VERSION)
+endif
+RPM_BUILD_DIR ?= $(BUILDDIR)/$(NAME_VER_DIR)

## for secondary arch only packages we cant build on the primary hub
## we need to go direct to the secondary arch hub
@@ -581,7 +586,7 @@ endif

patch:
@if test -z "$(SUFFIX)"; then echo "Must specify SUFFIX=whatever" ; exit 1; fi
- (cd $(RPM_BUILD_DIR)/.. && gendiff $(NAME)-$(VERSION) .$(SUFFIX) | $(FILTERDIFF)) > $(PATCHFILE) || true
+ (cd $(RPM_BUILD_DIR)/.. && gendiff $(NAME_VER_DIR) .$(SUFFIX) | $(FILTERDIFF)) > $(PATCHFILE) || true
@if ! test -s $(PATCHFILE); then echo "Patch is empty!"; exit 1; fi
@echo "Created $(PATCHFILE)"
@grep "$(PATCHFILE)" CVS/Entries >&/dev/null || cvs add -ko $(PATCHFILE) || true
@@ -594,7 +599,7 @@ rediff:
@if ! test -f "$(PATCHFILE)"; then echo "$(PATCHFILE) not found"; exit 1; fi
@mv -f $(PATCHFILE) $(PATCHFILE)~
@sed '/^--- /,$$d' < $(PATCHFILE)~ > $(PATCHFILE)
- @(cd $(RPM_BUILD_DIR)/.. && gendiff $(NAME)-$(VERSION) .$(SUFFIX) | $(FILTERDIFF)) >> $(PATCHFILE) || true
+ @(cd $(RPM_BUILD_DIR)/.. && gendiff $(NAME_VER_DIR) .$(SUFFIX) | $(FILTERDIFF)) >> $(PATCHFILE) || true

clog: $(SPECFILE)
@sed -n '/^%changelog/,/^$$/{/^%/d;/^$$/d;s/%%/%/g;p}' $(SPECFILE) | tee $@
--
Fedora-buildsys-list mailing list
Fedora-buildsys-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list
 

Thread Tools




All times are GMT. The time now is 02:04 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org