@@ -255,16 +255,16 @@ function prepareDebPackage(arch) {
255255 var packageRevision = getEpochTime ( ) ;
256256
257257 return function ( ) {
258- var shortcut = gulp . src ( 'resources/linux/bin/code.sh' )
258+ var shortcut = gulp . src ( 'resources/linux/bin/code.sh' , { base : '.' } )
259259 . pipe ( replace ( '@@NAME@@' , product . applicationName ) )
260260 . pipe ( rename ( 'usr/bin/' + product . applicationName ) ) ;
261261
262- var desktop = gulp . src ( 'resources/linux/debian/ code.desktop' )
262+ var desktop = gulp . src ( 'resources/linux/code.desktop' , { base : '.' } )
263263 . pipe ( replace ( '@@NAME_LONG@@' , product . nameLong ) )
264264 . pipe ( replace ( '@@NAME@@' , product . applicationName ) )
265265 . pipe ( rename ( 'usr/share/applications/' + product . applicationName + '.desktop' ) ) ;
266266
267- var icon = gulp . src ( 'resources/linux/code.png' )
267+ var icon = gulp . src ( 'resources/linux/code.png' , { base : '.' } )
268268 . pipe ( rename ( 'usr/share/pixmaps/' + product . applicationName + '.png' ) ) ;
269269
270270 var code = gulp . src ( binaryDir + '/**/*' , { base : binaryDir } )
@@ -306,8 +306,7 @@ function prepareDebPackage(arch) {
306306 all = es . merge ( all , postinst ) ;
307307 }
308308
309- return all
310- . pipe ( symdest ( destination ) ) ;
309+ return all . pipe ( symdest ( destination ) ) ;
311310 } ;
312311}
313312
@@ -320,13 +319,59 @@ function buildDebPackage(arch) {
320319 ] , { cwd : '.build/linux/' + debArch } ) ;
321320}
322321
322+ function getRpmBuildPath ( ) {
323+ return path . join ( process . env [ 'HOME' ] , 'rpmbuild' ) ;
324+ }
325+
326+ function prepareRpmPackage ( arch ) {
327+ var binaryDir = '../VSCode-linux-' + arch ;
328+ var destination = process . env [ 'HOME' ] + '/rpmbuild' ;
329+ var packageRevision = getEpochTime ( ) ;
330+
331+ return function ( ) {
332+ var shortcut = gulp . src ( 'resources/linux/bin/code.sh' , { base : '.' } )
333+ . pipe ( replace ( '@@NAME@@' , product . applicationName ) )
334+ . pipe ( rename ( 'BUILD/usr/bin/' + product . applicationName ) ) ;
335+
336+ var desktop = gulp . src ( 'resources/linux/code.desktop' , { base : '.' } )
337+ . pipe ( replace ( '@@NAME_LONG@@' , product . nameLong ) )
338+ . pipe ( replace ( '@@NAME@@' , product . applicationName ) )
339+ . pipe ( rename ( 'BUILD/usr/share/applications/' + product . applicationName + '.desktop' ) ) ;
340+
341+ var icon = gulp . src ( 'resources/linux/code.png' , { base : '.' } )
342+ . pipe ( rename ( 'BUILD/usr/share/pixmaps/' + product . applicationName + '.png' ) ) ;
343+
344+ var code = gulp . src ( binaryDir + '/**/*' , { base : binaryDir } )
345+ . pipe ( rename ( function ( p ) { p . dirname = 'BUILD/usr/share/' + product . applicationName + '/' + p . dirname ; } ) ) ;
346+
347+ var spec = gulp . src ( 'resources/linux/rpm/code.spec.template' , { base : '.' } )
348+ . pipe ( replace ( '@@NAME@@' , product . applicationName ) )
349+ . pipe ( replace ( '@@VERSION@@' , packageJson . version ) )
350+ . pipe ( replace ( '@@RELEASE@@' , packageRevision ) )
351+ . pipe ( rename ( 'SPECS/' + product . applicationName + '.spec' ) ) ;
352+
353+ var all = es . merge ( code , desktop , icon , shortcut , spec ) ;
354+
355+ return all . pipe ( symdest ( destination ) ) ;
356+ }
357+ }
358+
359+ function buildRpmPackage ( ) {
360+ return shell . task ( [
361+ 'fakeroot rpmbuild -ba ' + getRpmBuildPath ( ) + '/SPECS/' + product . applicationName + '.spec' ,
362+ ] ) ;
363+ }
364+
323365gulp . task ( 'clean-vscode-win32' , util . rimraf ( path . join ( path . dirname ( root ) , 'VSCode-win32' ) ) ) ;
324366gulp . task ( 'clean-vscode-darwin' , util . rimraf ( path . join ( path . dirname ( root ) , 'VSCode-darwin' ) ) ) ;
325367gulp . task ( 'clean-vscode-linux-ia32' , util . rimraf ( path . join ( path . dirname ( root ) , 'VSCode-linux-ia32' ) ) ) ;
326368gulp . task ( 'clean-vscode-linux-x64' , util . rimraf ( path . join ( path . dirname ( root ) , 'VSCode-linux-x64' ) ) ) ;
327369gulp . task ( 'clean-vscode-linux-arm' , util . rimraf ( path . join ( path . dirname ( root ) , 'VSCode-linux-arm' ) ) ) ;
328370gulp . task ( 'clean-vscode-linux-ia32-deb' , util . rimraf ( '.build/linux/i386' ) ) ;
329371gulp . task ( 'clean-vscode-linux-x64-deb' , util . rimraf ( '.build/linux/amd64' ) ) ;
372+ gulp . task ( 'clean-vscode-linux-ia32-rpm' , util . rimraf ( '.build/linux/rpm/i386' ) ) ;
373+ gulp . task ( 'clean-vscode-linux-x64-rpm' , util . rimraf ( '.build/linux/rpm/x86_64' ) ) ;
374+ gulp . task ( 'clean-rpmbuild' , util . rimraf ( getRpmBuildPath ( ) ) ) ;
330375
331376gulp . task ( 'vscode-win32' , [ 'optimize-vscode' , 'clean-vscode-win32' ] , packageTask ( 'win32' ) ) ;
332377gulp . task ( 'vscode-darwin' , [ 'optimize-vscode' , 'clean-vscode-darwin' ] , packageTask ( 'darwin' ) ) ;
@@ -345,6 +390,11 @@ gulp.task('vscode-linux-x64-prepare-deb', ['clean-vscode-linux-x64-deb', 'vscode
345390gulp . task ( 'vscode-linux-ia32-build-deb' , [ 'vscode-linux-ia32-prepare-deb' ] , buildDebPackage ( 'ia32' ) ) ;
346391gulp . task ( 'vscode-linux-x64-build-deb' , [ 'vscode-linux-x64-prepare-deb' ] , buildDebPackage ( 'x64' ) ) ;
347392
393+ gulp . task ( 'vscode-linux-ia32-prepare-rpm' , [ 'clean-rpmbuild' , 'clean-vscode-linux-ia32-rpm' , 'vscode-linux-ia32-min' ] , prepareRpmPackage ( 'ia32' ) ) ;
394+ gulp . task ( 'vscode-linux-x64-prepare-rpm' , [ 'clean-rpmbuild' , 'clean-vscode-linux-x64-rpm' , 'vscode-linux-x64-min' ] , prepareRpmPackage ( 'x64' ) ) ;
395+ gulp . task ( 'vscode-linux-ia32-build-rpm' , [ 'vscode-linux-ia32-prepare-rpm' ] , buildRpmPackage ( ) ) ;
396+ gulp . task ( 'vscode-linux-x64-build-rpm' , [ 'vscode-linux-x64-prepare-rpm' ] , buildRpmPackage ( ) ) ;
397+
348398// Sourcemaps
349399
350400gulp . task ( 'upload-vscode-sourcemaps' , [ 'minify-vscode' ] , function ( ) {
0 commit comments