author | herrick |
Wed, 14 Aug 2019 07:50:54 -0400 | |
branch | JDK-8200758-branch |
changeset 57742 | e3d4b9bc5093 |
parent 57741 | 38856ef4a19c |
child 57750 | 1a9e496d54d2 |
permissions | -rw-r--r-- |
57038 | 1 |
Summary: APPLICATION_SUMMARY |
2 |
Name: APPLICATION_PACKAGE |
|
3 |
Version: APPLICATION_VERSION |
|
57741
38856ef4a19c
8229138: Add --linux-app-release option for DEB and RPM packages
herrick
parents:
57256
diff
changeset
|
4 |
Release: APPLICATION_RELEASE |
57038 | 5 |
License: APPLICATION_LICENSE_TYPE |
6 |
Vendor: APPLICATION_VENDOR |
|
7 |
Prefix: INSTALLATION_DIRECTORY |
|
8 |
Provides: APPLICATION_PACKAGE |
|
9 |
Autoprov: 0 |
|
10 |
Autoreq: 0 |
|
11 |
PACKAGE_DEPENDENCIES |
|
12 |
||
13 |
#avoid ARCH subfolder |
|
14 |
%define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm |
|
15 |
||
16 |
#comment line below to enable effective jar compression |
|
17 |
#it could easily get your package size from 40 to 15Mb but |
|
18 |
#build time will substantially increase and it may require unpack200/system java to install |
|
19 |
%define __jar_repack %{nil} |
|
20 |
||
21 |
%description |
|
22 |
APPLICATION_DESCRIPTION |
|
23 |
||
24 |
%prep |
|
25 |
||
26 |
%build |
|
27 |
||
28 |
%install |
|
29 |
rm -rf %{buildroot} |
|
30 |
mkdir -p %{buildroot}INSTALLATION_DIRECTORY |
|
31 |
cp -r %{_sourcedir}/APPLICATION_FS_NAME %{buildroot}INSTALLATION_DIRECTORY |
|
57742
e3d4b9bc5093
8215447: Investigate if current implementation of --license-file is correct for RPM packages
herrick
parents:
57741
diff
changeset
|
32 |
%if "xAPPLICATION_LICENSE_FILE" != x |
e3d4b9bc5093
8215447: Investigate if current implementation of --license-file is correct for RPM packages
herrick
parents:
57741
diff
changeset
|
33 |
%define license_install_file %{_defaultlicensedir}/%{name}-%{version}/%{basename:APPLICATION_LICENSE_FILE} |
e3d4b9bc5093
8215447: Investigate if current implementation of --license-file is correct for RPM packages
herrick
parents:
57741
diff
changeset
|
34 |
install -d -m 755 %{buildroot}%{dirname:%{license_install_file}} |
e3d4b9bc5093
8215447: Investigate if current implementation of --license-file is correct for RPM packages
herrick
parents:
57741
diff
changeset
|
35 |
install -m 644 APPLICATION_LICENSE_FILE %{buildroot}%{license_install_file} |
e3d4b9bc5093
8215447: Investigate if current implementation of --license-file is correct for RPM packages
herrick
parents:
57741
diff
changeset
|
36 |
%endif |
e3d4b9bc5093
8215447: Investigate if current implementation of --license-file is correct for RPM packages
herrick
parents:
57741
diff
changeset
|
37 |
|
57038 | 38 |
%files |
57742
e3d4b9bc5093
8215447: Investigate if current implementation of --license-file is correct for RPM packages
herrick
parents:
57741
diff
changeset
|
39 |
+%{?license_install_file:%license %{license_install_file}} |
57038 | 40 |
INSTALLATION_DIRECTORY/APPLICATION_FS_NAME |
41 |
||
42 |
%post |
|
57150 | 43 |
if [ "RUNTIME_INSTALLER" != "true" ]; then |
57256 | 44 |
ADD_LAUNCHERS_INSTALL |
57038 | 45 |
xdg-desktop-menu install --novendor INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop |
46 |
FILE_ASSOCIATION_INSTALL |
|
47 |
fi |
|
48 |
||
49 |
%preun |
|
57150 | 50 |
if [ "RUNTIME_INSTALLER" != "true" ]; then |
57256 | 51 |
ADD_LAUNCHERS_REMOVE |
57038 | 52 |
xdg-desktop-menu uninstall --novendor INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop |
53 |
FILE_ASSOCIATION_REMOVE |
|
54 |
fi |
|
55 |
if [ "SERVICE_HINT" = "true" ]; then |
|
56 |
if [ -x "/etc/init.d/APPLICATION_PACKAGE" ]; then |
|
57 |
if [ "STOP_ON_UNINSTALL" = "true" ]; then |
|
58 |
/etc/init.d/APPLICATION_PACKAGE stop |
|
59 |
fi |
|
60 |
/sbin/chkconfig --del APPLICATION_PACKAGE |
|
61 |
rm -f /etc/init.d/APPLICATION_PACKAGE |
|
62 |
fi |
|
63 |
fi |
|
64 |
||
65 |
%clean |