Blame SPECS/copy-jdk-configs.spec

fdfb4b
%global project copy_jdk_configs
fdfb4b
%global file %{project}.lua
fdfb4b
%global fixFile %{project}_fixFiles.sh
fdfb4b
%global rpm_state_dir %{_localstatedir}/lib/rpm-state
fdfb4b
fdfb4b
Name:    copy-jdk-configs
fdfb4b
fdfb4b
# hash relevant to version tag
fdfb4b
%global  htag ed45a7dce13fab490529d4d13a064d379c8f66e7
fdfb4b
Version: 3.3
fdfb4b
Release: 10%{?dist}
fdfb4b
Summary: JDKs configuration files copier
fdfb4b
fdfb4b
License:  BSD
fdfb4b
URL:      https://pagure.io/%{project}
fdfb4b
Source0:  %{URL}/blob/%{htag}/f/%{file}
fdfb4b
Source1:  %{URL}/blob/%{htag}/f/LICENSE
fdfb4b
Source2:  %{URL}/blob/%{htag}/f/%{fixFile}
fdfb4b
fdfb4b
# 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)
fdfb4b
%global pretrans_install %(cat %{SOURCE0} | sed s/%%/%%%%/g | sed s/\\^%%%%/^%%/g) 
fdfb4b
fdfb4b
BuildArch: noarch
fdfb4b
fdfb4b
Requires: lua
fdfb4b
#Requires: lua-posix
fdfb4b
fdfb4b
%description
fdfb4b
Utility script to transfer JDKs configuration files between updates or for
fdfb4b
archiving. With script to fix incorrectly created rpmnew files
fdfb4b
fdfb4b
%prep
fdfb4b
cp -a %{SOURCE1} .
fdfb4b
fdfb4b
fdfb4b
%build
fdfb4b
#blob
fdfb4b
fdfb4b
%pretrans -p <lua>
fdfb4b
function createPretransScript()
fdfb4b
-- the sript must be available during pretrans, so multiply it to tmp
fdfb4b
  os.execute("mkdir -p %{rpm_state_dir}")
fdfb4b
  temp_path="%{rpm_state_dir}/%{file}"
fdfb4b
-- print("generating " .. temp_path)
fdfb4b
  file = io.open(temp_path, "w")
fdfb4b
  file:write([[%{pretrans_install}]])
fdfb4b
  file:close()
fdfb4b
end
fdfb4b
fdfb4b
-- in netinst, the above call may fail. pcall should save instalation (as there is nothing to copy anyway)
fdfb4b
-- https://bugzilla.redhat.com/show_bug.cgi?id=1295701
fdfb4b
-- todo, decide whether to check for {rpm_state_dir} and skip on not-existing, or keep creating
fdfb4b
if pcall(createPretransScript) then
fdfb4b
-- ok
fdfb4b
else
fdfb4b
--  print("Error running %{name} pretrans.")
fdfb4b
end
fdfb4b
fdfb4b
%install
fdfb4b
mkdir -p $RPM_BUILD_ROOT/%{_libexecdir}
fdfb4b
cp -a %{SOURCE0} $RPM_BUILD_ROOT/%{_libexecdir}/%{file}
fdfb4b
chmod 644 $RPM_BUILD_ROOT/%{_libexecdir}/%{file}
fdfb4b
cp -a %{SOURCE2} $RPM_BUILD_ROOT/%{_libexecdir}/%{fixFile}
fdfb4b
fdfb4b
%posttrans
fdfb4b
# remove file created in pretrans
fdfb4b
# echo "removing %{rpm_state_dir}/%{file}" || :
fdfb4b
rm "%{rpm_state_dir}/%{file}" 2> /dev/null || :
fdfb4b
fdfb4b
%files 
fdfb4b
%{_libexecdir}/%{file}
fdfb4b
%{_libexecdir}/%{fixFile}
fdfb4b
%license LICENSE
fdfb4b
fdfb4b
%changelog
fdfb4b
* Mon Apr 30 2018 Jiri Vanek <jvanek@redhat.com> - 3.3-10
fdfb4b
- added javaws.policy and blacklist
fdfb4b
- Resolves: rhbz#1573163
fdfb4b
fdfb4b
* Wed Apr 25 2018 Jiri Vanek <jvanek@redhat.com> - 3.3-3
fdfb4b
- fixes issue when java.security for openjdk7 was erased
fdfb4b
- Resolves: rhbz#1573163 
fdfb4b
fdfb4b
* Fri Nov 03 2017 Jiri Vanek <jvanek@redhat.com> - 3.3-2
fdfb4b
- added another subdirs for policies files
fdfb4b
- Resolves: rhbz#1503647
fdfb4b
- Resolves: rhbz#1503668
fdfb4b
fdfb4b
* Fri Nov 03 2017 Jiri Vanek <jvanek@redhat.com> - 3.3-1
fdfb4b
- updated to 3.3
fdfb4b
- Resolves: rhbz#1503647
fdfb4b
- Resolves: rhbz#1503668
fdfb4b
fdfb4b
* Mon Jun 19 2017 Jiri Vanek <jvanek@redhat.com> - 2.2-3
fdfb4b
- updated to latest head
fdfb4b
- Resolves: rhbz#1427463
fdfb4b
fdfb4b
* Tue Jun 13 2017 Jiri Vanek <jvanek@redhat.com> - 2.2-1
fdfb4b
- added "jre/lib/security/blacklisted.certs" to cared files
fdfb4b
- moved to newest release 2.1
fdfb4b
- moved to new upstream at pagure.io
fdfb4b
- added new script of copy_jdk_configs_fixFiles.sh 
fdfb4b
- copy_jdk_configs.lua  aligned to it
fdfb4b
- Resolves: rhbz#1427463
fdfb4b
fdfb4b
* Thu Dec 01 2016 Jiri Vanek <jvanek@redhat.com> - 1.3-1
fdfb4b
- updated to upstream 1.3 (adding jre/lib/security/cacerts file)
fdfb4b
- Resolves: rhbz#1399719
fdfb4b
fdfb4b
* Tue Aug 09 2016 Jiri Vanek <jvanek@redhat.com> - 1.2-1
fdfb4b
- updated to 1,3 which fixing nss minor issue
fdfb4b
- Resolves: rhbz#1296430
fdfb4b
fdfb4b
* Tue Jul 12 2016 Jiri Vanek <jvanek@redhat.com> - 1.1-5
fdfb4b
- posttrans silenced, the error is appearing only in state, when there is nothing to copy
fdfb4b
- Resolves: rhbz#1296430
fdfb4b
fdfb4b
* Tue Apr 12 2016 Jiri Vanek <jvanek@redhat.com> - 1.1-3
fdfb4b
- commented requires on lua posix to stop blocking composes.
fdfb4b
- changed it to 644 to dont mislead by executable flags
fdfb4b
- Resolves: rhbz#1296430
fdfb4b
fdfb4b
* Tue Apr 12 2016 Jiri Vanek <jvanek@redhat.com> - 1.1-3
fdfb4b
- inital commit to rhel
fdfb4b
- Resolves: rhbz#1296430
fdfb4b
fdfb4b
* Fri Jan 08 2016 Jiri Vanek <jvanek@redhat.com> - 1.1-3
fdfb4b
- pretrasn lua call now done in pcall (protected call)
fdfb4b
- also posttrans now always return 0
fdfb4b
fdfb4b
* Wed Dec 16 2015 Jiri Vanek <jvanek@redhat.com> - 1.1-2
fdfb4b
- package now "installs" also during pretrans, so pretrasn scripts can use it
fdfb4b
- pretrasn "install" is removed in postrans
fdfb4b
fdfb4b
* Wed Nov 25 2015 Jiri Vanek <jvanek@redhat.com> - 1.1-1
fdfb4b
- initial package