1 Summary: APPLICATION_SUMMARY
   2 Name: APPLICATION_PACKAGE
   3 Version: APPLICATION_VERSION
   4 Release: 1
   5 License: APPLICATION_LICENSE_TYPE
   6 Vendor: APPLICATION_VENDOR
   7 Prefix: /opt
   8 Provides: APPLICATION_PACKAGE
   9 Requires: ld-linux.so.2 libX11.so.6 libXext.so.6 libXi.so.6 libXrender.so.1 libXtst.so.6 libasound.so.2 libc.so.6 libdl.so.2 libgcc_s.so.1 libm.so.6 libpthread.so.0 libthread_db.so.1
  10 Autoprov: 0
  11 Autoreq: 0
  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}/opt
  31 cp -r %{_sourcedir}/APPLICATION_NAME %{buildroot}/opt
  32 
  33 %files
  34 APPLICATION_LICENSE_FILE
  35 /opt/APPLICATION_NAME
  36 
  37 %post
  38 cp /opt/APPLICATION_NAME/APPLICATION_NAME.desktop /usr/share/applications/
  39 if [ "SERVICE_HINT" = "true" ]; then
  40     cp /opt/APPLICATION_NAME/APPLICATION_PACKAGE.init /etc/init.d/APPLICATION_PACKAGE
  41     if [ -x "/etc/init.d/APPLICATION_PACKAGE" ]; then
  42         /sbin/chkconfig --add APPLICATION_PACKAGE
  43         if [ "START_ON_INSTALL" = "true" ]; then
  44             /etc/init.d/APPLICATION_PACKAGE start
  45         fi
  46     fi
  47 fi
  48 
  49 %preun
  50 rm -f /usr/share/applications/APPLICATION_NAME.desktop
  51 if [ "SERVICE_HINT" = "true" ]; then
  52     if [ -x "/etc/init.d/APPLICATION_PACKAGE" ]; then
  53         if [ "STOP_ON_UNINSTALL" = "true" ]; then
  54             /etc/init.d/APPLICATION_PACKAGE stop
  55         fi
  56         /sbin/chkconfig --del APPLICATION_PACKAGE
  57         rm -f /etc/init.d/APPLICATION_PACKAGE
  58     fi
  59 fi
  60 
  61 %clean