remove bootstrap.sh because it is no longer needed
Torsten Werner
14 years ago
0 | #!/bin/sh | |
1 | ||
2 | # This horror script is used to bootstrap maven-debian-helper. | |
3 | ||
4 | set -e | |
5 | ||
6 | JAVA_HOME=/usr/lib/jvm/java-6-openjdk | |
7 | REPO=/usr/share/maven-repo | |
8 | ODM=$REPO/org/debian/maven | |
9 | VERSION=$(dpkg-parsechangelog | sed -ne 's/Version: //p') | |
10 | DESTDIR=debian/maven-debian-helper | |
11 | ||
12 | boot() { | |
13 | PKG=org/apache/maven/project | |
14 | POM=$PKG/pom-4.0.0.xml | |
15 | DIR=maven-debian-helper/src/main/resources | |
16 | mkdir -p $PKG | |
17 | sed '/startworkaround/,/endworkaround/d' $DIR/$POM > $POM | |
18 | jar cf boot.jar org | |
19 | rm -rf org | |
20 | sed -e's,/.*/maven-debian-helper.jar,boot.jar,' \ | |
21 | -e's,org.debian.maven.Wrapper,org.apache.maven.cli.MavenCli,' \ | |
22 | etc/m2-debian.conf > boot.conf | |
23 | } | |
24 | ||
25 | scan() { | |
26 | P_ARCHIVER=$(ls $REPO/org/codehaus/plexus/plexus-archiver/) | |
27 | P_INTERPOLATION=$(ls $REPO/org/codehaus/plexus/plexus-interpolation/) | |
28 | M_RESOURCES_P=$(ls $REPO/org/apache/maven/plugins/maven-resources-plugin/) | |
29 | M_PLUGIN_P=$(ls $REPO/org/apache/maven/plugins/maven-plugin-plugin/) | |
30 | } | |
31 | ||
32 | maven() { | |
33 | $JAVA_HOME/bin/java -cp /usr/share/maven2/boot/classworlds.jar \ | |
34 | -D"classworlds.conf=boot.conf" org.codehaus.classworlds.Launcher \ | |
35 | -s"etc/settings-debian.xml" \ | |
36 | -D"org.codehaus.plexus.plexus-archiver.version=$P_ARCHIVER" \ | |
37 | -D"org.codehaus.plexus.plexus-interpolation.version=$P_INTERPOLATION" \ | |
38 | -D"org.apache.maven.plugins.maven-resources-plugin.version=$M_RESOURCES_P" \ | |
39 | -D"org.apache.maven.plugins.maven-plugin-plugin.version=$M_PLUGIN_P" \ | |
40 | "$@" | |
41 | } | |
42 | ||
43 | debian_install() { | |
44 | # parent pom | |
45 | install -D -m644 pom.xml \ | |
46 | $DESTDIR/$ODM/maven-debian/$VERSION/maven-debian-$VERSION.pom | |
47 | # maven-debian-helper | |
48 | dh_install -pmaven-debian-helper maven-debian-helper/target/*.jar \ | |
49 | $ODM/maven-debian-helper/$VERSION/ | |
50 | dh_link -pmaven-debian-helper \ | |
51 | $ODM/maven-debian-helper/$VERSION/maven-debian-helper-$VERSION.jar \ | |
52 | /usr/share/java/maven-debian-helper.jar | |
53 | install -D -m644 maven-debian-helper/pom.xml \ | |
54 | $DESTDIR/$ODM/maven-debian-helper/$VERSION/maven-debian-helper-$VERSION.pom | |
55 | # maven-debian-plugin | |
56 | dh_install -pmaven-debian-helper maven-debian-plugin/target/*.jar \ | |
57 | $ODM/maven-debian-plugin/$VERSION/ | |
58 | dh_link -pmaven-debian-helper \ | |
59 | $ODM/maven-debian-plugin/$VERSION/maven-debian-plugin-$VERSION.jar \ | |
60 | /usr/share/java/maven-debian-plugin.jar | |
61 | install -D -m644 maven-debian-plugin/pom.xml \ | |
62 | $DESTDIR/$ODM/maven-debian-plugin/$VERSION/maven-debian-plugin-$VERSION.pom | |
63 | } | |
64 | ||
65 | cleanup() { | |
66 | maven clean | |
67 | rm -f boot.jar boot.conf | |
68 | } | |
69 | ||
70 | boot | |
71 | scan | |
72 | maven package | |
73 | debian_install | |
74 | cleanup | |
75 |