%define chatzilla_app_id \{59c81df5-4b7a-477b-912d-4e0fdf64e5f2\} %define firefox_app_id \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\} %define seamonkey_app_id \{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a\} %define sunbird_app_id \{718e30fb-e89b-41dd-9da7-e25a45638b28\} %define thunderbird_app_id \{3550f703-e582-4d05-9a08-453d09bdfdc6\} # If the package is noarch, put the files in /usr/share, otherwise use the libdir. %define _mozilla_extdir %( \ if [ x"%{_target_cpu}" = x"noarch" ] || [ -n "%{?_mozilla_extension_force_noarch}" ]; then \ echo "%{_datadir}/mozilla/extensions"; \ else \ echo "%{_libdir}/mozilla/extensions"; \ fi \ ) %define _mozilla_common_extdir %{_mozilla_extdir}/common %define _chatzilla_extdir %{_mozilla_extdir}/%{chatzilla_app_id} %define _firefox_extdir %{_mozilla_extdir}/%{firefox_app_id} %define _seamonkey_extdir %{_mozilla_extdir}/%{seamonkey_app_id} %define _sunbird_extdir %{_mozilla_extdir}/%{sunbird_app_id} %define _thunderbird_extdir %{_mozilla_extdir}/%{thunderbird_app_id} %define xpi_unpack(f:n:) \ %{!-f: %{error:Missing parameter -f for macro xpi_unpack} exit 1} \ \ %define xpi %{-f*} \ %define extension_name %{-n*}%{!-n:%{name}} \ \ mkdir -p "$RPM_BUILD_ROOT%{_mozilla_common_extdir}/%{extension_name}" \ unzip "%xpi" -d "$RPM_BUILD_ROOT%{_mozilla_common_extdir}/%{extension_name}" \ %{nil} %define xpi_symlink(a:n:) \ %{!-a: %{error:Missing parameter -a for macro xpi_symlink} exit 1} \ %{!?_mozilla_extension_id: %{error:Define _mozilla_extension_id before invoking macro xpi_symlink} exit 1 } \ \ %define app_id %{-a*} \ %define extension_name %{-n*}%{!-n:%{name}} \ \ mkdir -p "$RPM_BUILD_ROOT%{_mozilla_extdir}/%{app_id}/%{_mozilla_extension_id}" \ pushd $RPM_BUILD_ROOT%{_mozilla_common_extdir}/%{extension_name}/ \ for file in *; do \ ln -s "%{_mozilla_common_extdir}/%{extension_name}/${file}" "$RPM_BUILD_ROOT%{_mozilla_extdir}/%{app_id}/%{_mozilla_extension_id}/${file}" \ done \ rm -f $RPM_BUILD_ROOT%{_mozilla_extdir}/%{app_id}/%{_mozilla_extension_id}/install.rdf \ cp -a install.rdf $RPM_BUILD_ROOT%{_mozilla_extdir}/%{app_id}/%{_mozilla_extension_id}/install.rdf \ popd \ %{nil}