-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuilder_genspec.sh
executable file
·65 lines (49 loc) · 1.4 KB
/
builder_genspec.sh
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
#!/bin/bash
[ -n "$PMM_VERSION" ] || { echo "PMM_VERSION must be defined (x.y.z.nnnn)."; exit 1; }
[ -n "$PROJ_REL" ] || { echo "PROJ_REL must be defined (rc_commit)."; exit 1; }
rpmName="pmm-smppload-base"
rpmSpecFile=${HOME}/rpmbuild/SPECS/${rpmName}.spec
rm -f $rpmSpecFile
### base packages
cat >"${rpmSpecFile}" <<_SPEC_
%define debug_package %{nil}
%define _unpackaged_files_terminate_build 0
%define buildroot_bak %{buildroot}
%define _source_filedigest_algorithm 0
%define _binary_filedigest_algorithm 0
%define _source_payload w6.bzdio
%define _binary_payload w6.bzdio
Name: ${rpmName}
Version: ${PMM_VERSION}
Release: ${PROJ_REL}
Summary: pmm smppload
Group: Applications/System
License: Proprietary
Source0: ${rpmName}-${PMM_VERSION}.tar
Requires: erlang > 17
BuildRequires: esl-erlang < 19
BuildRequires: libuuid-devel git net-snmp-utils tokyocabinet-devel ncurses-devel gcc-c++ zlib-devel bzip2-devel
%description
%pre
#id bms > /dev/null || exit 1
%prep
%setup -c -q
%build
make
%install
# for /usr/bin/ with system erlang
mkdir -p %{buildroot}/usr/bin
cp -a _build/default/bin/smppload %{buildroot}/usr/bin/
# for /opt/smppload with embed erlang
#mkdir -p %{buildroot}/opt/smppload
#cd _build/default/rel/smppload
#cp -a . %{buildroot}/opt/smppload/
%clean
rm -rf %{buildroot}
%files
# for /usr/bin/ with system erlang
/usr/bin/smppload
# for /opt/smppload with embed erlang
#/opt/smppload/
_SPEC_
###