copy-jdk-configs/copy-jdk-configs.spec

64 lines
1.7 KiB
RPMSpec
Raw Normal View History

2019-12-03 11:16:03 +08:00
%global pretrans_install %(cat %{SOURCE0} | sed s/%%/%%%%/g | sed s/\\^%%%%/^%%/g)
Name: copy-jdk-configs
Version: 4.1
Release: 1
2019-12-03 11:16:03 +08:00
Summary: JDKs Configuration File
License: BSD
URL: https://github.com/rh-openjdk/copy_jdk_configs
Source0: %{URL}/raw/copy_jdk_configs-%{version}/copy_jdk_configs.lua
Source1: %{URL}/raw/copy_jdk_configs-%{version}/LICENSE
Source2: %{URL}/raw/copy_jdk_configs-%{version}/copy_jdk_configs_fixFiles.sh
Patch0: Ongoing-fixes-on-rhbz#2100617.patch
2019-12-03 11:16:03 +08:00
BuildArch: noarch
Requires: lua lua-posix
Requires: findutils
OrderWithRequires: findutils
2019-12-03 11:16:03 +08:00
%description
Utility script for transferring JDK configuration files when updating or
archiving. Repair rpmnew file created by error by using scrip
%prep
cp -a %{SOURCE1} .
cp -a %{SOURCE2} .
%patch0 -p0
2019-12-03 11:16:03 +08:00
%build
%pretrans -p <lua>
function createPretransScript()
os.execute("mkdir -p %{_localstatedir}/lib/rpm-state")
temp_path="%{_localstatedir}/lib/rpm-state/copy_jdk_configs.lua"
file = io.open(temp_path, "w")
file:write([[%{pretrans_install}]])
file:close()
end
if pcall(createPretransScript) then
-- ok
else
-- print("Error running %{name} pretrans.")
end
%install
install -D %{SOURCE0} $RPM_BUILD_ROOT/%{_libexecdir}/copy_jdk_configs.lua
install -D %{_builddir}/copy_jdk_configs_fixFiles.sh $RPM_BUILD_ROOT/%{_libexecdir}/copy_jdk_configs_fixFiles.sh
2019-12-03 11:16:03 +08:00
%posttrans
rm "%{rpm_state_dir}/copy_jdk_configs.lua" 2> /dev/null || :
%files
%{_libexecdir}/*
%license LICENSE
%changelog
* Wed Oct 25 2023 xu_ping<707078654@qq.com> - 4.1-1
- update to 4.1
* Mon Jan 06 2020 xu_ping<xuping33@huawei.com> - 4.0-1
- Upgrade 4.0 to fix Packaging scriptlets assume global 'arg' in Lua environment
2019-12-03 11:16:03 +08:00
* Thu Nov 28 2019 gulining<gulining1@huawei.com> - 3.7-3
- Pakcage init