1 # Makefile for maintaining glibc fedora-branch and creating Fedora source RPMs.
3 glibc.spec
: # The default target.
7 .PHONY
: update commit-merge commit patch tag archive finish_archive srpm rpm
9 snapshot-date-fmt
:= +'%Y-%m-%d %H:%M %Z'
10 snapshot-name-fmt
:= +'%Y%m%dT%H%M'
15 on-branch
= $(filter-out HEAD
,$(glibc-base
))
17 snapshot-date
:= $($(glibc-branch
)-sync-date
)
18 snapshot-name
:= $(shell date
-u
-d
'$(snapshot-date)' $(snapshot-name-fmt
))
20 tar-name
:= glibc
$(subst _
,.
,$(patsubst glibc-
%-branch
,-%,\
21 $(filter-out HEAD
,$(glibc-base
))))
22 select-snapshot
= -r
'$($(glibc-branch)-sync-tag)'
23 snapshot-id
= $($(glibc-branch
)-sync-tag
)
26 branch.mk-vars
= glibc-branch glibc-base DIST_BRANCH COLLECTION
29 now
=`date -u $(snapshot-date-fmt)`; \
30 name
=`date -u -d "$$now" $(snapshot-name-fmt)`; \
31 new
="$(tag-prefix)$(tar-name)-$$name"; \
32 cvs
-Q rtag
$(if
$(on-branch
),-r
$(glibc-base
),-D
"$$now") $$new libc
;\
33 (echo
'# This file is updated automatically by Makefile.'; \
34 $(foreach var
,$(branch.mk-vars
),\
35 $(if
$($(var
)),echo
'$(var) := $($(var))';)) \
36 echo
"$(glibc-branch)-sync-date := $$now"; \
37 echo
"$(glibc-branch)-sync-tag := $$new"; \
39 cd ..
; (set
-x
; cvs
-q update
-d
-P \
40 -j
'$($(glibc-branch)-sync-tag)' -j
"$$new") \
41 2>&1 | tee fedora
/update.log
44 snapshot-time
: branch.mk
45 date
-d
'$(snapshot-date)'
48 cd ..
; cvs
-Q commit
-m
"Updated to $(snapshot-id)"
50 glibc.spec
: glibc.spec.in ..
/version.h branch.mk
51 (echo
'%define glibcdate $(snapshot-name)'; \
52 sed
-n
'/VERSION/s/^.*"\([^"]*\)"$$/%define glibcversion \1/p' \
57 ifeq (,$(wildcard glibc.spec
))
58 Makefile
: glibc.spec
;
61 spec-nvr
:= $(shell rpm
-q
--qf
'%{NAME}-%{VERSION}-%{RELEASE}\n' \
62 --specfile glibc.spec | sed
1q
)
63 spec-tag
= $(subst .
,_
,$(spec-nvr
))
66 select-release
= -r
$(glibc-branch
)-branch
68 select-release
= -r
$(tag-prefix
)$(spec-tag
)
72 cd ..
; cvs
-Q tag
-c
$(tag-prefix
)$(spec-tag
)
75 cd ..
; cvs
-Q tag
-F
-c
$(tag-prefix
)$(spec-tag
)
77 # Note this rule assumes that your working directory (..) is up to date.
78 $(tar-name
)-$(glibc-branch
).patch
: makepatch.awk glibc.spec \
79 ..
/ChangeLog ..
/*/ChangeLog
80 (cd ..
; cvs
-q diff
-upN
$(select-snapshot
) $(select-release
)) | \
81 awk
-v OLDVER
=$(tar-name
)-$(snapshot-name
) \
82 -v NEWVER
=$(tar-name
)-$(snapshot-name
)-$(glibc-branch
) \
86 # makepatch.awk omits these files from the patch; we put them in a tar file.
87 outside-patch
= fedora c_stubs rtkaio glibc-compat \
88 localedata
/charmaps
/GB18030 iconvdata
/gb18030.c
90 $(tar-name
)-$(glibc-branch
)-$(snapshot-name
).
tar.bz2
: Makefile branch.mk \
94 cvs
-Q
export $(select-release
) $(addprefix libc
/,$(outside-patch
))
95 tar cf
- -C libc
$(outside-patch
) | bzip2
-9 > $@.new
99 $(tar-name
)-$(snapshot-name
).
tar.bz2
: Makefile branch.mk
100 @
rm -rf
$(tar-name
)-$(snapshot-name
)
101 cvs
-Q
export -d
$(tar-name
)-$(snapshot-name
) $(select-snapshot
) libc
102 tar cf
- $(tar-name
)-$(snapshot-name
) | bzip2
-9 > $@.new
103 rm -rf
$(tar-name
)-$(snapshot-name
)
106 archives
= $(tar-name
)-$(snapshot-name
).
tar.bz2 \
107 $(tar-name
)-$(glibc-branch
)-$(snapshot-name
).
tar.bz2 \
108 $(tar-name
)-$(glibc-branch
).patch
109 finish_archive
: $(archives
)
112 $(MAKE
) tag finish_archive
114 rpm srpm
: $(spec-nvr
).src.rpm
115 $(spec-nvr
).src.rpm
: glibc.spec
$(archives
)
116 rpmbuild
--define "_sourcedir `pwd`" \
117 --define "_specdir `pwd`" \
118 --define "_srcrpmdir `pwd`" \
122 # These rules are for dealing with the Fedora package repository
123 # and the Red Hat internal build system.
125 # To use this, put in ~/.cvsdistrc at least a line:
126 # DIST_COMMON = /some/checkout/of/dist/common
127 # We will find cvs-import.sh there and use its CVS/Root for where to commit.
131 -include ~
/.cvsdistrc
135 COLLECTION ?
= dist-fc3
138 bhc-baseurl
:= cvs
://cvs.devel.redhat.com
/cvs
/dist?rpms
139 bhc-url
= $(bhc-baseurl
)/glibc
/$(DIST_BRANCH
)#$(spec-tag)
141 dist-import
: $(spec-nvr
).src.rpm
142 $(DIST_COMMON
)/cvs-import.sh
-b
$(DIST_BRANCH
) $<
145 dist-build
: dist-import
146 bhc
$(BHC_FLAGS
) $(COLLECTION
) '$(bhc-url)'