summary refs log tree commit diff
path: root/fedora
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2010-07-09 17:12:53 -0700
committerRoland McGrath <roland@redhat.com>2010-07-09 17:14:02 -0700
commit2e091b008b3e097045b3b48bb39e5642f75965df (patch)
treef32d09782825f622eca4ddf62b023299d8a5b317 /fedora
parent514d257bf770a0983c52ce171cc35f39dc7f4fa7 (diff)
downloadglibc-2e091b008b3e097045b3b48bb39e5642f75965df.tar.gz
glibc-2e091b008b3e097045b3b48bb39e5642f75965df.tar.xz
glibc-2e091b008b3e097045b3b48bb39e5642f75965df.zip
Put ports into the rpm.
Diffstat (limited to 'fedora')
-rw-r--r--fedora/Makefile40
-rw-r--r--fedora/glibc.spec.in10
2 files changed, 44 insertions, 6 deletions
diff --git a/fedora/Makefile b/fedora/Makefile
index 8833c43280..0de99b4c39 100644
--- a/fedora/Makefile
+++ b/fedora/Makefile
@@ -17,6 +17,15 @@ my-branch := $(call branchname,$(call git,symbolic-ref,HEAD))
 upstream-remote := $(call gitconf,branch.$(my-branch).remote)
 upstream-branch := $(call branchname,$(call gitconf,branch.$(my-branch).follow))
 
+ports-repo := $(call gitconf,glibc.ports-repo)
+
+ifndef ports-repo
+$(error \
+You need a glibc-ports repository! \
+Get one and do: "git config --add glibc.ports-repo ~/DIR/.git" \
+)
+endif
+
 dep-my-branch := $(firstword $(wildcard ../.git/refs/heads/$(my-branch) \
 	      		    	       	../.git/packed-refs))
 dep-upstream-branch := $(firstword $(wildcard \
@@ -57,15 +66,25 @@ tar-name = $(merge-base-name)
 upstream-pristine = \
 	$(GIT) $(describe-merge) --exact-match > /dev/null 2>&1 $(merge-base-id)
 
+GIT-ports = $(GIT) --git-dir=$(ports-repo)
+git-ports = $(shell $(GIT-ports) $1 $2)
+
+ports-pristine = $(GIT-ports) $(describe-merge) --exact-match > /dev/null 2>&1 \
+						$(upstream-branch)
+ports-base-name := $(call git-ports,$(describe-merge) $(upstream-branch))
+
+ports-tar-name := $(patsubst glibc-%,glibc-ports-%,$(ports-base-name))
+
 glibc.spec: glibc.spec.in $(dep-my-branch)
 	@rm -f $@.new
 	echo '%define glibcsrcdir $(tar-name)' > $@.new
-	if $(upstream-pristine); then \
+	if $(upstream-pristine) && $(ports-pristine); then \
 	  echo '%define glibc_release_url $(releases-url)' >> $@.new; \
 	else : ; fi; \
 	$(GIT) show $(my-branch):version.h \
 	| sed -n '/VERSION/s/^.*"\([^"]*\)"$$/%define glibcversion \1/p' \
 	>> $@.new
+	echo '%define glibcportsdir $(ports-tar-name)' >> $@.new
 	echo '### $< follows:' >> $@.new
 	cat $< >> $@.new
 	mv -f $@.new $@
@@ -107,6 +126,7 @@ glibc-$(branch-name).patch: glibc.spec Makefile $(dep-upstream-branch)
 	@mv -f patch.tmp $@
 
 git-describe = $(GIT) describe --long --always
+ports-git-describe = $(GIT-ports) describe --long --always
 
 define git-tar
 echo "Creating $@ from `$(git-describe) $1`..."; \
@@ -115,6 +135,13 @@ echo "Creating $@ from `$(git-describe) $1`..."; \
 mv -f $@.new $@
 endef
 
+define ports-git-tar
+echo "Creating $@ from `$(ports-git-describe) $1`..."; \
+(cd ..; $(GIT-ports) archive --format=tar --prefix='$(ports-tar-name)/' $1 $2) \
+| bzip2 -9 > $@.new && \
+mv -f $@.new $@
+endef
+
 $(tar-name)-$(branch-name).tar.bz2: glibc.spec Makefile
 	@$(call git-tar,$(my-branch),$(outside-patch))
 
@@ -126,9 +153,18 @@ $(tar-name).tar.bz2: $(dep-upstream-branch) Makefile
 	   $(call git-tar,$(merge-base-id)); \
 	 fi
 
+$(ports-tar-name).tar.bz2: Makefile
+	@if $(ports-pristine); then \
+	   echo 'Fetching from $(releases-url)...'; \
+	   curl -C - -O $(releases-url)/$@; \
+	 else \
+	   $(call ports-git-tar,$(upstream-branch)); \
+	 fi
+
 archives = $(tar-name).tar.bz2 \
 	   $(tar-name)-$(branch-name).tar.bz2 \
-	   glibc-$(branch-name).patch
+	   glibc-$(branch-name).patch \
+	   $(ports-tar-name).tar.bz2
 
 finish_archive: $(archives)
 
diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in
index fdba96fb9c..f0950d992a 100644
--- a/fedora/glibc.spec.in
+++ b/fedora/glibc.spec.in
@@ -30,7 +30,8 @@ License: LGPLv2+ and LGPLv2+ with exceptions and GPLv2+
 Group: System Environment/Libraries
 URL: http://www.gnu.org/software/glibc/
 Source0: %{?glibc_release_url}%{glibcsrcdir}.tar.bz2
-Source1: %{glibcsrcdir}-fedora.tar.bz2
+Source1: %{?glibc_release_url}%{glibcportsdir}.tar.bz2
+Source2: %{glibcsrcdir}-fedora.tar.bz2
 Patch0: %{name}-fedora.patch
 Patch1: %{name}-ia64-lib64.patch
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -236,7 +237,8 @@ package or when debugging this package.
 %endif
 
 %prep
-%setup -q -n %{glibcsrcdir} -b1
+rm -rf %{glibcportsdir}
+%setup -q -n %{glibcsrcdir} -b1 -b2
 %patch0 -E -p1
 %ifarch ia64
 %if "%{_lib}" == "lib64"
@@ -338,8 +340,8 @@ mkdir $builddir ; cd $builddir
 build_CFLAGS="$BuildFlags -g -O3 $*"
 ../configure CC="$GCC" CXX="$GXX" CFLAGS="$build_CFLAGS" \
 	--prefix=%{_prefix} \
-	--enable-add-ons=nptl$AddOns --without-cvs $EnableKernel \
-	--with-headers=%{_prefix}/include --enable-bind-now \
+	--enable-add-ons=../%{glibcportsdir},nptl$AddOns \
+	--with-headers=%{_prefix}/include $EnableKernel --enable-bind-now \
 	--with-tls --with-__thread --build %{nptl_target_cpu}-redhat-linux \
 	--host %{nptl_target_cpu}-redhat-linux \
 %ifarch %{multiarcharches}