forked from starlingx-staging/sm-common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsm-common-1.0.0.spec
157 lines (136 loc) · 5.42 KB
/
sm-common-1.0.0.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
148
149
150
151
152
153
154
155
156
157
#
# This file is auto-generated. DO NOT EDIT
# Generated by: autospec.py
#
Name : sm-common-1.0.0
Version : 3ee0e6855958e9d702314f1577e619f657e79ffd
Release : 1
URL : https://github.com/openstack/stx-ha/archive/3ee0e6855958e9d702314f1577e619f657e79ffd.tar.gz
Source0 : https://github.com/openstack/stx-ha/archive/3ee0e6855958e9d702314f1577e619f657e79ffd.tar.gz
Summary : Service Management Databases
Group : Development/Tools
License : Apache-2.0
Requires: sm-common-1.0.0-bin
Requires: sm-common-1.0.0-config
Requires: sm-common-1.0.0-lib
Requires: /bin/sh
Requires: mtce-pmon
Requires: sqlite-autoconf
Requires: systemd
Requires: util-linux
BuildRequires : buildreq-distutils3
BuildRequires : gcc
BuildRequires : glib-dev
BuildRequires : pluggy
BuildRequires : py-python
BuildRequires : pytest
BuildRequires : sqlite-autoconf-dev
BuildRequires : systemd
BuildRequires : systemd-devel
BuildRequires : tox
BuildRequires : util-linux
BuildRequires : util-linux-dev
BuildRequires : virtualenv
Patch1: 0001-disable-warning-as-error.patch
Patch2: 0002-change-sysconfig-dir.patch
%description
Service Managment Databases
%package bin
Summary: bin components for the sm-common-1.0.0 package.
Group: Binaries
Requires: sm-common-1.0.0-config
%description bin
bin components for the sm-common-1.0.0 package.
%package config
Summary: config components for the sm-common-1.0.0 package.
Group: Default
%description config
config components for the sm-common-1.0.0 package.
%package dev
Summary: dev components for the sm-common-1.0.0 package.
Group: Development
Requires: sm-common-1.0.0-lib
Requires: sm-common-1.0.0-bin
Provides: sm-common-1.0.0-devel
%description dev
dev components for the sm-common-1.0.0 package.
%package lib
Summary: lib components for the sm-common-1.0.0 package.
Group: Libraries
%description lib
lib components for the sm-common-1.0.0 package.
%prep
%setup -q -n stx-ha-3ee0e6855958e9d702314f1577e619f657e79ffd
%patch1 -p1
%patch2 -p1
%build
## build_prepend content
VER=%{version}
MAJOR=`echo $VER | awk -F . '{print $1}'`
MINOR=`echo $VER | awk -F . '{print $2}'`
%global _buildsubdir %{_builddir}/stx-ha-3ee0e6855958e9d702314f1577e619f657e79ffd/service-mgmt/sm-common-1.0.0
## build_prepend end
export http_proxy=http://127.0.0.1:9/
export https_proxy=http://127.0.0.1:9/
export no_proxy=localhost,127.0.0.1,0.0.0.0
export LANG=C
export SOURCE_DATE_EPOCH=1538135205
pushd service-mgmt/sm-common-1.0.0
make %{?_smp_mflags} VER=${VER} VER_MJR=$MAJOR
popd
%install
## install_prepend content
sed -i -e 's/${sysconfdir}/\/usr\/local\/etc/g' %{_builddir}/stx-ha-3ee0e6855958e9d702314f1577e619f657e79ffd/service-mgmt/sm-common-1.0.0/scripts/sm-watchdog.conf
sed -i -e 's/${sysconfdir}/\/usr\/local\/etc/g' %{_builddir}/stx-ha-3ee0e6855958e9d702314f1577e619f657e79ffd/service-mgmt/sm-common-1.0.0/scripts/sm-watchdog.service
sed -i -e 's/${sysconfdir}/\/usr\/local\/etc/g' %{_builddir}/stx-ha-3ee0e6855958e9d702314f1577e619f657e79ffd/service-mgmt/sm-common-1.0.0/scripts/sm-eru.service
sed -i -e 's/${sysconfdir}/\/usr\/local\/etc/g' %{_builddir}/stx-ha-3ee0e6855958e9d702314f1577e619f657e79ffd/service-mgmt/sm-common-1.0.0/scripts/Makefile
sed -i -e 's/${sysconfdir}/\/usr\/local\/etc/g' %{_builddir}/stx-ha-3ee0e6855958e9d702314f1577e619f657e79ffd/service-mgmt/sm-common-1.0.0/scripts/sm-eru.conf
%global _unitdir '/usr/lib/systemd/system'
VER=%{version}
MAJOR=`echo $VER | awk -F . '{print $1}'`
MINOR=`echo $VER | awk -F . '{print $2}'`
## install_prepend end
export SOURCE_DATE_EPOCH=1538135205
rm -rf %{buildroot}
pushd service-mgmt/sm-common-1.0.0
make DEST_DIR=$RPM_BUILD_ROOT BIN_DIR=%{_bindir} UNIT_DIR=%{_unitdir} LIB_DIR=%{_libdir} INC_DIR=%{_includedir} VER=$VER VER_MJR=$MAJOR install_non_bb
popd
## install_append content
%global _sysconfdir '/usr/local/etc'
install -m 750 -d %{buildroot}/usr
install -m 750 -d %{buildroot}/usr/bin
install -m 750 -p -D %{_buildsubdir}/src/sm_eru %{buildroot}%{_bindir}/sm-eru
install -m 750 -p -D %{_buildsubdir}/src/sm_eru_dump %{buildroot}%{_bindir}/sm-eru-dump
install -m 750 -p -D %{_buildsubdir}/src/sm_watchdog %{buildroot}%{_bindir}/sm-watchdog
install -m 644 -p -D %{_buildsubdir}/scripts/sm-eru.service %{buildroot}%{_unitdir}/sm-eru.service
install -m 644 -p -D %{_buildsubdir}/scripts/sm-watchdog.service %{buildroot}%{_unitdir}/sm-watchdog.service
install -m 750 -d %{buildroot}%{_sysconfdir}/pmon.d
install -m 640 -p -D %{_buildsubdir}/scripts/sm-eru.conf %{buildroot}%{_sysconfdir}/pmon.d/sm-eru.conf
install -m 640 -p -D %{_buildsubdir}/scripts/sm-watchdog.conf %{buildroot}%{_sysconfdir}/pmon.d/sm-watchdog.conf
install -m 750 -p -D %{_buildsubdir}/scripts/sm-eru %{buildroot}%{_sysconfdir}/init.d/sm-eru
install -m 750 -p -D %{_buildsubdir}/scripts/sm-watchdog %{buildroot}%{_sysconfdir}/init.d/sm-watchdog
## install_append end
%files
%defattr(-,root,root,-)
/usr/local/etc/init.d/sm-eru
/usr/local/etc/init.d/sm-watchdog
/usr/local/etc/pmon.d/sm-eru.conf
/usr/local/etc/pmon.d/sm-watchdog.conf
/var/lib/sm/watchdog/modules/libsm_watchdog_nfs.so
/var/lib/sm/watchdog/modules/libsm_watchdog_nfs.so.3ee0e6855958e9d702314f1577e619f657e79ffd
%files bin
%defattr(-,root,root,-)
/usr/bin/sm-eru
/usr/bin/sm-eru-dump
/usr/bin/sm-watchdog
%files config
%defattr(-,root,root,-)
/usr/lib/systemd/system/sm-eru.service
/usr/lib/systemd/system/sm-watchdog.service
%files dev
%defattr(-,root,root,-)
/usr/include/*.h
/usr/lib64/libsm_common.so
%files lib
%defattr(-,root,root,-)
/usr/lib64/libsm_common.so.3ee0e6855958e9d702314f1577e619f657e79ffd