Welcome to mirror list, hosted at ThFree Co, Russian Federation.

code.spec.template « rpm « linux « resources - github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 00ddb6fdf08f2a3096ade7c52b1b252c4c7f7a24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Name:     @@NAME@@
Version:  @@VERSION@@
Release:  @@RELEASE@@.el7
Summary:  Code editing. Redefined.
Group:    Development/Tools
Vendor:   Microsoft Corporation
Packager: Visual Studio Code Team <vscode-linux@microsoft.com>
License:  @@LICENSE@@
URL:      https://code.visualstudio.com/
Icon:     @@NAME@@.xpm
Requires: @@DEPENDENCIES@@
AutoReq:  0

%global __provides_exclude_from ^%{_datadir}/@@NAME@@/.*\\.so.*$

%description
Visual Studio Code is a new choice of tool that combines the simplicity of a code editor with what developers need for the core edit-build-debug cycle. See https://code.visualstudio.com/docs/setup/linux for installation instructions and FAQ.

# Don't generate build_id links to prevent conflicts when installing multiple
# versions of VS Code alongside each other (e.g. `code` and `code-insiders`)
%define _build_id_links none

%install
mkdir -p %{buildroot}/usr/bin
mkdir -p %{buildroot}/usr/share/@@NAME@@
mkdir -p %{buildroot}/usr/share/applications
mkdir -p %{buildroot}/usr/share/pixmaps
mkdir -p %{buildroot}/usr/share/bash-completion/completions
mkdir -p %{buildroot}/usr/share/zsh/site-functions
mkdir -p %{buildroot}/usr/share/mime/packages
cp -r usr/share/@@NAME@@/* %{buildroot}/usr/share/@@NAME@@
cp -r usr/share/applications/@@NAME@@.desktop %{buildroot}/usr/share/applications
cp -r usr/share/applications/@@NAME@@-url-handler.desktop %{buildroot}/usr/share/applications
cp -r usr/share/mime/packages/@@NAME@@-workspace.xml %{buildroot}/usr/share/mime/packages/@@NAME@@-workspace.xml
cp -r usr/share/pixmaps/@@ICON@@.png %{buildroot}/usr/share/pixmaps
cp usr/share/bash-completion/completions/@@NAME@@ %{buildroot}/usr/share/bash-completion/completions/@@NAME@@
cp usr/share/zsh/site-functions/_@@NAME@@ %{buildroot}/usr/share/zsh/site-functions/_@@NAME@@
ln -s ../share/@@NAME@@/bin/@@NAME@@ %{buildroot}/usr/bin/@@NAME@@

%post
# Remove the legacy bin command if this is the stable build
if [ "@@NAME@@" = "code" ]; then
	rm -f /usr/local/bin/code
fi

# Register yum repository
# TODO: #229: Enable once the yum repository is signed
#if [ "@@NAME@@" != "code-oss" ]; then
#	if [ -d "/etc/yum.repos.d" ]; then
#		REPO_FILE=/etc/yum.repos.d/@@NAME@@.repo
#		rm -f $REPO_FILE
#		echo -e "[@@NAME@@]\nname=@@NAME_LONG@@\nbaseurl=@@UPDATEURL@@/api/rpm/@@QUALITY@@/@@ARCHITECTURE@@/rpm" > $REPO_FILE
#	fi
#fi

# Update mimetype database to pickup workspace mimetype
update-mime-database /usr/share/mime &> /dev/null || :

%postun
# Update mimetype database for removed workspace mimetype
update-mime-database /usr/share/mime &> /dev/null || :

%files
%defattr(-,root,root)
%attr(4755, root, root) /usr/share/@@NAME@@/chrome-sandbox

/usr/bin/@@NAME@@
/usr/share/@@NAME@@/
/usr/share/applications/@@NAME@@.desktop
/usr/share/applications/@@NAME@@-url-handler.desktop
/usr/share/mime/packages/@@NAME@@-workspace.xml
/usr/share/pixmaps/@@ICON@@.png
/usr/share/bash-completion/completions/@@NAME@@
/usr/share/zsh/site-functions/_@@NAME@@