1 Summary: APPLICATION_SUMMARY
   2 Name: APPLICATION_PACKAGE
   3 Version: APPLICATION_VERSION
   4 Release: APPLICATION_RELEASE
   5 License: APPLICATION_LICENSE_TYPE
   6 Vendor: APPLICATION_VENDOR
   7 Prefix: %{dirname:APPLICATION_DIRECTORY}
   8 Provides: APPLICATION_PACKAGE
   9 %if "xAPPLICATION_GROUP" != x
  10 Group: APPLICATION_GROUP
  11 %endif
  12 
  13 Autoprov: 0
  14 Autoreq: 0
  15 %if "xPACKAGE_DEPENDENCIES" != x
  16 Requires: PACKAGE_DEPENDENCIES
  17 %endif
  18 
  19 #avoid ARCH subfolder
  20 %define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
  21 
  22 #comment line below to enable effective jar compression
  23 #it could easily get your package size from 40 to 15Mb but
  24 #build time will substantially increase and it may require unpack200/system java to install
  25 %define __jar_repack %{nil}
  26 
  27 %description
  28 APPLICATION_DESCRIPTION
  29 
  30 %prep
  31 
  32 %build
  33 
  34 %install
  35 rm -rf %{buildroot}
  36 install -d -m 755 %{buildroot}APPLICATION_DIRECTORY
  37 cp -r %{_sourcedir}APPLICATION_DIRECTORY/* %{buildroot}APPLICATION_DIRECTORY
  38 %if "xAPPLICATION_LICENSE_FILE" != x
  39   %define license_install_file %{_defaultlicensedir}/%{name}-%{version}/%{basename:APPLICATION_LICENSE_FILE}
  40   install -d -m 755 %{buildroot}%{dirname:%{license_install_file}}
  41   install -m 644 APPLICATION_LICENSE_FILE %{buildroot}%{license_install_file}
  42 %endif
  43 
  44 %files
  45 %if "xAPPLICATION_LICENSE_FILE" != x
  46   %license %{license_install_file}
  47   %{dirname:%{license_install_file}}
  48 %endif
  49 # If installation directory for the application is /a/b/c, we want only root
  50 # component of the path (/a) in the spec file to make sure all subdirectories
  51 # are owned by the package.
  52 %(echo APPLICATION_DIRECTORY | sed -e "s|\(^/[^/]\{1,\}\).*$|\1|")
  53 
  54 %post
  55 DESKTOP_COMMANDS_INSTALL
  56 
  57 %preun
  58 UTILITY_SCRIPTS
  59 DESKTOP_COMMANDS_UNINSTALL
  60 
  61 %clean