-
Notifications
You must be signed in to change notification settings - Fork 1
/
sf-config.spec
147 lines (119 loc) · 5.25 KB
/
sf-config.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
%global sum The Software Factory configuration sfconfig
Name: sf-config
Version: 3.1.0
Release: 4%{?dist}
Summary: %{sum}
License: ASL 2.0
URL: https://softwarefactory-project.io/r/p/%{name}
Source0: https://github.com/softwarefactory-project/software-factory/archive/%{version}.tar.gz
# Disable automatic requirement because scl repos is installed by sfconfig/inventory.py
AutoReq: 0
BuildArch: noarch
Conflicts: epel-release
Requires: python3-jinja2
Requires: python3-requests
Requires: python3-selinux
Requires: python3-six
Requires: python3-passlib
Requires: python3-pyyaml
Requires: iproute
Requires: openssh
Requires: openssl
Buildrequires: python3-devel
Buildrequires: python3-setuptools
Buildrequires: python3-pbr
%description
%{sum}
%prep
%autosetup -n %{name}-%{version}
%build
export PBR_VERSION=%{version}
%{__python3} setup.py build
%install
# The sfconfig module
export PBR_VERSION=%{version}
%{__python3} setup.py install --skip-build --root %{buildroot}
# /etc/software-factory
install -p -D -m 0644 defaults/arch.yaml %{buildroot}%{_sysconfdir}/software-factory/arch.yaml
install -p -D -m 0644 defaults/sfconfig.yaml %{buildroot}%{_sysconfdir}/software-factory/sfconfig.yaml
install -p -D -m 0644 defaults/logo-favicon.ico %{buildroot}%{_sysconfdir}/software-factory/logo-favicon.ico
install -p -D -m 0644 defaults/logo-splash.png %{buildroot}%{_sysconfdir}/software-factory/logo-splash.png
install -p -D -m 0644 defaults/logo-topmenu.png %{buildroot}%{_sysconfdir}/software-factory/logo-topmenu.png
install -p -d -m 0755 %{buildroot}%{_sysconfdir}/software-factory/certs
# /usr/share/sf-config
install -p -d %{buildroot}%{_datarootdir}/sf-config
mv ansible defaults refarch scripts templates testinfra %{buildroot}%{_datarootdir}/sf-config/
# /var/
install -p -d -m 0700 %{buildroot}/var/log/software-factory
install -p -d -m 0755 %{buildroot}/var/lib/software-factory
install -p -d -m 0700 %{buildroot}/var/lib/software-factory/backup
install -p -d -m 0750 %{buildroot}/var/lib/software-factory/state
install -p -d -m 0750 %{buildroot}/var/lib/software-factory/versions
install -p -d -m 0750 %{buildroot}/var/lib/software-factory/sql
install -p -d -m 0755 %{buildroot}/var/lib/software-factory/git
install -p -d -m 0755 %{buildroot}/var/lib/software-factory/conf
# /usr/
install -p -d -m 0755 %{buildroot}/usr/libexec/software-factory
install -p -d -m 0750 %{buildroot}/usr/share/software-factory
%files
%license LICENSE
%{_bindir}/sf*
%{python3_sitelib}/sfconfig-%{version}-py*.egg-info
%{python3_sitelib}/sfconfig
%dir %attr(0750, root, root) %{_sysconfdir}/software-factory/
%dir %attr(0755, root, root) /var/lib/software-factory/
%dir %attr(0700, root, root) /var/lib/software-factory/backup
%dir %attr(0750, root, root) /var/lib/software-factory/state
%dir %attr(0750, root, root) /var/lib/software-factory/versions
%dir %attr(0750, root, root) /var/lib/software-factory/sql
%dir %attr(0755, root, root) /var/lib/software-factory/git
%dir %attr(0755, root, root) /var/lib/software-factory/conf
%dir %attr(0700, root, root) /var/log/software-factory
%dir %attr(0755, root, root) /usr/libexec/software-factory
%dir %attr(0750, root, root) /usr/share/software-factory
%config(noreplace) %{_sysconfdir}/software-factory/*
%{_datarootdir}/sf-config/
%pre
# Upgrade context
if [ $1 -gt 1 ]; then
# Save the arch file in the rpm-state directory
mkdir -p %{_localstatedir}/lib/rpm-state/%{name}/
cp /etc/software-factory/arch.yaml %{_localstatedir}/lib/rpm-state/%{name}/arch.yaml
fi
%post
# Upgrade context
if [ $1 -gt 1 ]; then
# Restore the arch file from the rpm-state directory
cp %{_localstatedir}/lib/rpm-state/%{name}/arch.yaml /etc/software-factory/arch.yaml
fi
%changelog
* Mon Nov 29 2021 <[email protected]> - 3.1.0-4
- Add dependency to python3-passlib
* Tue Nov 5 2019 <user@tmacs> - 3.1.0-3
- Switch to python3
* Fri Dec 14 2018 Javier Peña <[email protected]> - 3.1.0-2
- Add missing dependencies on iproute, openssl and openssh
* Thu Oct 4 2018 Tristan Cacqueray <[email protected]> - 3.1.0-1
- Add versions directory
* Tue Jul 10 2018 Fabien Boucher <[email protected]> - 3.0.0-4
- Add dependency to PyYAML
* Fri Jun 1 2018 Fabien Boucher <[email protected]> - 3.0.0-3
- Move sfconfig directories creation in packaging
* Fri Apr 27 2018 Nicolas Hicher <[email protected]> - 3.0.0-2
- Add /var/log/software-factory directory creation
* Wed Feb 7 2018 Tristan Cacqueray <[email protected]> - 3.0.0-1
- Bump version
- Add sf-graph-render command
* Tue Nov 21 2017 Tristan Cacqueray <[email protected]> - 2.7.0-3
- Require ansible >= 2.4.1
* Thu Oct 05 2017 Fabien Boucher <[email protected]> - 2.7.0-2
- Make sure previous version of the arch.yaml is kept bypassing the
rpm config style behavior.
* Tue Jul 18 2017 Tristan Cacqueray <[email protected]> - 2.7.0-1
- Refactor sfconfig into a python module
* Tue Jul 18 2017 Tristan Cacqueray <[email protected]> - 2.6.0-2
- Add /var/lib/software-factory/backup directory creation
* Mon Jul 03 2017 Tristan Cacqueray <[email protected]> - 2.6.0-1
- Symlink sfconfig.py and sfconfig to support smooth transition
* Fri Apr 14 2017 Tristan Cacqueray <[email protected]> - 2.5.0-1
- Initial packaging