summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2010-12-05 16:58:50 -0600
committerSol Jerome <sol.jerome@gmail.com>2010-12-05 16:58:50 -0600
commitcbc2d9dde1fbd89727d64e2544b88e433edde919 (patch)
tree6e847e6a6c40347dbc2793b825dcb8b047374193
parent165f426083778303fcd2ee4d3fd697571de2867a (diff)
parent0cff753190c235a9ce65a920730d715a5e4a8ed4 (diff)
downloadbcfg2-cbc2d9dde1fbd89727d64e2544b88e433edde919.tar.gz
bcfg2-cbc2d9dde1fbd89727d64e2544b88e433edde919.tar.bz2
bcfg2-cbc2d9dde1fbd89727d64e2544b88e433edde919.zip
Merge branch 'master' into docs
-rw-r--r--doc/server/configurationentries.txt6
-rw-r--r--doc/server/plugins/probes/group.txt58
-rw-r--r--gentoo/bcfg2-1.0_pre1.ebuild71
-rw-r--r--gentoo/bcfg2-1.0_pre3.ebuild55
-rw-r--r--gentoo/bcfg2-1.1.0rc1.ebuild54
-rw-r--r--gentoo/bcfg2-1.1.1.ebuild (renamed from gentoo/bcfg2-1.0_pre2.ebuild)40
-rw-r--r--misc/bcfg2.spec4
-rw-r--r--osx/macports/Portfile13
-rw-r--r--osx/macports/files/patch-setup.py.diff37
-rw-r--r--redhat/Makefile19
-rw-r--r--redhat/bcfg2.spec.in32
-rw-r--r--src/lib/Server/Plugins/Packages.py25
-rw-r--r--src/lib/Server/Plugins/SSLCA.py28
-rwxr-xr-xtools/export.py34
14 files changed, 149 insertions, 327 deletions
diff --git a/doc/server/configurationentries.txt b/doc/server/configurationentries.txt
index 1146a51c6..8741e56f5 100644
--- a/doc/server/configurationentries.txt
+++ b/doc/server/configurationentries.txt
@@ -5,10 +5,10 @@
.. _Base: plugins/structures/base
.. _Bundler: plugins/structures/bundler
-.. _Cfg: plugins/generators/cfg
+.. _Cfg: plugins/generators/cfg.html
.. _TGenshi: plugins/generators/tgenshi
-.. _TCheetah: plugins/generators/tcheetah
-.. _Rules: plugins/generators/rules
+.. _TCheetah: plugins/generators/tcheetah.html
+.. _Rules: plugins/generators/rules.html
.. _server-configurationentries:
diff --git a/doc/server/plugins/probes/group.txt b/doc/server/plugins/probes/group.txt
index 13b0d12eb..f529b8b3e 100644
--- a/doc/server/plugins/probes/group.txt
+++ b/doc/server/plugins/probes/group.txt
@@ -20,57 +20,65 @@ Probe used to dynamically set client groups based on OS/distro.
if [ -e /etc/release ]; then
# Solaris
- OUTPUT=$OUTPUT'\n'`echo group:solaris`
+ OUTPUT="$OUTPUT\ngroup:solaris"
elif [ -e /etc/debian_version ]; then
# debian based
- OUTPUT=$OUTPUT'\n'`echo group:deb`
+ OUTPUT="$OUTPUT\ngroup:deb"
if [ -e /etc/lsb-release ]; then
# variant
. /etc/lsb-release
OS_GROUP=$DISTRIB_CODENAME
- DEBIAN_VERSION=$(echo "$DISTRIB_ID" | tr '[A-Z' '[a-z]')
+ DEBIAN_VERSION=$(echo "$DISTRIB_ID" | tr '[A-Z]' '[a-z]')
case "$OS_GROUP" in
"lucid")
- OUTPUT=$OUTPUT'\n'`echo group:$DISTRIB_CODENAME`
- OUTPUT=$OUTPUT'\n'`echo group:$DEBIAN_VERSION`
+ OUTPUT="$OUTPUT\ngroup:${DISTRIB_CODENAME}"
+ OUTPUT="$OUTPUT\ngroup:${DEBIAN_VERSION}"
;;
esac
else
# debian
OS_GROUP=`cat /etc/debian_version`
- OUTPUT=$OUTPUT'\n'`echo group:debian`
+ OUTPUT="$OUTPUT\ngroup:debian"
case "$OS_GROUP" in
5.*)
- OUTPUT=$OUTPUT'\n'`echo group:lenny`
+ OUTPUT="$OUTPUT\ngroup:lenny"
;;
"sid")
- OUTPUT=$OUTPUT'\n'`echo group:sid`
+ OUTPUT="$OUTPUT\ngroup:sid"
;;
esac
fi
elif [ -e /etc/redhat-release ]; then
# redhat based
- OUTPUT=$OUTPUT'\n'`echo group:rpm`
- OS_GROUP=`cat /etc/redhat-release | cut -d' ' -f1 | tr '[A-Z]' '[a-z]'`
- REDHAT_VERSION=`cat /etc/redhat-release | cut -d' ' -f3`
- case "$OS_GROUP" in
- "centos" | "fedora")
- OUTPUT=$OUTPUT'\n'`echo group:$OS_GROUP`
- OUTPUT=$OUTPUT'\n'`echo group:$OS_GROUP$REDHAT_VERSION`
- ;;
- esac
+ if [ -x /bin/rpm ]; then
+ OUTPUT="${OUTPUT}\ngroup:rpm"
+ OS_GROUP=`bin/rpm -q --qf "%{NAME}" --whatprovides redhat-release | sed 's/-release.*//' | tr '[A-Z]' '[a-z]'`
+ REDHAT_VERSION=`bin/rpm -q --qf "%{VERSION}" --whatprovides redhat-release`
+ case "$OS_GROUP" in
+ "centos" | "fedora")
+ OUTPUT="${OUTPUT}\ngroup:${OS_GROUP}"
+ OUTPUT="${OUTPUT}\ngroup:${OS_GROUP}-${REDHAT_VERSION}"
+ ;;
+ "redhat")
+ REDHAT_RELEASE=`bin/rpm -q --qf "%{RELEASE}" --whatprovides redhat-release| cut -d. -f1`
+ OUTPUT="${OUTPUT}\ngroup:${OS_GROUP}"
+ OUTPUT="${OUTPUT}\ngroup:${OS_GROUP}-${REDHAT_VERSION}"
+ OUTPUT="${OUTPUT}\ngroup:${OS_GROUP}-${REDHAT_RELEASE}"
+ ;;
+ esac
+ fi
elif [ -e /etc/gentoo-release ]; then
# gentoo
- OUTPUT=$OUTPUT'\n'`echo group:gentoo`
+ OUTPUT="$OUTPUT\ngroup:gentoo"
elif [ -x /usr/sbin/system_profiler ]; then
# os x
### NOTE: Think about using system_profiler SPSoftwareDataType here
- OUTPUT=$OUTPUT'\n'`echo group:osx`
+ OUTPUT="$OUTPUT\ngroup:osx"
OSX_VERSION=`sw_vers | grep 'ProductVersion:' | egrep -o '[0-9]+\.[0-9]+'`
if [ "$OSX_VERSION" == "10.6" ]; then
- OUTPUT=$OUTPUT'\n'`echo group:osx-snow`
+ OUTPUT="$OUTPUT\ngroup:osx-snow"
elif [ "$OSX_VERSION" == "10.5" ]; then
- OUTPUT=$OUTPUT'\n'`echo group:osx-leo`
+ OUTPUT="$OUTPUT\ngroup:osx-leo"
fi
echo $OUTPUT
else
@@ -81,16 +89,16 @@ Probe used to dynamically set client groups based on OS/distro.
case "$ARCH" in
"x86_64")
if [ "$OS_GROUP" == 'centos' ]; then
- OUTPUT=$OUTPUT'\n'`echo group:$ARCH`
+ OUTPUT="$OUTPUT\ngroup:${ARCH}"
else
- OUTPUT=$OUTPUT'\n'`echo group:amd64`
+ OUTPUT="$OUTPUT\ngroup:amd64"
fi
;;
"i386" | "i686")
- OUTPUT=$OUTPUT'\n'`echo group:i386`
+ OUTPUT="$OUTPUT\ngroup:i386"
;;
"sparc64")
- OUTPUT=$OUTPUT'\n'`echo group:sparc64`
+ OUTPUT="$OUTPUT\ngroup:sparc64"
;;
esac
diff --git a/gentoo/bcfg2-1.0_pre1.ebuild b/gentoo/bcfg2-1.0_pre1.ebuild
deleted file mode 100644
index 494588d0e..000000000
--- a/gentoo/bcfg2-1.0_pre1.ebuild
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright 1999-2004 Gentoo Technologies, Inc.
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-DESCRIPTION="Bcfg2 is a configuration management tool. Package includes client
-and server."
-HOMEPAGE="http://trac.mcs.anl.gov/projects/bcfg2"
-
-# handle the "pre" case
-MY_P="${P/_/}"
-SRC_URI="ftp://ftp.mcs.anl.gov/pub/bcfg/${MY_P}.tar.gz"
-S="${WORKDIR}/${MY_P}"
-
-LICENSE="BSD"
-RESTRICT="mirror"
-
-SLOT="0"
-KEYWORDS="~x86 ~amd64"
-IUSE="server"
-
-DEPEND="
- app-portage/gentoolkit
-
- || ( >=dev-lang/python-2.5
- (
- >=dev-lang/python-2.3
- || ( dev-python/elementtree dev-python/lxml )
- )
- )
- "
-
-RDEPEND="
- server? (
- dev-python/pyopenssl
- || ( app-admin/gamin app-admin/fam )
- )
- "
-
-src_compile() {
- python setup.py build
-}
-
-src_install() {
- python setup.py install \
- --root=${D} \
- --record=PY_SERVER_LIBS \
- --install-scripts /usr/sbin
-
- # Remove files only necessary for a server installation
- if ! use server; then
- rm -rf ${D}/usr/sbin/bcfg2-*
- rm -rf ${D}/usr/share/bcfg2
- rm -rf ${D}/usr/share/man/man8
- fi
-
- # Install a server init.d script
- if use server; then
- newinitd ${FILESDIR}/bcfg2-server.rc bcfg2-server
- fi
-
- insinto /etc
- doins ${S}/examples/bcfg2.conf
-}
-
-pkg_postinst () {
- depscan.sh
-}
-
-pkg_postrm () {
- depscan.sh
-}
diff --git a/gentoo/bcfg2-1.0_pre3.ebuild b/gentoo/bcfg2-1.0_pre3.ebuild
deleted file mode 100644
index 6b366dcb0..000000000
--- a/gentoo/bcfg2-1.0_pre3.ebuild
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-inherit distutils
-
-DESCRIPTION="Bcfg2 is a configuration management tool."
-HOMEPAGE="http://trac.mcs.anl.gov/projects/bcfg2"
-
-# handle the "pre" case
-MY_P="${P/_/}"
-SRC_URI="ftp://ftp.mcs.anl.gov/pub/bcfg/${MY_P}.tar.gz"
-S="${WORKDIR}/${MY_P}"
-
-LICENSE="BSD"
-SLOT="1"
-KEYWORDS="~amd64 ~x86"
-IUSE="server"
-
-DEPEND=">=dev-lang/python-2.5"
-
-RDEPEND="app-portage/gentoolkit
- || ( dev-python/ssl-py26 >=dev-lang/python-2.6 )
- server? (
- dev-python/lxml
- app-admin/gam-server )"
-
-src_install() {
- distutils_src_install --record=PY_SERVER_LIBS --install-scripts /usr/sbin
-
- # Remove files only necessary for a server installation
- if ! use server; then
- rm -rf "${D}"/usr/sbin/bcfg2-*
- rm -rf "${D}"/usr/share/bcfg2
- rm -rf "${D}"/usr/share/man/man8
- fi
-
- # Install a server init.d script
- if use server; then
- newinitd "${FILESDIR}"/bcfg2-server.rc bcfg2-server
- fi
-
- insinto /etc
- doins "${S}"/examples/bcfg2.conf
-}
-
-pkg_postinst () {
- depscan.sh
- use server && einfo "If this is a new installation, you probably need to run: "
- use server && einfo " bcfg2-admin init"
-}
-
-pkg_postrm () {
- depscan.sh
-}
diff --git a/gentoo/bcfg2-1.1.0rc1.ebuild b/gentoo/bcfg2-1.1.0rc1.ebuild
deleted file mode 100644
index c482a5d70..000000000
--- a/gentoo/bcfg2-1.1.0rc1.ebuild
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-inherit distutils
-
-DESCRIPTION="Bcfg2 is a configuration management tool."
-HOMEPAGE="http://trac.mcs.anl.gov/projects/bcfg2"
-
-# handle the "pre" case
-MY_P="${P/_/}"
-SRC_URI="ftp://ftp.mcs.anl.gov/pub/bcfg/${MY_P}.tar.gz"
-S="${WORKDIR}/${MY_P}"
-
-LICENSE="BSD"
-SLOT="1"
-KEYWORDS="~amd64 ~x86"
-IUSE="server"
-
-DEPEND=">=dev-lang/python-2.5"
-
-RDEPEND="app-portage/gentoolkit
- >=dev-lang/python-2.6
- server? (
- dev-python/lxml
- app-admin/gam-server )"
-
-src_install() {
- distutils_src_install --record=PY_SERVER_LIBS --install-scripts /usr/sbin
-
- # Remove files only necessary for a server installation
- if ! use server; then
- rm -rf "${D}"/usr/sbin/bcfg2-*
- rm -rf "${D}"/usr/share/bcfg2
- rm -rf "${D}"/usr/share/man/man8
- fi
-
- # Install a server init.d script
- if use server; then
- newinitd "${FILESDIR}"/bcfg2-server.rc bcfg2-server
- fi
-
- insinto /etc
- doins "${S}"/examples/bcfg2.conf
-}
-
-pkg_postinst () {
- use server && einfo "If this is a new installation, you probably need to run: "
- use server && einfo " bcfg2-admin init"
-}
-
-pkg_postrm () {
- python_mod_cleanup
-}
diff --git a/gentoo/bcfg2-1.0_pre2.ebuild b/gentoo/bcfg2-1.1.1.ebuild
index dd4eab709..6b41c16ea 100644
--- a/gentoo/bcfg2-1.0_pre2.ebuild
+++ b/gentoo/bcfg2-1.1.1.ebuild
@@ -1,7 +1,13 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
+EAPI="3"
+PYTHON_DEPEND="2:2.6"
+SUPPORT_PYTHON_ABIS="1"
+# ssl module required.
+RESTRICT_PYTHON_ABIS="2.4 2.5 3.*"
+
inherit distutils
DESCRIPTION="Bcfg2 is a configuration management tool."
@@ -14,26 +20,25 @@ S="${WORKDIR}/${MY_P}"
LICENSE="BSD"
SLOT="0"
-KEYWORDS="~amd64 ~x86"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-solaris"
IUSE="server"
-DEPEND=">=dev-lang/python-2.5
- dev-python/m2crypto"
-
-RDEPEND="app-portage/gentoolkit
+DEPEND="app-portage/gentoolkit
server? (
dev-python/lxml
- dev-python/pyopenssl
app-admin/gam-server )"
+RDEPEND="${DEPEND}"
+
+PYTHON_MODNAME="Bcfg2"
src_install() {
- distutils_src_install --record=PY_SERVER_LIBS --install-scripts /usr/sbin
+ distutils_src_install --record=PY_SERVER_LIBS --install-scripts "${EPREFIX}"/usr/sbin
# Remove files only necessary for a server installation
if ! use server; then
- rm -rf "${D}"/usr/sbin/bcfg2-*
- rm -rf "${D}"/usr/share/bcfg2
- rm -rf "${D}"/usr/share/man/man8
+ rm -rf "${ED}"usr/sbin/bcfg2-*
+ rm -rf "${ED}"usr/share/bcfg2
+ rm -rf "${ED}"usr/share/man/man8
fi
# Install a server init.d script
@@ -42,15 +47,14 @@ src_install() {
fi
insinto /etc
- doins "${S}"/examples/bcfg2.conf
+ doins examples/bcfg2.conf
}
pkg_postinst () {
- depscan.sh
- use server && einfo "If this is a new installation, you probably need to run: "
- use server && einfo " bcfg2-admin init"
-}
+ distutils_pkg_postinst
-pkg_postrm () {
- depscan.sh
+ if use server; then
+ einfo "If this is a new installation, you probably need to run:"
+ einfo " bcfg2-admin init"
+ fi
}
diff --git a/misc/bcfg2.spec b/misc/bcfg2.spec
index 8e77ad908..30fadf206 100644
--- a/misc/bcfg2.spec
+++ b/misc/bcfg2.spec
@@ -168,8 +168,8 @@ deployment strategies.
%{_sbindir}/bcfg2
%{python_sitelib}/Bcfg2/*.py*
%{python_sitelib}/Bcfg2/Client/*
-%{_mandir}/man1/*
-%{_mandir}/man5/*
+{_mandir}/man1/bcfg2.1*
+%{_mandir}/man5/bcfg2.conf.5*
%{_initrddir}/bcfg2
%config(noreplace) %{_sysconfdir}/default/bcfg2
%{_sysconfdir}/cron.hourly/bcfg2
diff --git a/osx/macports/Portfile b/osx/macports/Portfile
index 91e8e0384..ed9d9b25b 100644
--- a/osx/macports/Portfile
+++ b/osx/macports/Portfile
@@ -5,10 +5,12 @@ PortSystem 1.0
PortGroup python26 1.0
name bcfg2
-license BSD
-version 1.0.1
+version 1.1.1
categories sysutils python
-maintainers ices.utexas.edu:solj
+maintainers gmail.com:sol.jerome
+license BSD
+supported_archs noarch
+
description Bcfg2 configuration management system
long_description Bcfg2 helps system administrators deploy complex \
changes across large numbers of systems in a \
@@ -18,9 +20,8 @@ homepage http://www.bcfg2.org/
platforms darwin
master_sites ftp://ftp.mcs.anl.gov/pub/bcfg
-checksums md5 6fbf36acc5cc58b2504a25c25cad3921 \
- sha1 36cac49009c906d4cb61e36a7a8c7b6859518862 \
- rmd160 fae98b10b721d059a9a483e046b83bd61458179d
+checksums sha1 c0214d28796805ff8e3522d348914f366ba860aa \
+ rmd160 2b7d8dfc2e14d1a2def743fe525ee91c5a3d3342
patchfiles patch-setup.py.diff
diff --git a/osx/macports/files/patch-setup.py.diff b/osx/macports/files/patch-setup.py.diff
index cc948face..f78d27e5c 100644
--- a/osx/macports/files/patch-setup.py.diff
+++ b/osx/macports/files/patch-setup.py.diff
@@ -1,26 +1,26 @@
---- setup.py.orig 2009-11-20 16:07:52.000000000 -0600
-+++ setup.py 2009-11-20 16:29:56.000000000 -0600
-@@ -5,45 +5,19 @@
-
- setup(name="Bcfg2",
- version="1.0.1",
+--- setup.py 2010-11-15 15:30:28.000000000 -0600
++++ setup.py.macports 2010-11-18 19:06:49.155292524 -0600
+@@ -11,47 +11,22 @@
+ setup(cmdclass=cmdclass,
+ name="Bcfg2",
+ version="1.1.1",
- description="Bcfg2 Server",
+ description="Bcfg2 Client",
author="Narayan Desai",
author_email="desai@mcs.anl.gov",
-- packages=["Bcfg2",
-- "Bcfg2.Client",
-+ packages=["Bcfg2.Client",
+- packages=["Bcfg2",
+- "Bcfg2.Client",
++ packages=["Bcfg2.Client",
"Bcfg2.Client.Tools",
-- 'Bcfg2.Server',
+- 'Bcfg2.Server',
- "Bcfg2.Server.Admin",
-- "Bcfg2.Server.Hostbase",
-- "Bcfg2.Server.Hostbase.hostbase",
-- "Bcfg2.Server.Plugins",
-- "Bcfg2.Server.Reports",
+- "Bcfg2.Server.Hostbase",
+- "Bcfg2.Server.Hostbase.hostbase",
+- "Bcfg2.Server.Plugins",
+- "Bcfg2.Server.Reports",
- "Bcfg2.Server.Reports.reports",
- "Bcfg2.Server.Reports.reports.templatetags",
-- "Bcfg2.Server.Snapshots",
+- "Bcfg2.Server.Snapshots",
],
+ py_modules = ["Bcfg2.Options",
+ "Bcfg2.Proxy",
@@ -36,6 +36,9 @@
- ('share/bcfg2/xsl-transforms/xsl-transform-includes',
- glob('reports/xsl-transforms/xsl-transform-includes/*.xsl')),
- ('share/man/man1', glob("man/bcfg2.1")),
++ package_data = {'Bcfg2.Server.Reports.reports':['fixtures/*.xml',
++ 'templates/*.html', 'templates/*/*.html',
++ 'templates/*/*.inc' ] },
+ scripts = glob('src/sbin/bcfg2'),
+ data_files = [('share/man/man1', glob("man/bcfg2.1")),
('share/man/man5', glob("man/*.5")),
@@ -49,7 +52,9 @@
- ('share/bcfg2/Reports/templates/config_items',
- glob('src/lib/Server/Reports/reports/templates/config_items/*')),
- ('share/bcfg2/Hostbase/templates',
-- glob('src/lib/Server/Hostbase/hostbase/webtemplates/*')),
+- glob('src/lib/Server/Hostbase/hostbase/webtemplates/*.*')),
+- ('share/bcfg2/Hostbase/templates/hostbase',
+- glob('src/lib/Server/Hostbase/hostbase/webtemplates/hostbase/*')),
- ('share/bcfg2/Hostbase/repo',
- glob('src/lib/Server/Hostbase/templates/*')),
]
diff --git a/redhat/Makefile b/redhat/Makefile
index bf7c69591..7533b98da 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -11,15 +11,15 @@
.PHONY: cvs-export git-export svn-export test-export
.PHONY: cvs-clean git-clean svn-clean test-clean
-SCM_TYPE := svn
+SCM_TYPE := git
SCM_PATH := ../
#CVSROOT := $(shell cat 2>/dev/null src/CVS/Root)
-SVN_PATH := $(shell svn info ${SCM_PATH} 2>/dev/null | awk '/^URL:/{print $$2}')
-SVN_REV := $(shell svn info ${SVN_PATH} 2>/dev/null | awk '/^Last Changed Rev:/{print $$4}')
+#SVN_PATH := $(shell svn info ${SCM_PATH} 2>/dev/null | awk '/^URL:/{print $$2}')
+#SVN_REV := $(shell svn info ${SVN_PATH} 2>/dev/null | awk '/^Last Changed Rev:/{print $$4}')
PACKAGE := $(shell cat PACKAGE)
VERSION := $(shell cat VERSION)
-RELEASE := $(shell cat RELEASE)r${SVN_REV}
+RELEASE := $(shell cat RELEASE)
BASE_VER := ${VERSION}-${RELEASE}
CURRENT_PACKAGE := $(PACKAGE)-$(BASE_VER)
TARBALL := $(CURRENT_PACKAGE).tar
@@ -80,8 +80,8 @@ buildtargz: buildtarball
# This target copies files that are not in svn into the build tree
prepbuildtarball: $(SCM_TYPE)-export
- @cp ${PACKAGE}.spec ./build/${CURRENT_PACKAGE}/redhat && \
- cp -R scripts ./build/${CURRENT_PACKAGE}/redhat
+ @cp ${PACKAGE}.spec ./build/${CURRENT_PACKAGE}/redhat/ && \
+ cp -R scripts ./build/${CURRENT_PACKAGE}/redhat/
specfile: $(PACKAGE).spec
@@ -113,11 +113,8 @@ test-export: builddir
--file -
git-export: builddir prepclean
- @git-tar-tree HEAD $(PACKAGE)-$(VERSION) \
- | tar \
- --extract \
- --directory ./build/ \
- --file -
+ @cd ../ && git archive --format=tar --prefix=$(CURRENT_PACKAGE)/ HEAD \
+ | (cd redhat/build && tar xf -)
git-clean:
@:
diff --git a/redhat/bcfg2.spec.in b/redhat/bcfg2.spec.in
index 40f2d6df2..9378e9267 100644
--- a/redhat/bcfg2.spec.in
+++ b/redhat/bcfg2.spec.in
@@ -1,4 +1,6 @@
-# This file is licensed under the GPL
+%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%endif
Name: @PACKAGE@
Version: @VERSION@
@@ -7,23 +9,15 @@ Release: @RELEASE@
%define __python python
%{!?py_ver: %define py_ver %(%{__python} -c 'import sys;print(sys.version[0:3])')}
%define pythonversion %{py_ver}
-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?_initrddir: %define _initrddir %{_sysconfdir}/rc.d/init.d}
-# Most rpm-based distributions include the lxml package a 'python-lxml',
-# but some distributions and some people who roll their own lxml packages
-# call it just 'lxml'. We'll try to catch both.
-%define dfl_lxml python-lxml
-%define alt_lxml lxml
-%define lxmldep %(rpm -q %{alt_lxml} 2>&1 > /dev/null && echo %{alt_lxml} || echo %{dfl_lxml})
-
Summary: Configuration management system
+
Group: Applications/System
License: BSD
URL: http://trac.mcs.anl.gov/projects/bcfg2
Source0: %{name}-%{version}-%{release}.tar.gz
-BuildRoot: %{_builddir}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
%if 0%{?fedora} >= 8
@@ -35,7 +29,7 @@ BuildRequires: python-setuptools
%if "%{py_ver}" == "2.4"
Requires: python-elementtree
%else if "%{py_ver}" < "2.5"
-Requires: %{lxmldep} >= 0.9
+Requires: python-lxml
%endif
Requires: initscripts
Requires(post): /sbin/chkconfig
@@ -43,7 +37,6 @@ Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
Requires(postun): /sbin/service
-
%description
Bcfg2 helps system administrators produce a consistent, reproducible,
and verifiable description of their environment, and offers
@@ -77,7 +70,7 @@ Requires: bcfg2 = %{version}-%{release}
%if "%{py_ver}" < "2.6"
Requires: python-ssl
%endif
-Requires: %{lxmldep} >= 0.9
+Requires: python-lxml >= 0.9
Requires: /usr/bin/openssl
Requires: gamin-python
Requires(post): /sbin/chkconfig
@@ -93,6 +86,7 @@ Configuration management server
# fixup some paths
%{__perl} -pi -e 's@/etc/default@%{_sysconfdir}/sysconfig@g' debian/bcfg2.init
+%{__perl} -pi -e 's@/etc/default@%{_sysconfdir}/sysconfig@g' debian/bcfg2-server.init
%{__perl} -pi -e 's@/etc/default@%{_sysconfdir}/sysconfig@g' tools/bcfg2-cron
%{__perl} -pi -e 's@/usr/lib/bcfg2@%{_libexecdir}@g' debian/bcfg2.cron.daily
@@ -111,10 +105,9 @@ done
%build
%{__python} -c 'import setuptools; execfile("setup.py")' build
-
%install
rm -rf %{buildroot}
-%{__python} -c 'import setuptools; execfile("setup.py")' install --skip-build --root %{buildroot} --prefix=/usr
+%{__python} -c 'import setuptools; execfile("setup.py")' install --skip-build --root %{buildroot}
mkdir -p %{buildroot}%{_sbindir}
mkdir -p %{buildroot}%{_initrddir}
@@ -200,7 +193,6 @@ fi
%dir %{_var}/cache/bcfg2
-
%files server
%defattr(-,root,root,-)
@@ -220,11 +212,7 @@ fi
%{_sbindir}/bcfg2-reports
%{_sbindir}/bcfg2-server
-%{_mandir}/man8/bcfg2-admin.8*
-%{_mandir}/man8/bcfg2-build-reports.8*
-%{_mandir}/man8/bcfg2-info.8*
-%{_mandir}/man8/bcfg2-repo-validate.8*
-%{_mandir}/man8/bcfg2-server.8*
+%{_mandir}/man8/*.8*
%dir %{_var}/lib/bcfg2
diff --git a/src/lib/Server/Plugins/Packages.py b/src/lib/Server/Plugins/Packages.py
index 194330723..ee21fb622 100644
--- a/src/lib/Server/Plugins/Packages.py
+++ b/src/lib/Server/Plugins/Packages.py
@@ -76,8 +76,8 @@ def _fetch_url(url):
class Source(object):
basegroups = []
- def __init__(self, basepath, url, version, arches, components, groups, rawurl,
- blacklist, whitelist, recommended):
+ def __init__(self, basepath, url, version, arches, components, groups,
+ rawurl, blacklist, whitelist, recommended):
self.basepath = basepath
self.version = version
self.components = components
@@ -112,7 +112,8 @@ class Source(object):
try:
self.read_files()
except:
- logger.error("Packages: File read failed; falling back to file download")
+ logger.error("Packages: File read failed; "
+ "falling back to file download")
should_download = True
if should_download or force_update:
@@ -389,7 +390,7 @@ class APTSource(Source):
if self.recommended:
depfnames = ['Depends', 'Pre-Depends', 'Recommends']
else:
- depfnames = ['Depends', 'Pre-Depends']
+ depfnames = ['Depends', 'Pre-Depends']
for fname in self.files:
if not self.rawurl:
barch = [x for x in fname.split('@') if x.startswith('binary-')][0][7:]
@@ -504,7 +505,6 @@ class PACSource(Source):
raise Exception("PACSource : RAWUrl not supported (yet)")
urls = property(get_urls)
-
def read_files(self):
bdeps = dict()
bprov = dict()
@@ -512,7 +512,7 @@ class PACSource(Source):
if self.recommended:
depfnames = ['Depends', 'Pre-Depends', 'Recommends']
else:
- depfnames = ['Depends', 'Pre-Depends']
+ depfnames = ['Depends', 'Pre-Depends']
for fname in self.files:
if not self.rawurl:
@@ -535,8 +535,8 @@ class PACSource(Source):
for tarinfo in tar:
if tarinfo.isdir():
- self.pkgnames.add(tarinfo.name.rsplit("-",2)[0])
- print "added : " + tarinfo.name.rsplit("-",2)[0]
+ self.pkgnames.add(tarinfo.name.rsplit("-", 2)[0])
+ print "added : " + tarinfo.name.rsplit("-", 2)[0]
tar.close()
self.deps['global'] = dict()
@@ -676,7 +676,7 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
# do while unclassified or vpkgs or both or pkgs
while unclassified or pkgs or both or final_pass:
#print len(unclassified), len(pkgs), len(both), len(vpkgs), final_pass
- if really_done:
+ if really_done:
break
if len(unclassified) + len(pkgs) + len(both) == 0:
# one more pass then exit
@@ -760,7 +760,9 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
meta - client metadata instance
structures - a list of structure-stage entry combinations
'''
- if self.disableResolver: return # Config requests no resolver
+ if self.disableResolver:
+ # Config requests no resolver
+ return
initial = set([pkg.get('name') for struct in structures \
for pkg in struct.findall('Package') +
@@ -857,7 +859,8 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
cachefiles = []
for source in self.sources:
cachefiles.append(source.cachefile)
- if not self.disableMetaData: source.setup_data(force_update)
+ if not self.disableMetaData:
+ source.setup_data(force_update)
self.sentinels.update(source.basegroups)
for cfile in glob.glob("%s/cache-*" % self.cachepath):
if cfile not in cachefiles:
diff --git a/src/lib/Server/Plugins/SSLCA.py b/src/lib/Server/Plugins/SSLCA.py
index 0dc448e69..4125cd498 100644
--- a/src/lib/Server/Plugins/SSLCA.py
+++ b/src/lib/Server/Plugins/SSLCA.py
@@ -7,6 +7,7 @@ import os
from subprocess import Popen, PIPE, STDOUT
from ConfigParser import ConfigParser
+
class SSLCA(Bcfg2.Server.Plugin.GroupSpool):
"""
The SSLCA generator handles the creation and
@@ -34,9 +35,9 @@ class SSLCA(Bcfg2.Server.Plugin.GroupSpool):
ident = self.handles[event.requestID] + event.filename
else:
ident = self.handles[event.requestID][:-1]
-
+
fname = "".join([ident, '/', event.filename])
-
+
if event.filename.endswith('.xml'):
if action in ['exists', 'created', 'changed']:
if event.filename.endswith('key.xml'):
@@ -89,12 +90,12 @@ class SSLCA(Bcfg2.Server.Plugin.GroupSpool):
of a new key if one doesn't exist.
"""
# set path type and permissions, otherwise bcfg2 won't bind the file
- permdata = {'owner':'root',
- 'group':'root',
- 'type':'file',
- 'perms':'644'}
+ permdata = {'owner': 'root',
+ 'group': 'root',
+ 'type': 'file',
+ 'perms': '644'}
[entry.attrib.__setitem__(key, permdata[key]) for key in permdata]
-
+
# check if we already have a hostfile, or need to generate a new key
# TODO: verify key fits the specs
path = entry.get('name')
@@ -125,10 +126,10 @@ class SSLCA(Bcfg2.Server.Plugin.GroupSpool):
of a new cert if one doesn't exist.
"""
# set path type and permissions, otherwise bcfg2 won't bind the file
- permdata = {'owner':'root',
- 'group':'root',
- 'type':'file',
- 'perms':'644'}
+ permdata = {'owner': 'root',
+ 'group': 'root',
+ 'type': 'file',
+ 'perms': '644'}
[entry.attrib.__setitem__(key, permdata[key]) for key in permdata]
path = entry.get('name')
@@ -157,7 +158,7 @@ class SSLCA(Bcfg2.Server.Plugin.GroupSpool):
"""
chaincert = self.CAs[self.cert_specs[entry.get('name')]['ca']].get('chaincert')
cert = self.data + filename
- cmd = "openssl verify -CAfile %s %s" % (chaincert, cert)
+ cmd = "openssl verify -CAfile %s %s" % (chaincert, cert)
res = Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT).stdout.read()
if res == cert + ": OK\n":
return True
@@ -225,7 +226,7 @@ class SSLCA(Bcfg2.Server.Plugin.GroupSpool):
cp.write(conffile)
conffile.close()
return conffile.name
-
+
def build_request(self, key_filename, req_config, entry):
"""
creates the certificate request
@@ -236,4 +237,3 @@ class SSLCA(Bcfg2.Server.Plugin.GroupSpool):
cmd = "openssl req -new -config %s -days %s -key %s -text -out %s" % (req_config, days, key, req)
res = Popen(cmd, shell=True, stdout=PIPE).stdout.read()
return req
-
diff --git a/tools/export.py b/tools/export.py
index fcb9e5a4d..c64ff90a2 100755
--- a/tools/export.py
+++ b/tools/export.py
@@ -10,20 +10,14 @@ from subprocess import Popen, PIPE
import sys
pkgname = 'bcfg2'
-repo = 'https://svn.mcs.anl.gov/repos/bcfg'
+ftphost = 'terra.mcs.anl.gov'
+ftpdir = '/mcs/ftp/pub/bcfg'
version = raw_input("Please enter the version you are tagging (e.g. 1.0.0): ")
-tagstr = version.replace('.', '_')
-
-expath = "/tmp/%s-%s/" % (pkgname, version)
-tarname = "/tmp/%s-%s.tar.gz" % (pkgname, version)
+tarname = '/tmp/%s-%s.tar.gz' % (pkgname, version)
def run(command):
return Popen(command, shell=True, stdout=PIPE).communicate()
-#FIXME: someone please figure out how to do this using the python svn bindings
-cmd = "svn info | grep URL | awk '{print $2}'"
-url = run(cmd)[0].strip()
-
# update the version
majorver = version[:5]
minorver = version[5:]
@@ -65,20 +59,22 @@ for line in fileinput.input('solaris/Makefile', inplace=1):
if line.startswith('VERS='):
line = line.replace(line, 'VERS=%s-1\n' % version)
sys.stdout.write(line)
+
# tag the release
-cmd = "svn ci -m 'Version bump to %s'" % version
+#FIXME: do this using python-dulwich
+cmd = "git commit -asm 'Version bump to %s'" % version
output = run(cmd)[0].strip()
-cmd = "svn copy %s %s/tags/%s_%s -m 'tagged %s release'" % \
- (url, repo, pkgname, tagstr, version)
+# NOTE: This will use the default email address key. If you want to sign the tag
+# using a different key, you will need to set 'signingkey' to the proper
+# value in the [user] section of your git configuration.
+cmd = "git tag -s v%s -m 'tagged %s release'" % (version, version)
output = run(cmd)[0].strip()
-cmd = "svn export %s" % expath
-output = run(cmd)[0].strip()
-cmd = "svn log -v %s/tags/%s_%s > %sChangelog" % \
- (repo, pkgname, tagstr, expath)
-output = run(cmd)[0].strip()
-cmd = "tar czf %s %s" % (tarname, expath)
+cmd = "git archive --format=tar --prefix=%s-%s/ v%s | gzip > %s" % \
+ (pkgname, version, version, tarname)
output = run(cmd)[0].strip()
cmd = "gpg --armor --output %s.gpg --detach-sig %s" % (tarname, tarname)
output = run(cmd)[0].strip()
-cmd = "scp %s* terra.mcs.anl.gov:/mcs/ftp/pub/bcfg" % tarname
+
+# upload release to ftp
+cmd = "scp %s* terra.mcs.anl.gov:/mcs/ftp/pub/bcfg/" % tarname
output = run(cmd)[0].strip()