Skip to content

Commit

Permalink
Add RPM spec file a quick howto build a RPM
Browse files Browse the repository at this point in the history
  • Loading branch information
ioguix committed Mar 2, 2016
1 parent d9b7748 commit 5b4ff47
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/dev/building_RPM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# How to build the RPM file

## Installation

```
yum group install "Development Tools"
yum install rpmdevtools
useradd makerpm
```

## Building the package

```
su - makerpm
rpmdev-setuptree
git clone https://github.com/dalibo/PAF.git
spectool -R -g PAF/resource-agents-paf.spec
rpmbuild -ba PAF/resource-agents-paf.spec
```


49 changes: 49 additions & 0 deletions resource-agents-paf.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
%global _tag v1.0.0
%global _ocfroot /usr/lib/ocf
Name: resource-agents-paf
Version: 1.0.0
Release: 1
Summary: PostgreSQL resource agent for Pacemaker
License: PostgreSQL
Group: Applications/Databases
Url: http://dalibo.github.io/PAF/

Source0: https://github.com/dalibo/PAF/releases/download/%{_tag}/PAF-%{_tag}.tgz
BuildArch: noarch
#BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: resource-agents perl perl-Module-Build
Provides: resource-agents-paf = %{version}

%description
PostgreSQL resource agent for Pacemaker

%prep
%setup -n PAF-%{_tag}

%build
perl Build.PL --destdir "%{buildroot}" --install_path bindoc=%{_mandir}/man1 --install_path libdoc=%{_mandir}/man3
perl Build

%install
./Build install
rm -f "%{buildroot}"/usr/local/lib64/perl5/auto/PAF/.packlist

%files
%defattr(-,root,root,0755)
%doc README.md
%license LICENSE
%{_mandir}/man1/*.1*
%{_mandir}/man3/*.3*
%{_ocfroot}/resource.d/heartbeat/pgsqlms
%{_ocfroot}/lib/heartbeat/OCF_ReturnCodes.pm
%{_ocfroot}/lib/heartbeat/OCF_Directories.pm
%{_ocfroot}/lib/heartbeat/OCF_Functions.pm
%{_datadir}/resource-agents/ocft/configs/pgsqlms

%changelog
* Wed Mar 02 2016 Jehan-Guillaume de Rorthais <[email protected]> 1.0.0-1
- Official 1.0.0 release

* Tue Mar 01 2016 Jehan-Guillaume de Rorthais <[email protected]> 0.99.0-1
- Initial version

0 comments on commit 5b4ff47

Please sign in to comment.