%global project copy_jdk_configs %global file %{project}.lua %global fixFile %{project}_fixFiles.sh %global rpm_state_dir %{_localstatedir}/lib/rpm-state %global __requires_exclude %{?__requires_exclude:%__requires_exclude|}/bin/lua Name: copy-jdk-configs # hash relevant to version tag %global htag 1d18ce8b5dec47a0468136ab6cdadfb93defe2c4 Version: 3.7 Release: %mkrel 3 Summary: JDKs configuration files copier Group: Development/Java License: BSD URL: https://pagure.io/%{project} Source0: https://pagure.io/%{project}/blob/%{htag}/f/%{file} Source1: https://pagure.io/%{project}/blob/%{htag}/f/LICENSE Source2: https://pagure.io/%{project}/blob/%{htag}/f/%{fixFile} # we need to duplicate msot of the percents in that script so they survive rpm expansion (even in that sed they have to be duplicated) %global pretrans_install %(cat %{SOURCE0} | sed s/%%/%%%%/g | sed s/\\^%%%%/^%%/g) BuildArch: noarch BuildRequires: lua BuildRequires: rpm => 4.14.0-2 Requires: lua Requires: lua-posix %description Utility script to transfer JDKs configuration files between updates or for archiving. With script to fix incorrectly created rpmnew files. %prep cp -a %{SOURCE1} . %build #blob %pretrans -p <lua> function createPretransScript() -- the sript must be available during pretrans, so multiply it to tmp os.execute("mkdir -p %{rpm_state_dir}") temp_path="%{rpm_state_dir}/%{file}" -- print("generating " .. temp_path) file = io.open(temp_path, "w") file:write([[%{pretrans_install}]]) file:close() end -- in netinst, the above call may fail. pcall should save instalation (as there is nothing to copy anyway) -- https://bugzilla.redhat.com/show_bug.cgi?id=1295701 -- todo, decide whether to check for {rpm_state_dir} and skip on not-existing, or keep creating if pcall(createPretransScript) then -- ok else -- print("Error running %{name} pretrans.") end %install mkdir -p %{buildroot}/%{_libexecdir} cp -a %{SOURCE0} %{buildroot}%{_libexecdir}/%{file} cp -a %{SOURCE2} %{buildroot}/%{_libexecdir}/%{fixFile} %posttrans # remove file created in pretrans # echo "removing %{rpm_state_dir}/%{file}" || : rm "%{rpm_state_dir}/%{file}" 2> /dev/null || : %files %{_libexecdir}/%{file} %{_libexecdir}/%{fixFile} %license LICENSE %changelog * Wed Feb 12 2020 umeabot <umeabot> 3.7-3.mga8 + Revision: 1501347 - Mageia 8 Mass Rebuild * Thu Sep 20 2018 umeabot <umeabot> 3.7-2.mga7 + Revision: 1277818 - Mageia 7 Mass Rebuild * Tue Jun 26 2018 ns80 <ns80> 3.7-1.mga7 + Revision: 1239795 - 3.7 * Wed May 02 2018 luigiwalser <luigiwalser> 3.3-4.mga7 + Revision: 1224651 - silenced output of non-existing targets (rhbz#1541838, from fedora) - added javaws.policy and blacklist (from fedora) * Fri Dec 01 2017 luigiwalser <luigiwalser> 3.3-3.mga7 + Revision: 1180631 - added another subdirs for policies files (from fedora) * Mon Nov 06 2017 tv <tv> 3.3-2.mga7 + Revision: 1176111 - exclude file deps * Sun Nov 05 2017 luigiwalser <luigiwalser> 3.3-1.mga7 + Revision: 1176042 - 3.3 + tv <tv> - drop no more needed requires excludes * Sat Oct 14 2017 tv <tv> 3.2-4.mga7 + Revision: 1171813 - drop unsupported file deps on /bin/lua * Sat Oct 14 2017 tv <tv> 3.2-3.mga7 + Revision: 1171744 - explicitely BR latest rpm b/c of bogus BS * Sat Oct 14 2017 tv <tv> 3.2-2.mga7 + Revision: 1171729 - rebuild with fixed rpm for bogus deps * Fri Oct 13 2017 luigiwalser <luigiwalser> 3.2-1.mga7 + Revision: 1171707 - 3.2 - 2.3 * Mon Feb 27 2017 luigiwalser <luigiwalser> 2.2-2.mga6 + Revision: 1088061 - added jre/lib/security/blacklisted.certs to cared files (from fedora) * Tue Feb 21 2017 luigiwalser <luigiwalser> 2.2-1.mga6 + Revision: 1087179 - 2.2 * Sun Feb 12 2017 luigiwalser <luigiwalser> 2.1-1.mga6 + Revision: 1085830 - 2.1 * Fri Jan 27 2017 luigiwalser <luigiwalser> 2.0-1.mga6 + Revision: 1083676 - 2.0 * Sat Sep 10 2016 luigiwalser <luigiwalser> 1.2-1.mga6 + Revision: 1051244 - 1.2 * Fri Jan 22 2016 luigiwalser <luigiwalser> 1.1-2.mga6 + Revision: 926546 - BR lua so as to not auto require /usr/bin/lua * Fri Jan 22 2016 luigiwalser <luigiwalser> 1.1-1.mga6 + Revision: 926369 - add group tag - adapt to mageia - imported package copy-jdk-configs * Fri Jan 08 2016 Jiri Vanek <jvanek@redhat.com> - 1.1-3 - pretrasn lua call now done in pcall (protected call) - also posttrans now always return 0 * Wed Dec 16 2015 Jiri Vanek <jvanek@redhat.com> - 1.1-2 - package now "installs" also during pretrans, so pretrasn scripts can use it - pretrasn "install" is removed in postrans * Wed Nov 25 2015 Jiri Vanek <jvanek@redhat.com> - 1.1-1 - initial package