diff options
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | Makefile | 47 | ||||
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | conf_git-urls.txt | 22 | ||||
-rw-r--r-- | conf_maven.local.repo.txt | 1 | ||||
-rw-r--r-- | makefiles/plexus-containers.mk | 48 | ||||
l--------- | makefiles/plexus-interpolation.mk | 1 | ||||
l--------- | makefiles/plexus-utils.mk | 1 | ||||
-rw-r--r-- | makefiles/plexus.mk | 61 |
9 files changed, 171 insertions, 19 deletions
@@ -1,4 +1,5 @@ -/upstream/ /build/ -/token_* +/packages/ +/upstream/ /gen_* +/token_* @@ -1,6 +1,9 @@ -top=$(shell pwd) +top := $(shell pwd) +export maven_dist_top := $(top) -mvn_ver=$(shell cat conf_apache-maven_version.txt) +mvn_ver = $(shell cat conf_apache-maven_version.txt) +MAVEN_LOCAL_REPO = $(shell cat conf_maven.local.repo.txt) +export MAVEN_LOCAL_REPO all: extract gen_version-maven-svn.txt @@ -35,24 +38,31 @@ extract: \ build/plexus-interpolation \ build/plexus-pom +package: \ + packages/plexus-utils \ + packages/plexus-interpolation \ + packages/plexus-containers \ + token_%: touch $@ -################################################################################ +# apache-maven ################################################################# upstream/apache-maven-${mvn_ver}-src.tar.gz: upstream/apache-maven-%-src.tar.gz: conf_apache-maven_mirror.txt token_network - ver=$* && mirror=$$(< $<) && \ - mkdir -p ${@D} && \ - wget -c -O $@ "$${mirror}/maven/maven-$${ver%%.*}/$${ver}/source/${@F}" + mkdir -p ${@D} + ver=$* && mirror=$$(< $<) && wget -c -O $@ "$${mirror}/maven/maven-$${ver%%.*}/$${ver}/source/${@F}" + touch $@ upstream/apache-maven-${mvn_ver}: upstream/apache-maven-%: upstream/apache-maven-%-src.tar.gz + rm -rf $@ + mkdir ${@D} cd ${@D} && tar xaf "${top}/$<" - cd $@ && git init && git add . && git commit -m 'tarball of apache maven $*' + cd $@ && git init && git add . && git commit -q -m 'tarball of apache maven $*' build/maven: upstream/apache-maven-${mvn_ver} rm -rf $@ mkdir -p $@ lndir -silent "${top}/$<" "${top}/$@" -################################################################################ +# maven-svn #################################################################### upstream/maven-svn: conf_maven-svn_map.txt token_network if ! [[ -d "$@/.svn" ]]; then \ @@ -69,7 +79,7 @@ upstream/maven-svn: conf_maven-svn_map.txt token_network gen_version-maven-svn.txt: upstream/maven-svn conf_maven-svn_map.txt while read svnpath localpath; do \ cd "${top}/$</$${svnpath}" && \ - LANG=C svn log -l 1 .|sed -n 2p; \ + LC_ALL=C svn log -l 1 .|sed -n 2p; \ done <"${top}/conf_maven-svn_map.txt" | \ cut -d'|' -f3 | date --file=- --utc --iso-8601 | sort | sed -n '$$p' > "${top}/$@" build/maven-extras: upstream/maven-svn conf_maven-svn_map.txt @@ -80,11 +90,24 @@ build/maven-extras: upstream/maven-svn conf_maven-svn_map.txt lndir -silent "${top}/$</$${svnpath}" "${top}/$@/$${localpath}"; \ done <conf_maven-svn_map.txt -################################################################################ +# git wildcard ################################################################# -upstream/%-git: conf_git-urls.txt - gitget checkout $$(grep $* $<) $@ +upstream/%-git: conf_git-urls.txt token_network + gitget checkout $$(grep -v '^#' $< | grep -- $*) $@ + touch $@ build/%: upstream/%-git rm -rf $@ mkdir -p $@ lndir -silent "${top}/$<" "${top}/$@" + +################################################################################ + +packages/%: build/% makefiles/%.mk + $(MAKE) -C build/$* -f $(top)/makefiles/$*.mk install DESTDIR="$(top)/$@" + mkdir -p packages/dest && lndir -silent "$(top)/$@" packages/dest + +packages/plexus-containers: packages/plexus-utils packages/plexus-classworlds + +distclean: + rm -rf upstream build packatges + rm -f token_* gen_* @@ -0,0 +1,4 @@ +dependencies: + junit + asm-3 + ant diff --git a/conf_git-urls.txt b/conf_git-urls.txt index 5e38c5c..07f6b7c 100644 --- a/conf_git-urls.txt +++ b/conf_git-urls.txt @@ -1,10 +1,22 @@ +git://github.com/sonatype/plexus-classworlds.git#tag=plexus-classworlds-2.5.1 +# commonsCli +# easyMock +# junit +git://github.com/sonatype/plexus-containers.git#tag=plexus-containers-1.5.5 +git://github.com/sonatype/plexus-interpolation.git#tag=plexus-interpolation-1.19 +git://github.com/sonatype/plexus-utils.git#tag=plexus-utils-3.0.17 +# guava +# sisu guice +# sisuInject +# wagon +# securitydispatcher +git://github.com/sonatype/plexus-cipher.git#tag=plexus-cipher-1.7 +# modello +# jxpath +# aether git://github.com/qos-ch/slf4j.git#tag=v_1.7.5 + git://github.com/sonatype/plexus-compiler.git#tag=plexus-compiler-2.3 -git://github.com/sonatype/plexus-utils.git#tag=plexus-utils-3.0.15 git://github.com/sonatype/plexus-archiver.git#tag=plexus-archiver-2.4.3 -git://github.com/sonatype/plexus-classworlds.git#tag=plexus-classworlds-2.5.1 git://github.com/sonatype/plexus-io.git#tag=plexus-io-2.0.9 -git://github.com/sonatype/plexus-containers.git#tag=plexus-containers-1.5.5 -git://github.com/sonatype/plexus-cipher.git#tag=plexus-cipher-1.7 -git://github.com/sonatype/plexus-interpolation.git#tag=plexus-interpolation-1.19 git://github.com/sonatype/plexus-pom.git#tag=plexus-3.3.1 diff --git a/conf_maven.local.repo.txt b/conf_maven.local.repo.txt new file mode 100644 index 0000000..c0f17b1 --- /dev/null +++ b/conf_maven.local.repo.txt @@ -0,0 +1 @@ +/usr/share/maven/repository diff --git a/makefiles/plexus-containers.mk b/makefiles/plexus-containers.mk new file mode 100644 index 0000000..c826329 --- /dev/null +++ b/makefiles/plexus-containers.mk @@ -0,0 +1,48 @@ +DESTDIR ?= +MAVEN_LOCAL_REPO ?= ~/.m2 + +export DESTDIR +export MAVEN_LOCAL_REPO + +#### + +version=$(shell xml sel -T -t -c /_:project/_:version pom.xml) +artifact=$(shell xml sel -T -t -c /_:project/_:artifactId pom.xml) +group=org.codehaus.plexus + +#### + +JAVAC_FLAGS = -classpath $(shell find $(maven_dist_top)/packages/dest/$(MAVEN_LOCAL_REPO) -name '*.jar' -printf '%h/%f:'):$(JAVA_HOME)/lib/tools.jar +dirs = $(wildcard plexus-*) + +#### + +all: PHONY \ + target/$(artifact)-$(version).pom \ + $(addsuffix /all,$(dirs)) + +target/$(artifact)-$(version).pom: pom.xml + install -Dm644 $< $@ + +#### + +install: PHONY \ + $(DESTDIR)$(MAVEN_LOCAL_REPO)/$(subst .,/,$(group))/$(artifact)/$(version)/$(artifact)-$(version).pom \ + $(addsuffix /install,$(dirs)) + +$(DESTDIR)$(MAVEN_LOCAL_REPO)/$(subst .,/,$(group))/$(artifact)/$(version)/%: target/% + install -Dm644 $< $@ + +#### + +$(addsuffix /%,$(dirs)): PHONY + $(MAKE) -C $(@D) -f $(maven_dist_top)/makefiles/plexus.mk version=$(version) JAVAC_FLAGS=$(JAVAC_FLAGS) + +#### + +clean: PHONY + rm -rf target */target + +#### + +.PHONY: PHONY FORCE diff --git a/makefiles/plexus-interpolation.mk b/makefiles/plexus-interpolation.mk new file mode 120000 index 0000000..f58c0b5 --- /dev/null +++ b/makefiles/plexus-interpolation.mk @@ -0,0 +1 @@ +plexus.mk
\ No newline at end of file diff --git a/makefiles/plexus-utils.mk b/makefiles/plexus-utils.mk new file mode 120000 index 0000000..f58c0b5 --- /dev/null +++ b/makefiles/plexus-utils.mk @@ -0,0 +1 @@ +plexus.mk
\ No newline at end of file diff --git a/makefiles/plexus.mk b/makefiles/plexus.mk new file mode 100644 index 0000000..16f0f37 --- /dev/null +++ b/makefiles/plexus.mk @@ -0,0 +1,61 @@ +DESTDIR ?= +MAVEN_LOCAL_REPO ?= ~/.m2 + +version=$(shell xml sel -T -t -c /_:project/_:version pom.xml) +artifact=$(shell xml sel -T -t -c /_:project/_:artifactId pom.xml) +group=org.codehaus.plexus + +#### + +all: PHONY \ + target/$(artifact)-$(version).pom \ + target/$(artifact)-$(version).jar + +target/$(artifact)-$(version).pom: pom.xml + install -Dm644 $< $@ + +target/$(artifact)-$(version).jar: \ + target/META-INF/maven/$(group)/$(artifact)/pom.properties \ + target/META-INF/maven/$(group)/$(artifact)/pom.xml \ + target/classes \ + src/main + mkdir -p $(@D) + jar -cf $@ \ + -C target/classes org \ + -C target META-INF \ + $([[ ! -d src/main/resources ]] || { cd src/main/resources && printf ' -C src/main/resources %q ' *; }) + +target/META-INF/maven/$(group)/$(artifact)/pom.xml: pom.xml + install -Dm644 $< $@ + +target/META-INF/maven/$(group)/$(artifact)/pom.properties: pom.xml + mkdir -p $(@D) + printf '%s\n' \ + '#Generated by Make' \ + "#$$(LC_ALL=C date)" \ + 'version=$(version)' \ + 'groupId=$(group)' \ + 'artifactId=$(artifact)' \ + > $@ + +target/classes: src/main/java FORCE + mkdir -p $@ + find $< -name '*.java' -exec javac $(JAVAC_FLAGS) -d $@ {} + + +#### + +install: PHONY \ + $(DESTDIR)$(MAVEN_LOCAL_REPO)/$(subst .,/,$(group))/$(artifact)/$(version)/$(artifact)-$(version).pom \ + $(DESTDIR)$(MAVEN_LOCAL_REPO)/$(subst .,/,$(group))/$(artifact)/$(version)/$(artifact)-$(version).jar + +$(DESTDIR)$(MAVEN_LOCAL_REPO)/$(subst .,/,$(group))/$(artifact)/$(version)/%: target/% + install -Dm644 $< $@ + +#### + +clean: PHONY + rm -rf target + +#### + +.PHONY: PHONY FORCE |