summaryrefslogtreecommitdiffstats
path: root/source.mk
blob: 52f5b9b98b0817782ca78edb565769514ed8bd63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
UPSTREAM_SVN_BRANCH = eglibc-$$(printf '%s\n' '$(OPK_SOURCE_VERSION_UPSTREAM)' \
	| sed 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)~.*$$/\1_\2/')
UPSTREAM_SVN_URI = svn://svn.eglibc.org/branches/$(UPSTREAM_SVN_BRANCH)
UPSTREAM_SVN_REV = $$(printf '%s\n' '$(OPK_SOURCE_VERSION_UPSTREAM)' | \
	sed 's/^[0-9][0-9]*\.[0-9][0-9]*~r\([0-9][0-9]*\).*$$/\1/')
SOURCE = eglibc-$(OPK_SOURCE_VERSION_UPSTREAM)
SOURCE_ARCHIVE = ../$(SOURCE).orig.tar.bz2

$(SOURCE_ARCHIVE):
	svn export -r "$(UPSTREAM_SVN_REV)" "$(UPSTREAM_SVN_URI)" \
		'eglibc-$(OPK_SOURCE_VERSION_UPSTREAM)'
	for file in '$(SOURCE)/libc/manual/'*; do \
		case "$${file}" in \
			'$(SOURCE)/libc/manual/Makefile') \
				;; \
			*) \
				rm -Rf "$${file}"; \
				;; \
		esac; \
	done
	tar -cjf '$(SOURCE_ARCHIVE)' '$(SOURCE)'
	rm -Rf src
	mv '$(SOURCE)' src

source: $(SOURCE_ARCHIVE)