Blame SPECS/copy-jdk-configs.spec

5bb7ee
%global project copy_jdk_configs
5bb7ee
%global file %{project}.lua
5bb7ee
%global fixFile %{project}_fixFiles.sh
5bb7ee
%global rpm_state_dir %{_localstatedir}/lib/rpm-state
5bb7ee
5bb7ee
Name:    copy-jdk-configs
5bb7ee
5bb7ee
# hash relevant to version tag
5bb7ee
%global  htag 88d3ed89f30d8b0eb4877d860fa8d951f224f156
5bb7ee
Version: 4.0
5bb7ee
Release: 3%{?dist}
5bb7ee
Summary: JDKs configuration files copier
5bb7ee
5bb7ee
License:  BSD
5bb7ee
URL:      https://pagure.io/%{project}
5bb7ee
Source0:  %{URL}/blob/%{htag}/f/%{file}
5bb7ee
Source1:  %{URL}/blob/%{htag}/f/LICENSE
5bb7ee
Source2:  %{URL}/blob/%{htag}/f/%{fixFile}
5bb7ee
5bb7ee
# 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)
5bb7ee
%global pretrans_install %(cat %{SOURCE0} | sed s/%%/%%%%/g | sed s/\\^%%%%/^%%/g) 
5bb7ee
5bb7ee
BuildArch: noarch
5bb7ee
5bb7ee
Requires: lua
5bb7ee
Requires: lua-posix
5bb7ee
# rh1965305 - copy-jdk-configs script uses find and xargs but RPM does not depend on them
5bb7ee
Requires: findutils
5bb7ee
OrderWithRequires: findutils
5bb7ee
5bb7ee
%description
5bb7ee
Utility script to transfer JDKs configuration files between updates or for
5bb7ee
archiving. With script to fix incorrectly created rpmnew files
5bb7ee
5bb7ee
%prep
5bb7ee
cp -a %{SOURCE1} .
5bb7ee
5bb7ee
5bb7ee
%build
5bb7ee
#blob
5bb7ee
5bb7ee
%pretrans -p <lua>
5bb7ee
function createPretransScript()
5bb7ee
-- the sript must be available during pretrans, so multiply it to tmp
5bb7ee
  os.execute("mkdir -p %{rpm_state_dir}")
5bb7ee
  temp_path="%{rpm_state_dir}/%{file}"
5bb7ee
-- print("generating " .. temp_path)
5bb7ee
  file = io.open(temp_path, "w")
5bb7ee
  file:write([[%{pretrans_install}]])
5bb7ee
  file:close()
5bb7ee
end
5bb7ee
5bb7ee
-- in netinst, the above call may fail. pcall should save instalation (as there is nothing to copy anyway)
5bb7ee
-- https://bugzilla.redhat.com/show_bug.cgi?id=1295701
5bb7ee
-- todo, decide whether to check for {rpm_state_dir} and skip on not-existing, or keep creating
5bb7ee
if pcall(createPretransScript) then
5bb7ee
-- ok
5bb7ee
else
5bb7ee
--  print("Error running %{name} pretrans.")
5bb7ee
end
5bb7ee
5bb7ee
%install
5bb7ee
mkdir -p $RPM_BUILD_ROOT/%{_libexecdir}
5bb7ee
cp -a %{SOURCE0} $RPM_BUILD_ROOT/%{_libexecdir}/%{file}
5bb7ee
cp -a %{SOURCE2} $RPM_BUILD_ROOT/%{_libexecdir}/%{fixFile}
5bb7ee
5bb7ee
%posttrans
5bb7ee
# remove file created in pretrans
5bb7ee
# echo "removing %{rpm_state_dir}/%{file}" || :
5bb7ee
rm "%{rpm_state_dir}/%{file}" 2> /dev/null || :
5bb7ee
5bb7ee
%files 
5bb7ee
%{_libexecdir}/%{file}
5bb7ee
%{_libexecdir}/%{fixFile}
5bb7ee
%license LICENSE
5bb7ee
5bb7ee
%changelog
5bb7ee
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 4.0-3
5bb7ee
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
5bb7ee
  Related: rhbz#1991688
5bb7ee
5bb7ee
* Tue Jun 08 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.0-1
5bb7ee
- added requires and orderWithRequires of findutils to provide find and xargs (rh1965305)
5bb7ee
5bb7ee
* Thu Apr 29 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.0-0
5bb7ee
- bumped to 4.0 to resolve remvoed rpm 4.17 removing arg from global table
5bb7ee
5bb7ee
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.7-8
5bb7ee
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
5bb7ee
5bb7ee
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.7-7
5bb7ee
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
5bb7ee
5bb7ee
* Tue Jun 30 2020 Andrew Hughes <gnu.andrew@redhat.com> - 3.7-6
5bb7ee
- Rebuilt for lua 5.4.0.
5bb7ee
5bb7ee
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.7-5
5bb7ee
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
5bb7ee
5bb7ee
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.7-4
5bb7ee
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
5bb7ee
5bb7ee
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.7-3
5bb7ee
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
5bb7ee
5bb7ee
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.7-2
5bb7ee
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
5bb7ee
5bb7ee
* Wed May 02 2018 Jiri Vanek <jvanek@redhat.com> - 3.7-1
5bb7ee
- udpated to latst relase
5bb7ee
- configurable blacklist
5bb7ee
- listed all java keystores
5bb7ee
5bb7ee
* Wed May 02 2018 Jiri Vanek <jvanek@redhat.com> - 3.3-12
5bb7ee
- blackidrs put on single line
5bb7ee
5bb7ee
* Wed May 02 2018 Jiri Vanek <jvanek@redhat.com> - 3.3-11
5bb7ee
- added more files to balcklist based on oralce and ibm jdks
5bb7ee
5bb7ee
* Mon Apr 30 2018 Jiri Vanek <jvanek@redhat.com> - 3.3-10
5bb7ee
- added javaws.policy and blacklist
5bb7ee
5bb7ee
* Tue Apr 03 2018 Jiri Vanek <jvanek@redhat.com> - 3.3-5
5bb7ee
- fixed rhbz#1541838
5bb7ee
5bb7ee
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.3-3
5bb7ee
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
5bb7ee
5bb7ee
* Wed Oct 18 2017 Jiri Vanek <jvanek@redhat.com> - 3.3-2
5bb7ee
- added another subdirs for policies files
5bb7ee
5bb7ee
* Wed Oct 18 2017 Jiri Vanek <jvanek@redhat.com> - 3.3-1
5bb7ee
- handled new paths for policies files
5bb7ee
5bb7ee
* Thu Oct 05 2017 Jiri Vanek <jvanek@redhat.com> - 3.1-1
5bb7ee
- moved to newest release 3.1 whcih conf and lib/security as directories
5bb7ee
5bb7ee
* Thu Oct 05 2017 Jiri Vanek <jvanek@redhat.com> - 3.0-1
5bb7ee
- moved to newest release 3.0 whcih support linked configs
5bb7ee
5bb7ee
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.3-2
5bb7ee
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
5bb7ee
5bb7ee
* Wed Feb 22 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3
5bb7ee
- updated to latest head
5bb7ee
5bb7ee
* Wed Feb 22 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.2
5bb7ee
- added "jre/lib/security/blacklisted.certs" to cared files
5bb7ee
5bb7ee
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1-2
5bb7ee
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
5bb7ee
5bb7ee
* Fri Feb 03 2017 Jiri Vanek <jvanek@redhat.com> - 2.1-1
5bb7ee
- moved to newest release 2.1
5bb7ee
5bb7ee
* Fri Jan 20 2017 Jiri Vanek <jvanek@redhat.com> - 2.0-1
5bb7ee
- moved to new upstream at pagure.io
5bb7ee
- moved to newest release 2.0
5bb7ee
- added new script of copy_jdk_configs_fixFiles.sh 
5bb7ee
- copy_jdk_configs.lua  aligned to it
5bb7ee
5bb7ee
* Tue Aug 09 2016 Jiri Vanek <jvanek@redhat.com> - 1.2-1
5bb7ee
- updated to 1,3 which fixing nss minor issue
5bb7ee
5bb7ee
* Tue Jul 12 2016 Jiri Vanek <jvanek@redhat.com> - 1.1-5
5bb7ee
- posttrans silenced, the error is appearing only in state, when there is nothing to copy
5bb7ee
5bb7ee
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1-4
5bb7ee
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
5bb7ee
5bb7ee
* Fri Jan 08 2016 Jiri Vanek <jvanek@redhat.com> - 1.1-3
5bb7ee
- pretrasn lua call now done in pcall (protected call)
5bb7ee
- also posttrans now always return 0
5bb7ee
5bb7ee
* Wed Dec 16 2015 Jiri Vanek <jvanek@redhat.com> - 1.1-2
5bb7ee
- package now "installs" also during pretrans, so pretrasn scripts can use it
5bb7ee
- pretrasn "install" is removed in postrans
5bb7ee
5bb7ee
* Wed Nov 25 2015 Jiri Vanek <jvanek@redhat.com> - 1.1-1
5bb7ee
- initial package