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: 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 32 33 %files 34 APPLICATION_LICENSE_FILE 35 # If installation directory for the application is /a/b/c, we want only root 36 # component of the path (/a) in the spec file to make sure all subdirectories 37 # are owned by the package. 38 %(echo INSTALLATION_DIRECTORY/APPLICATION_FS_NAME | sed -e "s|\(^/[^/]\{1,\}\).*$|\1|") 39 40 %post 41 if [ "RUNTIME_INSTALLER" != "true" ]; then 42 ADD_LAUNCHERS_INSTALL 43 xdg-desktop-menu install --novendor INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop 44 FILE_ASSOCIATION_INSTALL 45 fi 46 47 %preun 48 if [ "RUNTIME_INSTALLER" != "true" ]; then 49 ADD_LAUNCHERS_REMOVE 50 xdg-desktop-menu uninstall --novendor INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop 51 FILE_ASSOCIATION_REMOVE 52 fi 53 if [ "SERVICE_HINT" = "true" ]; then 54 if [ -x "/etc/init.d/APPLICATION_PACKAGE" ]; then 55 if [ "STOP_ON_UNINSTALL" = "true" ]; then 56 /etc/init.d/APPLICATION_PACKAGE stop 57 fi 58 /sbin/chkconfig --del APPLICATION_PACKAGE 59 rm -f /etc/init.d/APPLICATION_PACKAGE 60 fi 61 fi 62 63 %clean