Skip to content

Commit 5b4ff47

Browse files
committed
Add RPM spec file a quick howto build a RPM
1 parent d9b7748 commit 5b4ff47

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

docs/dev/building_RPM.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# How to build the RPM file
2+
3+
## Installation
4+
5+
```
6+
yum group install "Development Tools"
7+
yum install rpmdevtools
8+
useradd makerpm
9+
```
10+
11+
## Building the package
12+
13+
```
14+
su - makerpm
15+
rpmdev-setuptree
16+
git clone https://github.com/dalibo/PAF.git
17+
spectool -R -g PAF/resource-agents-paf.spec
18+
rpmbuild -ba PAF/resource-agents-paf.spec
19+
```
20+
21+

resource-agents-paf.spec

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
%global _tag v1.0.0
2+
%global _ocfroot /usr/lib/ocf
3+
Name: resource-agents-paf
4+
Version: 1.0.0
5+
Release: 1
6+
Summary: PostgreSQL resource agent for Pacemaker
7+
License: PostgreSQL
8+
Group: Applications/Databases
9+
Url: http://dalibo.github.io/PAF/
10+
11+
Source0: https://github.com/dalibo/PAF/releases/download/%{_tag}/PAF-%{_tag}.tgz
12+
BuildArch: noarch
13+
#BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
14+
BuildRequires: resource-agents perl perl-Module-Build
15+
Provides: resource-agents-paf = %{version}
16+
17+
%description
18+
PostgreSQL resource agent for Pacemaker
19+
20+
%prep
21+
%setup -n PAF-%{_tag}
22+
23+
%build
24+
perl Build.PL --destdir "%{buildroot}" --install_path bindoc=%{_mandir}/man1 --install_path libdoc=%{_mandir}/man3
25+
perl Build
26+
27+
%install
28+
./Build install
29+
rm -f "%{buildroot}"/usr/local/lib64/perl5/auto/PAF/.packlist
30+
31+
%files
32+
%defattr(-,root,root,0755)
33+
%doc README.md
34+
%license LICENSE
35+
%{_mandir}/man1/*.1*
36+
%{_mandir}/man3/*.3*
37+
%{_ocfroot}/resource.d/heartbeat/pgsqlms
38+
%{_ocfroot}/lib/heartbeat/OCF_ReturnCodes.pm
39+
%{_ocfroot}/lib/heartbeat/OCF_Directories.pm
40+
%{_ocfroot}/lib/heartbeat/OCF_Functions.pm
41+
%{_datadir}/resource-agents/ocft/configs/pgsqlms
42+
43+
%changelog
44+
* Wed Mar 02 2016 Jehan-Guillaume de Rorthais <[email protected]> 1.0.0-1
45+
- Official 1.0.0 release
46+
47+
* Tue Mar 01 2016 Jehan-Guillaume de Rorthais <[email protected]> 0.99.0-1
48+
- Initial version
49+

0 commit comments

Comments
 (0)