Skip to content

Commit 8180815

Browse files
authored
Merge pull request #4 from timvaillancourt/rpm_spec_update
RPM spec rename for new repo, spec cleanup and 'make build' flag added Tested build on CentOS 6 and 7
2 parents 1e02ec2 + ab6e826 commit 8180815

File tree

4 files changed

+69
-44
lines changed

4 files changed

+69
-44
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
bin
2+
build
3+
rpmbuild
4+
*.pyc

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
PREFIX?=/usr/local
44
BASEDIR=$(DESTDIR)$(PREFIX)
55
BINDIR=$(BASEDIR)/bin
6+
VERSION=$(shell cat VERSION)
67

78
all: bin/mongodb-consistent-backup
89

@@ -16,6 +17,13 @@ install: bin/mongodb-consistent-backup
1617
uninstall:
1718
rm -f $(BINDIR)/mongodb-consistent-backup
1819

20+
rpm:
21+
rm -rf rpmbuild
22+
mkdir -p rpmbuild/{SPECS,SOURCES/mongodb_consistent_backup}
23+
cp -dpR MongoBackup conf Makefile setup.py scripts requirements.txt LICENSE README.md VERSION rpmbuild/SOURCES/mongodb_consistent_backup
24+
cp -dp scripts/mongodb_consistent_backup.spec rpmbuild/SPECS/mongodb_consistent_backup.spec
25+
tar --remove-files -C rpmbuild/SOURCES -czf rpmbuild/SOURCES/mongodb_consistent_backup.tar.gz mongodb_consistent_backup
26+
rpmbuild -D "_topdir $(PWD)/rpmbuild" -D "version $(VERSION)" -bb rpmbuild/SPECS/mongodb_consistent_backup.spec
27+
1928
clean:
20-
rm -rf ./bin
21-
rm -rf ./build
29+
rm -rf bin build rpmbuild

scripts/mongo_backup.spec

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
%define debug_package %{nil}
2+
%define bin_name mongodb-consistent-backup
3+
4+
Name: mongodb_consistent_backup
5+
Version: %{version}
6+
Release: 1%{?dist}
7+
Summary: MongoDB Consistent Backup Tool
8+
9+
Group: Software/Database
10+
License: Apache License Version 2.0
11+
URL: https://github.com/Percona-Lab/mongodb_consistent_backup
12+
Source: %{name}.tar.gz
13+
Prefix: /usr
14+
15+
# Use CentOS SCL python27 (https://www.softwarecollections.org/en/scls/rhscl/python27/) on CentOS 6 (RHEL6 untested)
16+
# On build host: 'yum install python27-python python27-python-devel python27-python-virtualenv gcc'
17+
%{?el6:Requires: python27-python}
18+
%{?el6:BuildRequires: python27-python python27-python-devel python27-python-virtualenv gcc}
19+
20+
# Use base python/virtualenv, which should be 2.7 on CentOS/RHEL 7
21+
# On build host: 'yum install python python-devel python-virtualenv gcc'
22+
%{?el7:Requires: python >= 2.7}
23+
%{?el7:BuildRequires: python >= 2.7 python-devel >= 2.7 python-virtualenv gcc}
24+
25+
26+
%description
27+
Tool for getting consistent backups from MongoDB Clusters and ReplicaSet
28+
29+
30+
%prep
31+
%setup -q -n %{name}
32+
33+
34+
%build
35+
make
36+
37+
38+
%install
39+
mkdir -p %{buildroot}%{prefix}/share/%{bin_name}
40+
install -m 0644 conf/example.yml %{buildroot}%{prefix}/share/%{bin_name}/%{bin_name}.example.yml
41+
install -m 0644 LICENSE %{buildroot}%{prefix}/share/%{bin_name}/LICENSE
42+
install -m 0644 README.md %{buildroot}%{prefix}/share/%{bin_name}/README.md
43+
44+
make PREFIX=%{prefix} DESTDIR=%{buildroot} install
45+
46+
47+
%files
48+
%{prefix}/bin/%{bin_name}
49+
%{prefix}/share/%{bin_name}/LICENSE
50+
%{prefix}/share/%{bin_name}/README.md
51+
%{prefix}/share/%{bin_name}/%{bin_name}.example.yml
52+
53+
54+
%changelog
55+

0 commit comments

Comments
 (0)