|
|
@@ -0,0 +1,103 @@
|
|
|
+##
|
|
|
+## confd.spec -- OpenPKG RPM Package Specification
|
|
|
+## Copyright (c) 2000-2014 OpenPKG Foundation e.V. <http://openpkg.net/>
|
|
|
+##
|
|
|
+## Permission to use, copy, modify, and distribute this software for
|
|
|
+## any purpose with or without fee is hereby granted, provided that
|
|
|
+## the above copyright notice and this permission notice appear in all
|
|
|
+## copies.
|
|
|
+##
|
|
|
+## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
|
|
+## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
+## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
+## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
|
|
|
+## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
|
|
+## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
+## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
+## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
|
+## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
+## SUCH DAMAGE.
|
|
|
+##
|
|
|
+
|
|
|
+# package version
|
|
|
+%define V_opkg 0.5.0b2
|
|
|
+%define V_dist 0.5.0-beta2
|
|
|
+
|
|
|
+# package information
|
|
|
+Name: confd
|
|
|
+Summary: Configuration Management Server
|
|
|
+URL: http://www.confd.io/
|
|
|
+Vendor: Kelsey Hightower
|
|
|
+Packager: OpenPKG Foundation e.V.
|
|
|
+Distribution: OpenPKG Community
|
|
|
+Class: EVAL
|
|
|
+Group: Network
|
|
|
+License: MIT
|
|
|
+Version: %{V_opkg}
|
|
|
+Release: 20140705
|
|
|
+
|
|
|
+# list of sources
|
|
|
+Source0: https://github.com/kelseyhightower/confd/archive/v%{V_dist}.tar.gz
|
|
|
+Source1: confd.toml
|
|
|
+Source2: rc.confd
|
|
|
+Source3: example.toml
|
|
|
+Source4: example.conf.tmpl
|
|
|
+
|
|
|
+# build information
|
|
|
+BuildPreReq: OpenPKG, openpkg >= 20120101, go
|
|
|
+PreReq: OpenPKG, openpkg >= 20120101, etcd
|
|
|
+
|
|
|
+%description
|
|
|
+ confd(8) is a lightweight configuration management tool focusing on:
|
|
|
+ keeping local configuration files up-to-date by polling etcd(8) and
|
|
|
+ processing template resources; reloading applications to pick up new
|
|
|
+ config file changes.
|
|
|
+
|
|
|
+%track
|
|
|
+ prog confd = {
|
|
|
+ version = %{version}
|
|
|
+ url = https://github.com/kelseyhightower/confd/releases
|
|
|
+ regex = v(__VER__)\.tar\.gz
|
|
|
+ }
|
|
|
+
|
|
|
+%prep
|
|
|
+ %setup -q -n confd-%{V_dist}
|
|
|
+
|
|
|
+%build
|
|
|
+ %{l_shtool} subst \
|
|
|
+ -e 's;/etc/confd/confd.toml;%{l_prefix}/etc/confd/confd.toml;' \
|
|
|
+ confd.go
|
|
|
+ mkdir -p Godeps/_workspace/src/github.com/kelseyhightower
|
|
|
+ ln -s ../../../../.. Godeps/_workspace/src/github.com/kelseyhightower/confd
|
|
|
+ export GOBIN=`pwd`/bin
|
|
|
+ export GOPATH=`pwd`/Godeps/_workspace
|
|
|
+ go install github.com/kelseyhightower/confd
|
|
|
+
|
|
|
+%install
|
|
|
+ %{l_shtool} mkdir -f -p -m 755 \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/sbin \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/etc/confd/conf.d/template \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/var/confd/run \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/var/confd/log \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/var/confd/out
|
|
|
+ %{l_shtool} install -c -s -m 755 \
|
|
|
+ bin/confd $RPM_BUILD_ROOT%{l_prefix}/sbin/
|
|
|
+ %{l_shtool} install -c -m 644 %{l_value -s -a} \
|
|
|
+ %{SOURCE confd.toml} $RPM_BUILD_ROOT%{l_prefix}/etc/confd/
|
|
|
+ %{l_shtool} install -c -m 644 %{l_value -s -a} \
|
|
|
+ %{SOURCE example.toml} $RPM_BUILD_ROOT%{l_prefix}/etc/confd/conf.d/
|
|
|
+ %{l_shtool} install -c -m 644 %{l_value -s -a} \
|
|
|
+ %{SOURCE example.conf.tmpl} $RPM_BUILD_ROOT%{l_prefix}/etc/confd/conf.d/template/
|
|
|
+ %{l_shtool} install -c -m 755 %{l_value -s -a} \
|
|
|
+ %{SOURCE rc.confd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
|
|
|
+ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
|
|
|
+ %{l_files_std} \
|
|
|
+ '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/confd/*'
|
|
|
+
|
|
|
+%files -f files
|
|
|
+
|
|
|
+%clean
|
|
|
+
|