Start TP Build Debian packaging
authorMathieu <mbaudier@argeo.org>
Fri, 10 Mar 2023 08:21:39 +0000 (09:21 +0100)
committerMathieu <mbaudier@argeo.org>
Fri, 10 Mar 2023 08:21:39 +0000 (09:21 +0100)
.gitignore
bootstrap/.gitignore [new file with mode: 0644]
bootstrap/Makefile
bootstrap/debian/argeo-tp-build.install [new file with mode: 0644]
bootstrap/debian/changelog [new file with mode: 0644]
bootstrap/debian/control [new file with mode: 0644]
bootstrap/debian/copyright [new file with mode: 0644]
bootstrap/debian/rules [new file with mode: 0755]
bootstrap/debian/source/format [new file with mode: 0644]
bootstrap/org.argeo.tp.build/biz.aQute.bndlib/bnd.bnd

index 2f26f165df281ba8f5b6f161e59db7144d11551b..e29319b8d6c181dbac508f8e8308a995a303775f 100644 (file)
@@ -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 (file)
index 0000000..9671c65
--- /dev/null
@@ -0,0 +1,2 @@
+/ecj/
+/bndlib/
index 8029b42fa3e2f30f4de103ba6efaa23000d7814d..12514c64d6c36b1666a19b22119a2d8f4309bafd 100644 (file)
@@ -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 (file)
index 0000000..bd038cb
--- /dev/null
@@ -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 (file)
index 0000000..83914c5
--- /dev/null
@@ -0,0 +1,5 @@
+argeo-tp-build (4.26-1) unstable; urgency=medium
+
+  * Initial release
+
+ -- Mathieu Baudier <mbaudier@argeo.org>  Fri, 10 Mar 2023 08:27:26 +0100
diff --git a/bootstrap/debian/control b/bootstrap/debian/control
new file mode 100644 (file)
index 0000000..39873ac
--- /dev/null
@@ -0,0 +1,13 @@
+Source: argeo-tp-build
+Section: unknown
+Priority: optional
+Maintainer: Mathieu Baudier <mbaudier@argeo.org>
+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 (file)
index 0000000..13bb2ba
--- /dev/null
@@ -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 (executable)
index 0000000..2d33f6a
--- /dev/null
@@ -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 (file)
index 0000000..163aaf8
--- /dev/null
@@ -0,0 +1 @@
+3.0 (quilt)
index 47a70518cca9b47517a0db371fbd3d4147d8cbc1..f8284c161550a7b2d600d67468742c806606eaf9 100644 (file)
@@ -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