[packages/chef] use FHS paths: /var/lib/chef, /var/cache/chef

glen glen at pld-linux.org
Tue Apr 30 00:50:07 CEST 2013


commit bc8e654741ac7e64f7d551dedb9c9c2bd739c31c
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Apr 30 01:40:34 2013 +0300

    use FHS paths: /var/lib/chef, /var/cache/chef

 FHS.patch | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 chef.spec |  14 ++++-----
 2 files changed, 110 insertions(+), 7 deletions(-)
---
diff --git a/chef.spec b/chef.spec
index e8a6017..a5af807 100644
--- a/chef.spec
+++ b/chef.spec
@@ -1,14 +1,13 @@
-# TODO
-# - try not to use /var/chef
 Summary:	A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure
 Name:		chef
 Version:	11.4.4
-Release:	0.11
+Release:	0.12
 License:	Apache v2.0
 Group:		Development/Languages
 Source0:	http://rubygems.org/downloads/%{name}-%{version}.gem
 # Source0-md5:	dc50aa6a4a7d4785a4c82fcaab3f9436
 Patch0:		platform-pld.patch
+Patch1:		FHS.patch
 URL:		http://wiki.opscode.com/display/chef
 BuildRequires:	rpm-rubyprov
 BuildRequires:	rpmbuild(macros) >= 1.656
@@ -49,16 +48,17 @@ configuration management to your entire infrastructure.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir}}
+install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir}} \
+	$RPM_BUILD_ROOT{%{_sysconfdir},/var/{cache,lib}}/%{name}
 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
 
-install -d $RPM_BUILD_ROOT{%{_sysconfdir},/var}/%{name}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -76,5 +76,5 @@ rm -rf $RPM_BUILD_ROOT
 %{ruby_vendorlibdir}/chef.rb
 %{ruby_vendorlibdir}/chef
 
-# FIXME: FHS
-%dir /var/%{name}
+%dir /var/lib/%{name}
+%dir /var/cache/%{name}
diff --git a/FHS.patch b/FHS.patch
new file mode 100644
index 0000000..6ea5508
--- /dev/null
+++ b/FHS.patch
@@ -0,0 +1,103 @@
+Only in chef-11.4.4: .gitattributes
+Only in chef-11.4.4: .gitignore
+Only in chef-11.4.4: .rspec
+Only in chef-11.4.4: .yardopts
+Only in chef-11.4.4: Gemfile
+Only in chef-11.4.4: NOTICE
+Only in chef-11.4.4: chef.gemspec
+Only in chef-11.4.4: ci
+Only in chef-11.4.4.gem/: data.tar.gz
+Only in chef-11.4.4.gem/: distro
+diff -ur -x .svn -x .git -x .bzr -x CVS chef-11.4.4.gem/lib/chef/config.rb chef-11.4.4/lib/chef/config.rb
+--- chef-11.4.4.gem/lib/chef/config.rb	2013-04-30 01:35:11.703271336 +0300
++++ chef-11.4.4/lib/chef/config.rb	2013-04-30 01:38:24.665295683 +0300
+@@ -141,20 +141,20 @@
+ 
+     # Where the cookbooks are located. Meaning is somewhat context dependent between
+     # knife, chef-client, and chef-solo.
+-    cookbook_path [ platform_specific_path("/var/chef/cookbooks"),
+-                    platform_specific_path("/var/chef/site-cookbooks") ]
++    cookbook_path [ platform_specific_path("/var/lib/chef/cookbooks"),
++                    platform_specific_path("/var/lib/chef/site-cookbooks") ]
+ 
+     # An array of paths to search for knife exec scripts if they aren't in the current directory
+     script_path []
+ 
+     # Where files are stored temporarily during uploads
+-    sandbox_path "/var/chef/sandboxes"
++    sandbox_path "/var/lib/chef/sandboxes"
+ 
+     # Where cookbook files are stored on the server (by content checksum)
+-    checksum_path "/var/chef/checksums"
++    checksum_path "/var/lib/chef/checksums"
+ 
+     # Where chef's cache files should be stored
+-    file_cache_path platform_specific_path("/var/chef/cache")
++    file_cache_path platform_specific_path("/var/cache/chef")
+ 
+     # By default, chef-client (or solo) creates a lockfile in
+     # `file_cache_path`/chef-client-running.pid
+@@ -166,7 +166,7 @@
+     lockfile nil
+ 
+     # Where backups of chef-managed files should go
+-    file_backup_path platform_specific_path("/var/chef/backup")
++    file_backup_path platform_specific_path("/var/lib/chef/backup")
+ 
+     ## Daemonization Settings ##
+     # What user should Chef run as?
+@@ -202,7 +202,7 @@
+     # toggle info level log items that can create a lot of output
+     verbose_logging true
+     node_name nil
+-    node_path "/var/chef/node"
++    node_path "/var/lib/chef/node"
+     diff_disable            false
+     diff_filesize_threshold 10000000
+     diff_output_threshold   1000000
+@@ -239,9 +239,9 @@
+ 
+ 
+     # Where should chef-solo look for role files?
+-    role_path platform_specific_path("/var/chef/roles")
++    role_path platform_specific_path("/var/lib/chef/roles")
+ 
+-    data_bag_path platform_specific_path("/var/chef/data_bags")
++    data_bag_path platform_specific_path("/var/lib/chef/data_bags")
+ 
+     # Where should chef-solo download recipes from?
+     recipe_url nil
+@@ -286,8 +286,8 @@
+     # Server Signing CA
+     #
+     # In truth, these don't even have to change
+-    signing_ca_cert "/var/chef/ca/cert.pem"
+-    signing_ca_key "/var/chef/ca/key.pem"
++    signing_ca_cert "/var/lib/chef/ca/cert.pem"
++    signing_ca_key "/var/lib/chef/ca/key.pem"
+     signing_ca_user nil
+     signing_ca_group nil
+     signing_ca_country "US"
+@@ -318,7 +318,7 @@
+     syntax_check_cache_path nil
+ 
+     # Deprecated:
+-    cache_options({ :path => platform_specific_path("/var/chef/cache/checksums") })
++    cache_options({ :path => platform_specific_path("/var/cache/chef/checksums") })
+ 
+     # Set to false to silence Chef 11 deprecation warnings:
+     chef11_deprecation_warnings true
+diff -ur -x .svn -x .git -x .bzr -x CVS chef-11.4.4.gem/lib/chef/handler/json_file.rb chef-11.4.4/lib/chef/handler/json_file.rb
+--- chef-11.4.4.gem/lib/chef/handler/json_file.rb	2013-04-30 01:35:11.709938303 +0300
++++ chef-11.4.4/lib/chef/handler/json_file.rb	2013-04-30 01:38:24.665295683 +0300
+@@ -27,7 +27,7 @@
+ 
+       def initialize(config={})
+         @config = config
+-        @config[:path] ||= "/var/chef/reports"
++        @config[:path] ||= "/var/lib/chef/reports"
+         @config
+       end
+ 
+Only in chef-11.4.4.gem/: metadata.gz
+Only in chef-11.4.4.gem/: spec
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/chef.git/commitdiff/55a4545605e6185ff5dc5268221ff8b1d6b7213d



More information about the pld-cvs-commit mailing list