Update the spec file with the rpm macro to put the unit file
in the system-wide unit file directory based on:
[root@1713bbf19a0b /]# rpmbuild --eval '%{_unitdir}'
/usr/lib/systemd/system
Allow user to create a drop directory to specify options
via environment variables.
Resolves https://github.com/purpleidea/mgmt/issues/12.
67 lines
1.9 KiB
Plaintext
67 lines
1.9 KiB
Plaintext
%global project_version __VERSION__
|
|
%define debug_package %{nil}
|
|
|
|
Name: __PROGRAM__
|
|
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/__PROGRAM__/SOURCES/__PROGRAM__-%{project_version}.tar.bz2
|
|
|
|
# graphviz should really be a "suggests", since technically it's optional
|
|
Requires: graphviz
|
|
|
|
BuildRequires: golang
|
|
BuildRequires: golang-googlecode-tools-stringer
|
|
BuildRequires: git-core
|
|
BuildRequires: mercurial
|
|
|
|
%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}/__PROGRAM__/
|
|
cp -a AUTHORS COPYING COPYRIGHT DOCUMENTATION.md README.md THANKS examples/ %{buildroot}/%{_datadir}/__PROGRAM__/
|
|
mkdir -p %{buildroot}/%{_unitdir}/
|
|
install -pm 0644 misc/__PROGRAM__.service %{buildroot}/%{_unitdir}/
|
|
|
|
# install the binary
|
|
mkdir -p %{buildroot}/%{_bindir}
|
|
install -m 0755 __PROGRAM__ %{buildroot}/%{_bindir}/__PROGRAM__
|
|
|
|
# profile.d bash completion
|
|
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
|
|
install misc/bashrc.sh -m 0755 %{buildroot}%{_sysconfdir}/profile.d/__PROGRAM__.sh
|
|
|
|
# etc dir
|
|
mkdir -p %{buildroot}%{_sysconfdir}/__PROGRAM__/
|
|
install -m 0644 misc/example.conf %{buildroot}%{_sysconfdir}/__PROGRAM__/__PROGRAM__.conf
|
|
|
|
%files
|
|
%attr(0755, root, root) %{_sysconfdir}/profile.d/__PROGRAM__.sh
|
|
%{_datadir}/__PROGRAM__/*
|
|
%{_bindir}/__PROGRAM__
|
|
%{_sysconfdir}/__PROGRAM__/*
|
|
%{_unitdir}/__PROGRAM__.service
|
|
|
|
# this changelog is auto-generated by git log
|
|
%changelog
|