undo inclusion of jar in jar - does not work
Stefan Schuermans

Stefan Schuermans commited on 2011-09-10 17:54:40
Showing 2 changed files, with 16 additions and 6 deletions.

... ...
@@ -1,3 +1,3 @@
1 1
 Manifest-Version: 1.0
2 2
 Main-Class: org.blinkenarea.Blimp.Blimp
3
-Class-Path: BlinkenLib.jar
3
+
... ...
@@ -58,13 +58,23 @@ $(P)/Version.java: Makefile
58 58
 %.class: %.java
59 59
 	$(JAVAC) -classpath $(CLASSPATH) $<
60 60
 
61
-BlinkenLib.jar: $(BLINKEN_LIB)
62
-	ln -s $< $@
63
-
64 61
 Blimp.keystore:
65 62
 	$(KEYTOOL) -genkey -alias Blimp -dname CN=Blimp,O=blinkenarea,C=org -keypass $(KEYPASS) -keystore Blimp.keystore -storepass $(KEYPASS) -dname cn=Blimp -validity 3652
66 63
 
67
-Blimp.jar: Blimp.mf Blimp.keystore BlinkenLib.jar $(CLASS_FILES) $(IMAGE_FILES)
68
-	$(JAR) cmf Blimp.mf Blimp.jar $(CLASS_FILES) $(IMAGE_FILES)
64
+Blimp.jar: Blimp.mf Blimp.keystore $(CLASS_FILES) $(IMAGE_FILES)
65
+	rm -rf tmp
66
+	mkdir tmp
67
+	for FILE in $(CLASS_FILES) $(IMAGE_FILES); \
68
+	  do \
69
+	    mkdir -p tmp/$$(dirname $$FILE) || exit; \
70
+	    cp $$FILE tmp/$$FILE || exit; \
71
+	  done
72
+	for JAR in $(filter %.jar,$(subst :, ,$(CLASSPATH))); \
73
+	  do \
74
+	    cd tmp; $(JAR) xf ../$$JAR || exit; \
75
+	    rm -rf META-INF; \
76
+	  done
77
+	cd tmp; $(JAR) cmf ../Blimp.mf ../Blimp.jar .
78
+	rm -rf tmp
69 79
 	$(JARSIGNER) -keystore Blimp.keystore -storepass $(KEYPASS) Blimp.jar Blimp
70 80
 
71 81