2 Name: APPLICATION_PACKAGE |
2 Name: APPLICATION_PACKAGE |
3 Version: APPLICATION_VERSION |
3 Version: APPLICATION_VERSION |
4 Release: APPLICATION_RELEASE |
4 Release: APPLICATION_RELEASE |
5 License: APPLICATION_LICENSE_TYPE |
5 License: APPLICATION_LICENSE_TYPE |
6 Vendor: APPLICATION_VENDOR |
6 Vendor: APPLICATION_VENDOR |
7 Prefix: INSTALLATION_DIRECTORY |
7 Prefix: %{dirname:APPLICATION_DIRECTORY} |
8 Provides: APPLICATION_PACKAGE |
8 Provides: APPLICATION_PACKAGE |
9 %if "xAPPLICATION_GROUP" != x |
9 %if "xAPPLICATION_GROUP" != x |
10 Group: APPLICATION_GROUP |
10 Group: APPLICATION_GROUP |
11 %endif |
11 %endif |
12 |
12 |
13 Autoprov: 0 |
13 Autoprov: 0 |
14 Autoreq: 0 |
14 Autoreq: 0 |
15 PACKAGE_DEPENDENCIES |
15 %if "xPACKAGE_DEPENDENCIES" != x |
|
16 Requires: PACKAGE_DEPENDENCIES |
|
17 %endif |
16 |
18 |
17 #avoid ARCH subfolder |
19 #avoid ARCH subfolder |
18 %define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm |
20 %define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm |
19 |
21 |
20 #comment line below to enable effective jar compression |
22 #comment line below to enable effective jar compression |
29 |
31 |
30 %build |
32 %build |
31 |
33 |
32 %install |
34 %install |
33 rm -rf %{buildroot} |
35 rm -rf %{buildroot} |
34 mkdir -p %{buildroot}INSTALLATION_DIRECTORY |
36 install -d -m 755 %{buildroot}APPLICATION_DIRECTORY |
35 cp -r %{_sourcedir}/APPLICATION_FS_NAME %{buildroot}INSTALLATION_DIRECTORY |
37 cp -r %{_sourcedir}APPLICATION_DIRECTORY/* %{buildroot}APPLICATION_DIRECTORY |
36 %if "xAPPLICATION_LICENSE_FILE" != x |
38 %if "xAPPLICATION_LICENSE_FILE" != x |
37 %define license_install_file %{_defaultlicensedir}/%{name}-%{version}/%{basename:APPLICATION_LICENSE_FILE} |
39 %define license_install_file %{_defaultlicensedir}/%{name}-%{version}/%{basename:APPLICATION_LICENSE_FILE} |
38 install -d -m 755 %{buildroot}%{dirname:%{license_install_file}} |
40 install -d -m 755 %{buildroot}%{dirname:%{license_install_file}} |
39 install -m 644 APPLICATION_LICENSE_FILE %{buildroot}%{license_install_file} |
41 install -m 644 APPLICATION_LICENSE_FILE %{buildroot}%{license_install_file} |
40 %endif |
42 %endif |
41 |
43 |
42 %files |
44 %files |
43 %{?license_install_file:%license %{license_install_file}} |
45 %if "xAPPLICATION_LICENSE_FILE" != x |
|
46 %license %{license_install_file} |
|
47 %{dirname:%{license_install_file}} |
|
48 %endif |
44 # If installation directory for the application is /a/b/c, we want only root |
49 # If installation directory for the application is /a/b/c, we want only root |
45 # component of the path (/a) in the spec file to make sure all subdirectories |
50 # component of the path (/a) in the spec file to make sure all subdirectories |
46 # are owned by the package. |
51 # are owned by the package. |
47 %(echo INSTALLATION_DIRECTORY/APPLICATION_FS_NAME | sed -e "s|\(^/[^/]\{1,\}\).*$|\1|") |
52 %(echo APPLICATION_DIRECTORY | sed -e "s|\(^/[^/]\{1,\}\).*$|\1|") |
48 |
53 |
49 %post |
54 %post |
50 if [ "RUNTIME_INSTALLER" != "true" ]; then |
55 DESKTOP_COMMANDS_INSTALL |
51 ADD_LAUNCHERS_INSTALL |
|
52 xdg-desktop-menu install --novendor INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop |
|
53 FILE_ASSOCIATION_INSTALL |
|
54 fi |
|
55 |
56 |
56 %preun |
57 %preun |
57 if [ "RUNTIME_INSTALLER" != "true" ]; then |
58 UTILITY_SCRIPTS |
58 ADD_LAUNCHERS_REMOVE |
59 DESKTOP_COMMANDS_UNINSTALL |
59 xdg-desktop-menu uninstall --novendor INSTALLATION_DIRECTORY/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop |
|
60 FILE_ASSOCIATION_REMOVE |
|
61 fi |
|
62 |
60 |
63 %clean |
61 %clean |