From 5044df0df8cfdcdf2311f3a4f4b59f4b7cc72dc3 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Fri, 10 Mar 2023 09:21:39 +0100 Subject: [PATCH] Start TP Build Debian packaging --- .gitignore | 8 +- bootstrap/.gitignore | 2 + bootstrap/Makefile | 129 +++++++++--------- bootstrap/debian/argeo-tp-build.install | 1 + bootstrap/debian/changelog | 5 + bootstrap/debian/control | 13 ++ bootstrap/debian/copyright | 4 + bootstrap/debian/rules | 4 + bootstrap/debian/source/format | 1 + .../biz.aQute.bndlib/bnd.bnd | 2 +- 10 files changed, 106 insertions(+), 63 deletions(-) create mode 100644 bootstrap/.gitignore create mode 100644 bootstrap/debian/argeo-tp-build.install create mode 100644 bootstrap/debian/changelog create mode 100644 bootstrap/debian/control create mode 100644 bootstrap/debian/copyright create mode 100755 bootstrap/debian/rules create mode 100644 bootstrap/debian/source/format diff --git a/.gitignore b/.gitignore index 2f26f16..e29319b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,7 @@ -sdk.mk \ No newline at end of file +sdk.mk +*.build +*.dsc +*.tar +*.tar.* +*.deb +*.rpm \ No newline at end of file diff --git a/bootstrap/.gitignore b/bootstrap/.gitignore new file mode 100644 index 0000000..9671c65 --- /dev/null +++ b/bootstrap/.gitignore @@ -0,0 +1,2 @@ +/ecj/ +/bndlib/ diff --git a/bootstrap/Makefile b/bootstrap/Makefile index 8029b42..12514c6 100644 --- a/bootstrap/Makefile +++ b/bootstrap/Makefile @@ -12,10 +12,10 @@ SLF4J_VERSION=1.7.36 ORIGIN_BASE=$(HOME)/.cache/argeo/build/origin BOOTSTRAP_BASE=$(SDK_BUILD_BASE)/bootstrap -ECJ_BASE=$(BOOTSTRAP_BASE)/ecj +ECJ_BASE=./ecj ECJ_SRC=$(ECJ_BASE)/OSGI-OPT/src -BNDLIB_BASE=$(BOOTSTRAP_BASE)/bndlib +BNDLIB_BASE=./bndlib BNDLIB_SRC=$(BNDLIB_BASE)/OSGI-OPT/src OSGI_BASE=$(BOOTSTRAP_BASE)/osgi @@ -27,33 +27,6 @@ $(ORIGIN_BASE)/org.osgi/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar \ $(ORIGIN_BASE)/org.osgi/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar \ $(ORIGIN_BASE)/org.slf4j/slf4j-api-$(SLF4J_VERSION)-sources.jar \ $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz - - -bootstrap-download-sources: $(SOURCE_ARCHIVES) - -$(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar: - mkdir -p $(ORIGIN_BASE) - wget -c -O $(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar https://ftp-stud.hs-esslingen.de/Mirrors/eclipse/eclipse/downloads/drops4/R-4.26-202211231800/ecjsrc-$(ECJ_VERSION).jar - -$(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz: - mkdir -p $(ORIGIN_BASE) - wget -c -O $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz https://github.com/bndtools/bnd/archive/refs/tags/$(BND_VERSION).REL.tar.gz - -$(ORIGIN_BASE)/org.osgi/osgi.core-$(OSGI_CORE_VERSION)-sources.jar: - mkdir -p $(ORIGIN_BASE)/org.osgi - wget -c -O $(ORIGIN_BASE)/org.osgi/osgi.core-$(OSGI_CORE_VERSION)-sources.jar https://repo1.maven.org/maven2/org/osgi/osgi.core/$(OSGI_CORE_VERSION)/osgi.core-$(OSGI_CORE_VERSION)-sources.jar - -$(ORIGIN_BASE)/org.osgi/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar: - mkdir -p $(ORIGIN_BASE)/org.osgi - wget -c -O $(ORIGIN_BASE)/org.osgi/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar https://repo1.maven.org/maven2/org/osgi/osgi.cmpn/$(OSGI_CMPN_VERSION)/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar - -$(ORIGIN_BASE)/org.osgi/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar: - mkdir -p $(ORIGIN_BASE)/org.osgi - wget -c -O $(ORIGIN_BASE)/org.osgi/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar https://repo1.maven.org/maven2/org/osgi/osgi.annotation/$(OSGI_ANNOTATION_VERSION)/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar - -$(ORIGIN_BASE)/org.slf4j/slf4j-api-$(SLF4J_VERSION)-sources.jar: - mkdir -p $(ORIGIN_BASE)/org.slf4j - wget -c -O $(ORIGIN_BASE)/org.slf4j/slf4j-api-$(SLF4J_VERSION)-sources.jar https://repo1.maven.org/maven2/org/slf4j/slf4j-api/$(SLF4J_VERSION)/slf4j-api-$(SLF4J_VERSION)-sources.jar all: ecj-build bndlib-build make -C org.argeo.tp.build all @@ -61,6 +34,30 @@ all: ecj-build bndlib-build ecj: ecj-build ecj-build: + # list sources + find $(ECJ_BASE)/org | grep "\.java" > $(BOOTSTRAP_BASE)/ecj.todo + # copy sources + mkdir -p $(ECJ_SRC) + cp -r $(ECJ_BASE)/org $(ECJ_SRC) + # build + $(JAVA_HOME)/bin/javac -d $(ECJ_BASE) -source 17 -target 17 -Xlint:none @$(BOOTSTRAP_BASE)/ecj.todo + # remove sources + cd $(ECJ_BASE) && find . -name "*.java" -name "*.html" -type f -exec rm -f {} \; + +bndlib-build: + $(JAVA_HOME)/bin/java -cp $(ECJ_BASE) org.eclipse.jdt.internal.compiler.batch.Main -nowarn \ + -source 17 -target 17 \ + $(BNDLIB_SRC) \ + -d $(BNDLIB_BASE) + +clean: + $(RM) -rf $(BOOTSTRAP_BASE) + $(RM) -rf $(ECJ_BASE) + $(RM) -rf $(BNDLIB_BASE) + make -C org.argeo.tp.build clean + +bootstrap-prepare-source-tarball: bootstrap-download-sources + ## ECJ mkdir -p $(ECJ_BASE) cd $(ECJ_BASE) && jar -xf $(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar # remove ant-dependent class @@ -72,32 +69,17 @@ ecj-build: $(RM) -rf $(ECJ_BASE)/scripts # TODO: keep the service files $(RM) -rf $(ECJ_BASE)/META-INF - # list sources - find $(ECJ_BASE)/org | grep "\.java" > $(BOOTSTRAP_BASE)/ecj.todo - # copy sources - mkdir -p $(ECJ_SRC) - cp -r $(ECJ_BASE)/org $(ECJ_SRC) - # build - $(JAVA_HOME)/bin/javac -d $(ECJ_BASE) -source 17 -target 17 -Xlint:none @$(BOOTSTRAP_BASE)/ecj.todo - # remove sources - cd $(ECJ_BASE) && find . -name "*.java" -name "*.html" -type f -exec rm -f {} \; -bndlib-build: + ## BNDLIB # copy sources + mkdir -p $(BOOTSTRAP_BASE) cd $(BOOTSTRAP_BASE) && tar -xzf $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz mkdir -p $(BNDLIB_SRC) cp -r $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL/aQute.libg/src/* $(BNDLIB_SRC) cp -r $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL/biz.aQute.bndlib/src/* $(BNDLIB_SRC) cp -r $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL/biz.aQute.bnd.annotation/src/* $(BNDLIB_SRC) - $(RM) -rf $(BNDLIB_SRC)/aQute/bnd/annotation/spi $(RM) -rf $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL - - # SLF4J - cd $(BNDLIB_SRC) && jar -xf $(ORIGIN_BASE)/org.slf4j/slf4j-api-$(SLF4J_VERSION)-sources.jar - $(RM) -rf $(BNDLIB_SRC)/META-INF - #rm -rf $(BNDLIB_SRC)/org/slf4j/impl - cp -rv ../rebuild/org.argeo.tp/org.argeo.ext.slf4j/src/* $(BNDLIB_SRC) - + # OSGi mkdir -p $(OSGI_BASE) cd $(OSGI_BASE) && jar -xf $(ORIGIN_BASE)/org.osgi/osgi.core-$(OSGI_CORE_VERSION)-sources.jar @@ -113,20 +95,45 @@ bndlib-build: cp -r $(OSGI_BASE)/org/osgi/dto $(BNDLIB_SRC)/org/osgi cp -r $(OSGI_BASE)/org/osgi/service/repository $(BNDLIB_SRC)/org/osgi/service cp -r $(OSGI_BASE)/org/osgi/service/log $(BNDLIB_SRC)/org/osgi/service + + # SLF4J + cd $(BNDLIB_SRC) && jar -xf $(ORIGIN_BASE)/org.slf4j/slf4j-api-$(SLF4J_VERSION)-sources.jar + $(RM) -rf $(BNDLIB_SRC)/META-INF + cp -rv ../rebuild/org.argeo.tp/org.argeo.ext.slf4j/src/* $(BNDLIB_SRC) + + # clean up BNDLIB + $(RM) -rf $(BNDLIB_SRC)/aQute/bnd/annotation/spi + $(RM) -rf $(BNDLIB_SRC)/aQute/bnd/junit + + tar -cf ../argeo-tp-build_$(ECJ_VERSION).orig.tar $(ECJ_BASE) + tar -rf ../argeo-tp-build_$(ECJ_VERSION).orig.tar $(BNDLIB_BASE) + xz -f ../argeo-tp-build_$(ECJ_VERSION).orig.tar + +bootstrap-download-sources: $(SOURCE_ARCHIVES) + +$(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar: + mkdir -p $(ORIGIN_BASE) + wget -c -O $(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar https://ftp-stud.hs-esslingen.de/Mirrors/eclipse/eclipse/downloads/drops4/R-4.26-202211231800/ecjsrc-$(ECJ_VERSION).jar - # clean up - rm -rf $(BNDLIB_SRC)/aQute/bnd/junit - - # build - $(JAVA_HOME)/bin/java -cp $(ECJ_BASE) org.eclipse.jdt.internal.compiler.batch.Main -nowarn \ - -source 17 -target 17 \ - $(BNDLIB_SRC) \ - -d $(BNDLIB_BASE) +$(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz: + mkdir -p $(ORIGIN_BASE) + wget -c -O $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz https://github.com/bndtools/bnd/archive/refs/tags/$(BND_VERSION).REL.tar.gz - # remove classes - #rm -rf $(BNDLIB_SRC)/org/slf4j/impl - #rm -rf $(BNDLIB_BASE)/org/slf4j/impl +$(ORIGIN_BASE)/org.osgi/osgi.core-$(OSGI_CORE_VERSION)-sources.jar: + mkdir -p $(ORIGIN_BASE)/org.osgi + wget -c -O $(ORIGIN_BASE)/org.osgi/osgi.core-$(OSGI_CORE_VERSION)-sources.jar https://repo1.maven.org/maven2/org/osgi/osgi.core/$(OSGI_CORE_VERSION)/osgi.core-$(OSGI_CORE_VERSION)-sources.jar -clean: - rm -rf $(BOOTSTRAP_BASE) - make -C org.argeo.tp.build clean +$(ORIGIN_BASE)/org.osgi/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar: + mkdir -p $(ORIGIN_BASE)/org.osgi + wget -c -O $(ORIGIN_BASE)/org.osgi/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar https://repo1.maven.org/maven2/org/osgi/osgi.cmpn/$(OSGI_CMPN_VERSION)/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar + +$(ORIGIN_BASE)/org.osgi/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar: + mkdir -p $(ORIGIN_BASE)/org.osgi + wget -c -O $(ORIGIN_BASE)/org.osgi/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar https://repo1.maven.org/maven2/org/osgi/osgi.annotation/$(OSGI_ANNOTATION_VERSION)/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar + +$(ORIGIN_BASE)/org.slf4j/slf4j-api-$(SLF4J_VERSION)-sources.jar: + mkdir -p $(ORIGIN_BASE)/org.slf4j + wget -c -O $(ORIGIN_BASE)/org.slf4j/slf4j-api-$(SLF4J_VERSION)-sources.jar https://repo1.maven.org/maven2/org/slf4j/slf4j-api/$(SLF4J_VERSION)/slf4j-api-$(SLF4J_VERSION)-sources.jar + + + diff --git a/bootstrap/debian/argeo-tp-build.install b/bootstrap/debian/argeo-tp-build.install new file mode 100644 index 0000000..bd038cb --- /dev/null +++ b/bootstrap/debian/argeo-tp-build.install @@ -0,0 +1 @@ +output/a2/org.argeo.tp.build/*.jar /usr/share/a2/org.argeo.tp.build \ No newline at end of file diff --git a/bootstrap/debian/changelog b/bootstrap/debian/changelog new file mode 100644 index 0000000..83914c5 --- /dev/null +++ b/bootstrap/debian/changelog @@ -0,0 +1,5 @@ +argeo-tp-build (4.26-1) unstable; urgency=medium + + * Initial release + + -- Mathieu Baudier Fri, 10 Mar 2023 08:27:26 +0100 diff --git a/bootstrap/debian/control b/bootstrap/debian/control new file mode 100644 index 0000000..39873ac --- /dev/null +++ b/bootstrap/debian/control @@ -0,0 +1,13 @@ +Source: argeo-tp-build +Section: unknown +Priority: optional +Maintainer: Mathieu Baudier +Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.5.1 +Rules-Requires-Root: no + +Package: argeo-tp-build +Architecture: all +Depends: ${misc:Depends} +Description: Argeo Build third party libraries + Eclipse ECJ compiler and BND library. \ No newline at end of file diff --git a/bootstrap/debian/copyright b/bootstrap/debian/copyright new file mode 100644 index 0000000..13bb2ba --- /dev/null +++ b/bootstrap/debian/copyright @@ -0,0 +1,4 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ + +Files: * +License: EPL-2.0 diff --git a/bootstrap/debian/rules b/bootstrap/debian/rules new file mode 100755 index 0000000..2d33f6a --- /dev/null +++ b/bootstrap/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ diff --git a/bootstrap/debian/source/format b/bootstrap/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/bootstrap/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/bootstrap/org.argeo.tp.build/biz.aQute.bndlib/bnd.bnd b/bootstrap/org.argeo.tp.build/biz.aQute.bndlib/bnd.bnd index 47a7051..f8284c1 100644 --- a/bootstrap/org.argeo.tp.build/biz.aQute.bndlib/bnd.bnd +++ b/bootstrap/org.argeo.tp.build/biz.aQute.bndlib/bnd.bnd @@ -3,5 +3,5 @@ minor: 3 micro: 0 qualifier: -Bundle-License: Apache-2.0 +Bundle-License: EPL-2.0 Export-Package: aQute.* \ No newline at end of file -- 2.30.2