Make an initial RPM package for COPR

I'm not a RPM pro, so patches welcome! I'm surely doing something wrong.
This commit is contained in:
James Shubin
2016-02-12 11:26:12 -05:00
parent e921dfa498
commit fc14e5c70e
7 changed files with 319 additions and 9 deletions

61
mgmt.spec.in Normal file
View File

@@ -0,0 +1,61 @@
%global project_version __VERSION__
%define debug_package %{nil}
Name: mgmt
Version: __VERSION__
Release: __RELEASE__
Summary: A next generation config management prototype!
License: AGPLv3+
URL: https://github.com/purpleidea/mgmt
Source0: https://dl.fedoraproject.org/pub/alt/purpleidea/mgmt/SOURCES/mgmt-%{project_version}.tar.bz2
# graphviz should really be a "suggests", since technically it's optional
Requires: graphviz
BuildRequires: golang
BuildRequires: golang-googlecode-tools-stringer
%description
A next generation config management prototype!
%prep
%setup
%build
# FIXME: in the future, these could be vendor-ed in
mkdir -p vendor/
export GOPATH=`pwd`/vendor/
go get github.com/coreos/etcd/client
go get gopkg.in/yaml.v2
go get gopkg.in/fsnotify.v1
go get github.com/codegangsta/cli
go get github.com/coreos/go-systemd/dbus
go get github.com/coreos/go-systemd/util
make build
%install
rm -rf %{buildroot}
# _datadir is typically /usr/share/
install -d -m 0755 %{buildroot}/%{_datadir}/mgmt/
cp -a AUTHORS COPYING COPYRIGHT DOCUMENTATION.md README.md THANKS examples/ %{buildroot}/%{_datadir}/mgmt/
# install the binary
mkdir -p %{buildroot}/%{_bindir}
install -m 0755 mgmt %{buildroot}/%{_bindir}/mgmt
# profile.d bash completion
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
install misc/mgmt.bashrc -m 0755 %{buildroot}%{_sysconfdir}/profile.d/mgmt.sh
# etc dir
mkdir -p %{buildroot}%{_sysconfdir}/mgmt/
install -m 0644 misc/mgmt.conf.example %{buildroot}%{_sysconfdir}/mgmt/mgmt.conf
%files
%attr(0755, root, root) %{_sysconfdir}/profile.d/mgmt.sh
%{_datadir}/mgmt/*
%{_bindir}/mgmt
%{_sysconfdir}/mgmt/*
# this changelog is auto-generated by git log
%changelog