Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packaging/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mongodb-backup (1.0-1) unstable; urgency=medium

* Initial release.

-- Evgeniy Patlan <evgeniy.patlan@percona.com> Sun, 09 Dec 2018 18:00:13 +0000
1 change: 1 addition & 0 deletions packaging/debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
10 changes: 10 additions & 0 deletions packaging/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Source: mongodb-backup
Section: utils
Priority: optional
Maintainer: Percona LLC
Version: %{version}
Homepage: https://percona.com

Package: mongodb-backup
Architecture: amd64
Description: MongoDB backup tool
5 changes: 5 additions & 0 deletions packaging/debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: mongodb-backup

Files: *
License: ASL 2.0
9 changes: 9 additions & 0 deletions packaging/debian/files
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
SOURCE_DIR=$1
BUILD_ROOT=$2
cd $SOURCE_DIR

install -m 0755 -d $BUILD_ROOT/usr/bin
install -m 0755 bin/pmbctl $BUILD_ROOT/usr/bin/
install -m 0755 bin/pmb-agent $BUILD_ROOT/usr/bin/
install -m 0755 bin/pmb-coordinator $BUILD_ROOT/usr/bin/
3 changes: 3 additions & 0 deletions packaging/debian/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pmbctl /usr/bin/
pmb-agent /usr/bin/
pmb-coordinator /usr/bin/
56 changes: 56 additions & 0 deletions packaging/debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
PHONY: override_dh_auto_build override_dh_auto_install
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DH_VERBOSE=1

TMP=$(CURDIR)/debian/tmp/
TMPD=$(CURDIR)/debian/tmp-debug/
prefix=/usr
ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
ARCH_OS = $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
NCPU = $(shell grep -c processor /proc/cpuinfo)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

DEB_SOURCE_PACKAGE ?= $(strip $(shell egrep '^Source: ' debian/control | cut -f 2 -d ':'))
DEB_VERSION ?= $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
DEB_NOEPOCH_VERSION ?= $(shell echo $(DEB_VERSION) | cut -d: -f2-)
DEB_UPSTREAM_VERSION ?= $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//')
DEB_UPSTREAM_VERSION_MAJOR_MINOR := $(shell echo $(DEB_UPSTREAM_VERSION) | sed -r -n 's/^([0-9]+\.[0-9]+).*/\1/p')
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

DISTRIBUTION = $(shell lsb_release -i -s)
DISTRELEASE = $(shell lsb_release -c -s)

%:
dh $@

override_dh_auto_test override_dh_compress override_dh_fixperms override_dh_strip:

override_dh_auto_build:
@echo "RULES.$@"
export PATH=/usr/local/go/bin:${PATH}
export GOROOT="/usr/local/go/"
export GOPATH=${PWD}/build
export PATH="/usr/local/go/bin:${PATH}:${GOPATH}"
export GOBINPATH="/usr/local/go/bin"
mkdir -p build/src/github.com/percona/mongodb-backup
cp -r `ls | grep -v build` build/src/github.com/percona/mongodb-backup/
cd build/src/github.com/percona/mongodb-backup/ && $(MAKE) -j$(NCPU)

touch $@

override_dh_auto_install:
@echo "RULES.$@"
mkdir -p $(TMP)
cp -f build/src/github.com/percona/mongodb-backup/pmbctl $(TMP)/pmbctl
cp -f build/src/github.com/percona/mongodb-backup/pmb-agent $(TMP)/pmb-agent
cp -f build/src/github.com/percona/mongodb-backup/pmb-coordinator $(TMP)/pmb-coordinator

56 changes: 56 additions & 0 deletions packaging/rpm/mongodb-backup.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Name: mongodb-backup
Version: @@VERSION@@
Release: @@RELEASE@@%{?dist}
Summary: MongoDB backup tool

Group: Applications/Databases
License: ASL 2.0
URL: https://github.com/percona/mongodb-backup
Source0: mongodb-backup-%{version}.tar.gz

BuildRequires: upx golang make

%description
MongoDB backup tool

%prep
%setup -q -n mongodb-backup-%{version}


%build
cd ../
export PATH=/usr/local/go/bin:${PATH}
export GOROOT="/usr/local/go/"
export GOPATH=$(pwd)/
export PATH="/usr/local/go/bin:$PATH:$GOPATH"
export GOBINPATH="/usr/local/go/bin"
mkdir -p src/github.com/percona/
mv mongodb-backup-%{version} src/github.com/percona/mongodb-backup
ln -s src/github.com/percona/mongodb-backup mongodb-backup-%{version}
cd src/github.com/percona/mongodb-backup
make %{?_smp_mflags}
cd %{_builddir}


%install
rm -rf $RPM_BUILD_ROOT
install -m 755 -d $RPM_BUILD_ROOT/%{_bindir}
cd ../
export PATH=/usr/local/go/bin:${PATH}
export GOROOT="/usr/local/go/"
export GOPATH=$(pwd)/
export PATH="/usr/local/go/bin:$PATH:$GOPATH"
export GOBINPATH="/usr/local/go/bin"
cd src/github.com/percona/mongodb-backup
make install DEST_DIR=$RPM_BUILD_ROOT/%{_bindir}


%files
%{_bindir}/pmbctl
%{_bindir}/pmb-agent
%{_bindir}/pmb-coordinator


%changelog
* Sun Dec 09 2018 Evgeniy Patlan <evgeniy.patlan@percona.com>
- First build
Loading