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
)
26 branch-name
:= $(patsubst %-$(patsubst glibc-
%,%,$(tag-name
)),%,\
29 branch.mk-vars
= glibc-branch glibc-base DIST_BRANCH COLLECTION
32 now
=`date -u $(snapshot-date-fmt)`; \
33 name
=`date -u -d "$$now" $(snapshot-name-fmt)`; \
34 new
="$(tag-prefix)$(tag-name)-$$name"; \
35 cvs
-Q rtag
$(if
$(on-branch
),-r
$(glibc-base
),-D
"$$now") $$new libc
;\
36 (echo
'# This file is updated automatically by Makefile.'; \
37 $(foreach var
,$(branch.mk-vars
),\
38 $(if
$($(var
)),echo
'$(var) := $($(var))';)) \
39 echo
"$(glibc-branch)-sync-date := $$now"; \
40 echo
"$(glibc-branch)-sync-tag := $$new"; \
42 cd ..
; (set
-x
; cvs
-q update
-d
-P \
43 -j
'$($(glibc-branch)-sync-tag)' -j
"$$new") \
44 2>&1 | tee fedora
/update.log
47 snapshot-time
: branch.mk
48 date
-d
'$(snapshot-date)'
51 cd ..
; cvs
-Q commit
-m
"Updated to $(snapshot-id)"
53 glibc.spec
: glibc.spec.in ..
/version.h branch.mk
54 (echo
'%define glibcdate $(snapshot-name)'; \
55 echo
'%define glibcname $(tar-name)'; \
56 sed
-n
'/VERSION/s/^.*"\([^"]*\)"$$/%define glibcversion \1/p' \
61 ifeq (,$(wildcard glibc.spec
))
62 Makefile
: glibc.spec
;
65 spec-nvr
:= $(shell rpm
-q
--qf
'%{NAME}-%{VERSION}-%{RELEASE}\n' \
66 --specfile glibc.spec | sed
1q
)
67 spec-tag
= $(subst .
,_
,$(spec-nvr
))
70 select-release
= -r
$(glibc-branch
)-branch
72 select-release
= -r
$(tag-prefix
)$(spec-tag
)
76 cd ..
; cvs
-Q tag
-c
$(tag-prefix
)$(spec-tag
)
79 cd ..
; cvs
-Q tag
-F
-c
$(tag-prefix
)$(spec-tag
)
81 # Note this rule assumes that your working directory (..) is up to date.
82 $(tar-name
)-$(branch-name
).patch
: makepatch.awk glibc.spec \
83 ..
/ChangeLog ..
/*/ChangeLog
84 # Use -kk to suppress patches for $Id$ differences between branches.
85 (cd ..
; cvs
-q diff
-kk
-upN
$(select-snapshot
) $(select-release
)) | \
86 awk
-v OLDVER
=$(tar-name
)-$(snapshot-name
) \
87 -v NEWVER
=$(tar-name
)-$(snapshot-name
)-$(branch-name
) \
91 # makepatch.awk omits these files from the patch; we put them in a tar file.
92 outside-patch
= fedora c_stubs rtkaio glibc-compat \
93 localedata
/charmaps
/GB18030 iconvdata
/gb18030.c
95 $(tar-name
)-$(branch-name
)-$(snapshot-name
).
tar.bz2
: Makefile branch.mk \
99 cvs
-Q
export $(select-release
) $(addprefix libc
/,$(outside-patch
))
100 tar cf
- -C libc
$(outside-patch
) | bzip2
-9 > $@.new
104 $(tar-name
)-$(snapshot-name
).
tar.bz2
: Makefile branch.mk
105 @
rm -rf
$(tar-name
)-$(snapshot-name
)
106 cvs
-Q
export -d
$(tar-name
)-$(snapshot-name
) $(select-snapshot
) libc
107 tar cf
- $(tar-name
)-$(snapshot-name
) | bzip2
-9 > $@.new
108 rm -rf
$(tar-name
)-$(snapshot-name
)
111 archives
= $(tar-name
)-$(snapshot-name
).
tar.bz2 \
112 $(tar-name
)-$(branch-name
)-$(snapshot-name
).
tar.bz2 \
113 $(tar-name
)-$(branch-name
).patch
114 finish_archive
: $(archives
)
117 $(MAKE
) tag finish_archive
119 rpm srpm
: $(spec-nvr
).src.rpm
120 $(spec-nvr
).src.rpm
: glibc.spec
$(archives
)
121 rpmbuild
--define "_sourcedir `pwd`" \
122 --define "_specdir `pwd`" \
123 --define "_srcrpmdir `pwd`" \
127 # These rules are for dealing with the Fedora package repository
128 # and the Red Hat internal build system.
130 # To use this, put in ~/.cvsdistrc at least a line:
131 # DIST_COMMON = /some/checkout/of/dist/common
132 # We will find cvs-import.sh there and use its CVS/Root for where to commit.
136 -include ~
/.cvsdistrc
140 COLLECTION ?
= dist-fc3
143 bhc-baseurl
:= cvs
://cvs.devel.redhat.com
/cvs
/dist?rpms
144 bhc-url
= $(bhc-baseurl
)/glibc
/$(DIST_BRANCH
)\
#$(spec-tag)
146 dist-import
: $(spec-nvr
).src.rpm
147 $(DIST_COMMON
)/cvs-import.sh
-b
$(DIST_BRANCH
) $<
148 rpm
-qp
$< --queryformat
'[%{FILEMD5S} %{FILENAMES}\n]' > $@.new
151 dist-build
: dist-import
152 bhc
$(BHC_FLAGS
) $(COLLECTION
) '$(bhc-url)'