Blame SPECS/copy-jdk-configs.spec

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