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 \
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 $@
@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`..."; \
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))
$(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)
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)
%endif
%prep
-%setup -q -n %{glibcsrcdir} -b1
+rm -rf %{glibcportsdir}
+%setup -q -n %{glibcsrcdir} -b1 -b2
%patch0 -E -p1
%ifarch ia64
%if "%{_lib}" == "lib64"
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}