src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.spec
author herrick
Tue, 09 Apr 2019 10:57:04 -0400
branchJDK-8200758-branch
changeset 57314 23da9e6f446f
parent 57256 d7c27451f759
child 57741 38856ef4a19c
permissions -rw-r--r--
8221641: Follow up code clean up for JDK-8221582 Reviewed-by: almatvee

Summary: APPLICATION_SUMMARY
Name: APPLICATION_PACKAGE
Version: APPLICATION_VERSION
Release: 1
License: APPLICATION_LICENSE_TYPE
Vendor: APPLICATION_VENDOR
Prefix: INSTALLATION_DIRECTORY
Provides: APPLICATION_PACKAGE
Autoprov: 0
Autoreq: 0
PACKAGE_DEPENDENCIES

#avoid ARCH subfolder
%define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm

#comment line below to enable effective jar compression
#it could easily get your package size from 40 to 15Mb but 
#build time will substantially increase and it may require unpack200/system java to install
%define __jar_repack %{nil}

%description
APPLICATION_DESCRIPTION

%prep

%build

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}INSTALLATION_DIRECTORY
cp -r %{_sourcedir}/APPLICATION_FS_NAME %{buildroot}INSTALLATION_DIRECTORY

%files
APPLICATION_LICENSE_FILE
INSTALLATION_DIRECTORY/APPLICATION_FS_NAME

%post
if [ "RUNTIME_INSTALLER" != "true" ]; then
ADD_LAUNCHERS_INSTALL
    xdg-desktop-menu install --novendor INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop
FILE_ASSOCIATION_INSTALL
fi

%preun
if [ "RUNTIME_INSTALLER" != "true" ]; then
ADD_LAUNCHERS_REMOVE
    xdg-desktop-menu uninstall --novendor INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop
FILE_ASSOCIATION_REMOVE
fi
if [ "SERVICE_HINT" = "true" ]; then
    if [ -x "/etc/init.d/APPLICATION_PACKAGE" ]; then
        if [ "STOP_ON_UNINSTALL" = "true" ]; then
            /etc/init.d/APPLICATION_PACKAGE stop
        fi
        /sbin/chkconfig --del APPLICATION_PACKAGE
        rm -f /etc/init.d/APPLICATION_PACKAGE
    fi
fi

%clean