Skip to content

Commit e12c374

Browse files
committed
Merge pull request apache#433 from markhamstra/debFix
Updated Debian packaging (cherry picked from commit 494d3c0) Signed-off-by: Patrick Wendell <pwendell@gmail.com>
1 parent 2f015c2 commit e12c374

File tree

9 files changed

+120
-298
lines changed

9 files changed

+120
-298
lines changed

assembly/pom.xml

Lines changed: 115 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
<name>Spark Project Assembly</name>
3131
<url>http://spark.incubator.apache.org/</url>
3232

33+
<properties>
34+
<spark.jar>${project.build.directory}/scala-${scala.binary.version}/${project.artifactId}-${project.version}-hadoop${hadoop.version}.jar</spark.jar>
35+
<deb.pkg.name>spark</deb.pkg.name>
36+
<deb.install.path>/usr/share/spark</deb.install.path>
37+
<deb.user>root</deb.user>
38+
</properties>
39+
3340
<repositories>
3441
<!-- A repository in the local filesystem for the Py4J JAR, which is not in Maven central -->
3542
<repository>
@@ -79,7 +86,7 @@
7986
<artifactId>maven-shade-plugin</artifactId>
8087
<configuration>
8188
<shadedArtifactAttached>false</shadedArtifactAttached>
82-
<outputFile>${project.build.directory}/scala-${scala.binary.version}/${project.artifactId}-${project.version}-hadoop${hadoop.version}.jar</outputFile>
89+
<outputFile>${spark.jar}</outputFile>
8390
<artifactSet>
8491
<includes>
8592
<include>*:*</include>
@@ -171,5 +178,112 @@
171178
</plugins>
172179
</build>
173180
</profile>
181+
<profile>
182+
<id>deb</id>
183+
<build>
184+
<plugins>
185+
<plugin>
186+
<groupId>org.codehaus.mojo</groupId>
187+
<artifactId>buildnumber-maven-plugin</artifactId>
188+
<version>1.1</version>
189+
<executions>
190+
<execution>
191+
<phase>validate</phase>
192+
<goals>
193+
<goal>create</goal>
194+
</goals>
195+
<configuration>
196+
<shortRevisionLength>8</shortRevisionLength>
197+
</configuration>
198+
</execution>
199+
</executions>
200+
</plugin>
201+
<plugin>
202+
<groupId>org.vafer</groupId>
203+
<artifactId>jdeb</artifactId>
204+
<version>0.11</version>
205+
<executions>
206+
<execution>
207+
<phase>package</phase>
208+
<goals>
209+
<goal>jdeb</goal>
210+
</goals>
211+
<configuration>
212+
<deb>${project.build.directory}/${deb.pkg.name}_${project.version}-${buildNumber}_all.deb</deb>
213+
<attach>false</attach>
214+
<compression>gzip</compression>
215+
<dataSet>
216+
<data>
217+
<src>${spark.jar}</src>
218+
<type>file</type>
219+
<mapper>
220+
<type>perm</type>
221+
<user>${deb.user}</user>
222+
<group>${deb.user}</group>
223+
<prefix>${deb.install.path}/jars</prefix>
224+
</mapper>
225+
</data>
226+
<data>
227+
<src>${basedir}/src/deb/RELEASE</src>
228+
<type>file</type>
229+
<mapper>
230+
<type>perm</type>
231+
<user>${deb.user}</user>
232+
<group>${deb.user}</group>
233+
<prefix>${deb.install.path}</prefix>
234+
</mapper>
235+
</data>
236+
<data>
237+
<src>${basedir}/../conf</src>
238+
<type>directory</type>
239+
<mapper>
240+
<type>perm</type>
241+
<user>${deb.user}</user>
242+
<group>${deb.user}</group>
243+
<prefix>${deb.install.path}/conf</prefix>
244+
<filemode>744</filemode>
245+
</mapper>
246+
</data>
247+
<data>
248+
<src>${basedir}/../bin</src>
249+
<type>directory</type>
250+
<mapper>
251+
<type>perm</type>
252+
<user>${deb.user}</user>
253+
<group>${deb.user}</group>
254+
<prefix>${deb.install.path}/bin</prefix>
255+
<filemode>744</filemode>
256+
</mapper>
257+
</data>
258+
<data>
259+
<src>${basedir}/../sbin</src>
260+
<type>directory</type>
261+
<mapper>
262+
<type>perm</type>
263+
<user>${deb.user}</user>
264+
<group>${deb.user}</group>
265+
<prefix>${deb.install.path}/sbin</prefix>
266+
<filemode>744</filemode>
267+
</mapper>
268+
</data>
269+
<data>
270+
<src>${basedir}/../python</src>
271+
<type>directory</type>
272+
<mapper>
273+
<type>perm</type>
274+
<user>${deb.user}</user>
275+
<group>${deb.user}</group>
276+
<prefix>${deb.install.path}/python</prefix>
277+
<filemode>744</filemode>
278+
</mapper>
279+
</data>
280+
</dataSet>
281+
</configuration>
282+
</execution>
283+
</executions>
284+
</plugin>
285+
</plugins>
286+
</build>
287+
</profile>
174288
</profiles>
175289
</project>

assembly/src/deb/RELEASE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
compute-classpath.sh uses the existence of this file to decide whether to put the assembly jar on the
2+
classpath or instead to use classfiles in the source tree.
File renamed without changes.

docs/building-with-maven.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ This setup works fine in IntelliJ IDEA 11.1.4. After opening the project via the
7171

7272
## Building Spark Debian Packages ##
7373

74-
It includes support for building a Debian package containing a 'fat-jar' which includes the repl, the examples and bagel. This can be created by specifying the following profiles:
74+
The maven build includes support for building a Debian package containing the assembly 'fat-jar', PySpark, and the necessary scripts and configuration files. This can be created by specifying the following:
7575

76-
$ mvn -Prepl-bin -Pdeb clean package
76+
$ mvn -Pdeb -DskipTests clean package
7777

78-
The debian package can then be found under repl/target. We added the short commit hash to the file name so that we can distinguish individual packages build for SNAPSHOT versions.
78+
The debian package can then be found under assembly/target. We added the short commit hash to the file name so that we can distinguish individual packages built for SNAPSHOT versions.

pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -762,15 +762,5 @@
762762
</modules>
763763

764764
</profile>
765-
766-
<profile>
767-
<id>repl-bin</id>
768-
<activation>
769-
<activeByDefault>false</activeByDefault>
770-
</activation>
771-
<modules>
772-
<module>repl-bin</module>
773-
</modules>
774-
</profile>
775765
</profiles>
776766
</project>

repl-bin/pom.xml

Lines changed: 0 additions & 184 deletions
This file was deleted.

0 commit comments

Comments
 (0)