source: projects/specs/trunk/c/copy-jdk-configs/copy-jdk-configs-vl.spec @ 10390

Revision 10390, 2.5 KB checked in by tomop, 8 years ago (diff)

nss-3.21.1-3, copy-jdk-configs-1.1-5 and java-1.8.0-openjdk-1.8.0.92-1.b14

Line 
1%global project copy_jdk_configs
2%global file %{project}.lua
3%global rpm_state_dir %{_localstatedir}/lib/rpm-state
4
5Name:    copy-jdk-configs
6
7Version: 1.1
8Release: 5%{?_dist_release}
9Summary: JDKs configuration files copier
10
11License:  BSD
12URL:      https://hg.fedorahosted.org/hg/%{project}
13Source0:  https://hg.fedorahosted.org/hg/copy_jdk_configs/raw-file/%{project}-%{version}/%{file}
14Source1:  https://hg.fedorahosted.org/hg/copy_jdk_configs/raw-file/%{project}-%{version}/LICENSE
15Vendor:   Project Vine
16Distribution: Vine Linux
17
18# 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)
19%global pretrans_install %(cat %{SOURCE0} | sed s/%%/%%%%/g | sed s/\\^%%%%/^%%/g)
20
21BuildArch: noarch
22
23Requires: lua
24Requires: lua-posix
25
26%description
27Utility script to transfer JDKs configuration files between updates or for
28archiving.
29
30%prep
31cp -a %{SOURCE1} .
32
33
34%build
35#blob
36
37%pretrans -p <lua>
38function createPretransScript()
39-- the sript must be available during pretrans, so multiply it to tmp
40  os.execute("mkdir -p %{rpm_state_dir}")
41  temp_path="%{rpm_state_dir}/%{file}"
42-- print("generating " .. temp_path)
43  file = io.open(temp_path, "w")
44  file:write([[%{pretrans_install}]])
45  file:close()
46end
47
48-- in netinst, the above call may fail. pcall should save instalation (as there is nothing to copy anyway)
49-- https://bugzilla.redhat.com/show_bug.cgi?id=1295701
50-- todo, decide whether to check for {rpm_state_dir} and skip on not-existing, or keep creating
51if pcall(createPretransScript) then
52-- ok
53else
54--  print("Error running %{name} pretrans.")
55end
56
57%install
58mkdir -p $RPM_BUILD_ROOT/%{_libexecdir}
59cp -a %{SOURCE0} $RPM_BUILD_ROOT/%{_libexecdir}/%{file}
60
61%posttrans
62# remove file created in pretrans
63# echo "removing %{rpm_state_dir}/%{file}" || :
64rm "%{rpm_state_dir}/%{file}" || :
65
66%files
67%{_libexecdir}/%{file}
68%license LICENSE
69
70%changelog
71* Mon Jun 20 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 1.1-5
72- initial build for Vine Linux.
73
74* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1-4
75- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
76
77* Fri Jan 08 2016 Jiri Vanek <jvanek@redhat.com> - 1.1-3
78- pretrasn lua call now done in pcall (protected call)
79- also posttrans now always return 0
80
81* Wed Dec 16 2015 Jiri Vanek <jvanek@redhat.com> - 1.1-2
82- package now "installs" also during pretrans, so pretrasn scripts can use it
83- pretrasn "install" is removed in postrans
84
85* Wed Nov 25 2015 Jiri Vanek <jvanek@redhat.com> - 1.1-1
86- initial package
Note: See TracBrowser for help on using the repository browser.