]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Put ports into the rpm.
authorRoland McGrath <roland@redhat.com>
Sat, 10 Jul 2010 00:12:53 +0000 (17:12 -0700)
committerRoland McGrath <roland@redhat.com>
Sat, 10 Jul 2010 00:14:02 +0000 (17:14 -0700)
fedora/Makefile
fedora/glibc.spec.in

index 8833c43280a7e791f2af256db2b734554bf37d99..0de99b4c39c39ddf8ae7e28d9f320632adc05a5c 100644 (file)
@@ -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)
 
index fdba96fb9c5074f5e0c5d34a7ab20cb780ec6ce2..f0950d992aa91c78aca91c51641dbf6a2f843120 100644 (file)
@@ -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}