Blame SPECS/copy-jdk-configs.spec

1efe36
%global project copy_jdk_configs
1efe36
%global file %{project}.lua
1efe36
%global fixFile %{project}_fixFiles.sh
1efe36
%global rpm_state_dir %{_localstatedir}/lib/rpm-state
1efe36
1efe36
Name:    copy-jdk-configs
1efe36
1efe36
# hash relevant to version tag
1efe36
%global  htag 1d18ce8b5dec47a0468136ab6cdadfb93defe2c4
1efe36
Version: 3.7
8cf704
Release: 4%{?dist}
1efe36
Summary: JDKs configuration files copier
1efe36
1efe36
License:  BSD
1efe36
URL:      https://pagure.io/%{project}
1efe36
Source0:  %{URL}/blob/%{htag}/f/%{file}
1efe36
Source1:  %{URL}/blob/%{htag}/f/LICENSE
1efe36
Source2:  %{URL}/blob/%{htag}/f/%{fixFile}
1efe36
8cf704
Patch0: addNssCfgFips.patch
8cf704
1efe36
# 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)
1efe36
%global pretrans_install %(cat %{SOURCE0} | sed s/%%/%%%%/g | sed s/\\^%%%%/^%%/g) 
1efe36
1efe36
BuildArch: noarch
1efe36
1efe36
Requires: lua
1efe36
#Requires: lua-posix
1efe36
1efe36
%description
1efe36
Utility script to transfer JDKs configuration files between updates or for
1efe36
archiving. With script to fix incorrectly created rpmnew files
1efe36
1efe36
%prep
1efe36
cp -a %{SOURCE1} .
8cf704
cp -a %{SOURCE0} .
8cf704
%patch0 -p0
1efe36
1efe36
1efe36
%build
1efe36
#blob
1efe36
1efe36
%pretrans -p <lua>
1efe36
function createPretransScript()
1efe36
-- the sript must be available during pretrans, so multiply it to tmp
1efe36
  os.execute("mkdir -p %{rpm_state_dir}")
1efe36
  temp_path="%{rpm_state_dir}/%{file}"
1efe36
-- print("generating " .. temp_path)
1efe36
  file = io.open(temp_path, "w")
1efe36
  file:write([[%{pretrans_install}]])
1efe36
  file:close()
1efe36
end
1efe36
1efe36
-- in netinst, the above call may fail. pcall should save instalation (as there is nothing to copy anyway)
1efe36
-- https://bugzilla.redhat.com/show_bug.cgi?id=1295701
1efe36
-- todo, decide whether to check for {rpm_state_dir} and skip on not-existing, or keep creating
1efe36
if pcall(createPretransScript) then
1efe36
-- ok
1efe36
else
1efe36
--  print("Error running %{name} pretrans.")
1efe36
end
1efe36
1efe36
%install
1efe36
mkdir -p $RPM_BUILD_ROOT/%{_libexecdir}
8cf704
cp -a %{file} $RPM_BUILD_ROOT/%{_libexecdir}/%{file}
1efe36
chmod 644 $RPM_BUILD_ROOT/%{_libexecdir}/%{file}
1efe36
cp -a %{SOURCE2} $RPM_BUILD_ROOT/%{_libexecdir}/%{fixFile}
1efe36
1efe36
%posttrans
1efe36
# remove file created in pretrans
1efe36
# echo "removing %{rpm_state_dir}/%{file}" || :
1efe36
rm "%{rpm_state_dir}/%{file}" 2> /dev/null || :
1efe36
1efe36
%files 
1efe36
%{_libexecdir}/%{file}
1efe36
%{_libexecdir}/%{fixFile}
1efe36
%license LICENSE
1efe36
1efe36
%changelog
8cf704
* Thu Jul 09 2020 Jiri Vanek <jvanek@redhat.com> - 3.7-3
8cf704
- added link to http://hydra.brq.redhat.com:8080/view/c~j~c/#projectstatus
8cf704
- removed source check from test.yaml
8cf704
- added gating.yaml
8cf704
- Resolves: rhbz#1855374
8cf704
8cf704
* Thu Jul 09 2020 Jiri Vanek <jvanek@redhat.com> - 3.7-3
8cf704
- added gatnig placeholder
8cf704
- Resolves: rhbz#1855374
8cf704
8cf704
* Thu Jul 09 2020 Jiri Vanek <jvanek@redhat.com> - 3.7-2
8cf704
- added nss.fips.cfg to cared files
8cf704
- Resolves: rhbz#1855374
8cf704
1efe36
* Wed May 02 2018 Jiri Vanek <jvanek@redhat.com> - 3.7-1
1efe36
- udpated to latst relase
1efe36
- configurable blacklist
1efe36
- listed all java keystores
1efe36
1efe36
* Wed May 02 2018 Jiri Vanek <jvanek@redhat.com> - 3.3-12
1efe36
- blackidrs put on single line
1efe36
1efe36
* Wed May 02 2018 Jiri Vanek <jvanek@redhat.com> - 3.3-11
1efe36
- added more files to balcklist based on oralce and ibm jdks
1efe36
1efe36
* Mon Apr 30 2018 Jiri Vanek <jvanek@redhat.com> - 3.3-10
1efe36
- added javaws.policy and blacklist
1efe36
- fixed rhbz#1541838
1efe36
1efe36
* Tue Apr 03 2018 Jiri Vanek <jvanek@redhat.com> - 3.3-5
1efe36
- fixed rhbz#1541838
1efe36
1efe36
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.3-3
1efe36
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
1efe36
1efe36
* Wed Oct 18 2017 Jiri Vanek <jvanek@redhat.com> - 3.3-2
1efe36
- added another subdirs for policies files
1efe36
1efe36
* Wed Oct 18 2017 Jiri Vanek <jvanek@redhat.com> - 3.3-1
1efe36
- handled new paths for policies files
1efe36
1efe36
* Thu Oct 05 2017 Jiri Vanek <jvanek@redhat.com> - 3.1-1
1efe36
- moved to newest release 3.1 whcih conf and lib/security as directories
1efe36
1efe36
* Thu Oct 05 2017 Jiri Vanek <jvanek@redhat.com> - 3.0-1
1efe36
- moved to newest release 3.0 whcih support linked configs
1efe36
1efe36
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.3-2
1efe36
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
1efe36
1efe36
* Wed Feb 22 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3
1efe36
- updated to latest head
1efe36
1efe36
* Wed Feb 22 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.2
1efe36
- added "jre/lib/security/blacklisted.certs" to cared files
1efe36
1efe36
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1-2
1efe36
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
1efe36
1efe36
* Fri Feb 03 2017 Jiri Vanek <jvanek@redhat.com> - 2.1-1
1efe36
- moved to newest release 2.1
1efe36
1efe36
* Fri Jan 20 2017 Jiri Vanek <jvanek@redhat.com> - 2.0-1
1efe36
- moved to new upstream at pagure.io
1efe36
- moved to newest release 2.0
1efe36
- added new script of copy_jdk_configs_fixFiles.sh 
1efe36
- copy_jdk_configs.lua  aligned to it
1efe36
1efe36
* Tue Aug 09 2016 Jiri Vanek <jvanek@redhat.com> - 1.2-1
1efe36
- updated to 1,3 which fixing nss minor issue
1efe36
1efe36
* Tue Jul 12 2016 Jiri Vanek <jvanek@redhat.com> - 1.1-5
1efe36
- posttrans silenced, the error is appearing only in state, when there is nothing to copy
1efe36
1efe36
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1-4
1efe36
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
1efe36
1efe36
* Fri Jan 08 2016 Jiri Vanek <jvanek@redhat.com> - 1.1-3
1efe36
- pretrasn lua call now done in pcall (protected call)
1efe36
- also posttrans now always return 0
1efe36
1efe36
* Wed Dec 16 2015 Jiri Vanek <jvanek@redhat.com> - 1.1-2
1efe36
- package now "installs" also during pretrans, so pretrasn scripts can use it
1efe36
- pretrasn "install" is removed in postrans
1efe36
1efe36
* Wed Nov 25 2015 Jiri Vanek <jvanek@redhat.com> - 1.1-1
1efe36
- initial package