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 tag-name
:= glibc
$(patsubst glibc-
%-branch
,-%,\
21 $(filter-out HEAD
,$(glibc-base
)))
22 tar-name
:= $(subst _
,.
,$(tag-name
))
23 select-snapshot
= -r
'$($(glibc-branch)-sync-tag)'
24 snapshot-id
= $($(glibc-branch
)-sync-tag
)
27 branch.mk-vars
= glibc-branch glibc-base DIST_BRANCH COLLECTION
30 now
=`date -u $(snapshot-date-fmt)`; \
31 name
=`date -u -d "$$now" $(snapshot-name-fmt)`; \
32 new
="$(tag-prefix)$(tag-name)-$$name"; \
33 cvs
-Q rtag
$(if
$(on-branch
),-r
$(glibc-base
),-D
"$$now") $$new libc
;\
34 (echo
'# This file is updated automatically by Makefile.'; \
35 $(foreach var
,$(branch.mk-vars
),\
36 $(if
$($(var
)),echo
'$(var) := $($(var))';)) \
37 echo
"$(glibc-branch)-sync-date := $$now"; \
38 echo
"$(glibc-branch)-sync-tag := $$new"; \
40 cd ..
; (set
-x
; cvs
-q update
-d
-P \
41 -j
'$($(glibc-branch)-sync-tag)' -j
"$$new") \
42 2>&1 | tee fedora
/update.log
45 snapshot-time
: branch.mk
46 date
-d
'$(snapshot-date)'
49 cd ..
; cvs
-Q commit
-m
"Updated to $(snapshot-id)"
51 glibc.spec
: glibc.spec.in ..
/version.h branch.mk Makefile
52 (echo
'%define glibcdate $(snapshot-name)'; \
53 echo
'%define glibcname $(tar-name)'; \
54 sed
-n
'/VERSION/s/^.*"\([^"]*\)"$$/%define glibcversion \1/p' \
59 ifeq (,$(wildcard glibc.spec
))
60 Makefile
: glibc.spec
;
63 spec-nvr
:= $(shell rpm
-q
--qf
'%{NAME}-%{VERSION}-%{RELEASE}\n' \
64 --specfile glibc.spec | sed
1q
)
65 spec-tag
= $(subst .
,_
,$(spec-nvr
))
68 select-release
= -r
$(glibc-branch
)-branch
70 select-release
= -r
$(tag-prefix
)$(spec-tag
)
74 cd ..
; cvs
-Q tag
-c
$(tag-prefix
)$(spec-tag
)
77 cd ..
; cvs
-Q tag
-F
-c
$(tag-prefix
)$(spec-tag
)
79 # Note this rule assumes that your working directory (..) is up to date.
80 $(tar-name
)-$(glibc-branch
).patch
: makepatch.awk glibc.spec \
81 ..
/ChangeLog ..
/*/ChangeLog
82 (cd ..
; cvs
-q diff
-upN
$(select-snapshot
) $(select-release
)) | \
83 awk
-v OLDVER
=$(tar-name
)-$(snapshot-name
) \
84 -v NEWVER
=$(tar-name
)-$(snapshot-name
)-$(glibc-branch
) \
88 # makepatch.awk omits these files from the patch; we put them in a tar file.
89 outside-patch
= fedora c_stubs rtkaio glibc-compat \
90 localedata
/charmaps
/GB18030 iconvdata
/gb18030.c
92 $(tar-name
)-$(glibc-branch
)-$(snapshot-name
).
tar.bz2
: Makefile branch.mk \
96 cvs
-Q
export $(select-release
) $(addprefix libc
/,$(outside-patch
))
97 tar cf
- -C libc
$(outside-patch
) | bzip2
-9 > $@.new
101 $(tar-name
)-$(snapshot-name
).
tar.bz2
: Makefile branch.mk
102 @
rm -rf
$(tar-name
)-$(snapshot-name
)
103 cvs
-Q
export -d
$(tar-name
)-$(snapshot-name
) $(select-snapshot
) libc
104 tar cf
- $(tar-name
)-$(snapshot-name
) | bzip2
-9 > $@.new
105 rm -rf
$(tar-name
)-$(snapshot-name
)
108 archives
= $(tar-name
)-$(snapshot-name
).
tar.bz2 \
109 $(tar-name
)-$(glibc-branch
)-$(snapshot-name
).
tar.bz2 \
110 $(tar-name
)-$(glibc-branch
).patch
111 finish_archive
: $(archives
)
114 $(MAKE
) tag finish_archive
116 rpm srpm
: $(spec-nvr
).src.rpm
117 $(spec-nvr
).src.rpm
: glibc.spec
$(archives
)
118 rpmbuild
--define "_sourcedir `pwd`" \
119 --define "_specdir `pwd`" \
120 --define "_srcrpmdir `pwd`" \
124 # These rules are for dealing with the Fedora package repository
125 # and the Red Hat internal build system.
127 # To use this, put in ~/.cvsdistrc at least a line:
128 # DIST_COMMON = /some/checkout/of/dist/common
129 # We will find cvs-import.sh there and use its CVS/Root for where to commit.
133 -include ~
/.cvsdistrc
137 COLLECTION ?
= dist-fc3
140 bhc-baseurl
:= cvs
://cvs.devel.redhat.com
/cvs
/dist?rpms
141 bhc-url
= $(bhc-baseurl
)/glibc
/$(DIST_BRANCH
)#$(spec-tag)
143 dist-import
: $(spec-nvr
).src.rpm
144 $(DIST_COMMON
)/cvs-import.sh
-b
$(DIST_BRANCH
) $<
147 dist-build
: dist-import
148 bhc
$(BHC_FLAGS
) $(COLLECTION
) '$(bhc-url)'