diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7c6c86..4409c8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update + sudo apt-get upgrade -y sudo apt-get install -y libaugeas-dev - uses: actions/checkout@v4 - name: Setup ruby @@ -33,3 +34,5 @@ jobs: bundler-cache: true - name: Run tests run: bundle exec rake test + - name: Test package + run: bundle exec rake package diff --git a/README.md b/README.md index 2fb6b52..7721682 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,34 @@ On Fedora, you can do that simply by running dnf install augeas-devel pkgconfig ``` -On OSX, you need to set up [Homebrew](http://brew.sh/) and then run +On MacOS (OSX), you need to set up [Homebrew](http://brew.sh/) and then run ``` brew install augeas pkg-config ``` +Build the ruby gem by running +``` +rake build +rake test +rake gem +``` +The output is pkg/ruby-augeas-VERSION.gem + +Build the rpm package (optional) in the pkg/ subdirectory +``` +rake rpm +``` +The output is pkg/ruby-augeas-VERSION-1.DIST.src.rpm with binary packages in pkg/$(uname -m) + +Create html documentation using rdoc + +``` +rake rdoc +``` + +The output is in doc/site/api/ +The starting document is doc/site/api/index.html + ## Usage ### Setting Data diff --git a/Rakefile b/Rakefile index ce630fa..0f3da58 100644 --- a/Rakefile +++ b/Rakefile @@ -66,16 +66,16 @@ task :test => :build # Generate the documentation # RDoc::Task.new do |rd| - rd.main = "README.rdoc" + rd.main = "README.md" rd.rdoc_dir = "doc/site/api" - rd.rdoc_files.include("README.rdoc", "ext/**/*.[ch]","lib/**/*.rb") + rd.rdoc_files.include("README.md", "ext/**/*.[ch]","lib/**/*.rb") end # # Packaging # PKG_FILES = FileList[ - "Rakefile", "COPYING","README.rdoc", "NEWS", + "Rakefile", "COPYING","README.md", "NEWS", "ext/**/*.[ch]", "lib/**/*.rb", "ext/**/MANIFEST", "ext/**/extconf.rb", "tests/**/*", "spec/**/*" diff --git a/ruby-augeas.spec b/ruby-augeas.spec index c49a580..f6b8f22 100644 --- a/ruby-augeas.spec +++ b/ruby-augeas.spec @@ -1,23 +1,24 @@ -%{!?ruby_sitelib: %define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")} -%{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")} - Name: ruby-augeas Version: @VERSION@ Release: 1%{?dist} Summary: Ruby bindings for Augeas -Group: Development/Languages License: LGPLv2+ URL: http://augeas.net -Source0: http://augeas.net/download/ruby/ruby-augeas-%{version}.tgz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - -BuildRequires: ruby ruby-devel rubygem(rake) -BuildRequires: augeas-devel >= 0.8.0 -BuildRequires: libxml2-devel +Source0: https://github.com/hercules-team/ruby-augeas/releases/download/release-%{version}/ruby-augeas-%{version}.tgz + +BuildRequires: ruby rubygem(rake) +%if 0%{?rhel} != 7 +# RedHat/CentOS 7 use Ruby 2.0 where test-unit is not a seperate package +BuildRequires: rubygem(test-unit) +%endif +BuildRequires: ruby rubygem(rdoc) +BuildRequires: ruby-devel +BuildRequires: augeas-devel >= 1.0.0 BuildRequires: pkgconfig -Requires: ruby(abi) = 1.8 -Requires: augeas-libs >= 0.8.0 +BuildRequires: gcc +Requires: ruby(release) +Requires: augeas-libs >= 1.0.0 Provides: ruby(augeas) = %{version} %description @@ -28,42 +29,27 @@ Ruby bindings for augeas. %build -export CFLAGS="$RPM_OPT_FLAGS" +export CONFIGURE_ARGS="--with-cflags='%{optflags}'" rake build %install rm -rf %{buildroot} -install -d -m0755 %{buildroot}%{ruby_sitelib} -install -d -m0755 %{buildroot}%{ruby_sitearch} -install -p -m0644 lib/augeas.rb %{buildroot}%{ruby_sitelib} -install -p -m0755 ext/augeas/_augeas.so %{buildroot}%{ruby_sitearch} +install -d -m0755 %{buildroot}%{ruby_vendorlibdir} +install -d -m0755 %{buildroot}%{ruby_vendorarchdir} +install -p -m0644 lib/augeas.rb %{buildroot}%{ruby_vendorlibdir} +install -p -m0755 ext/augeas/_augeas.so %{buildroot}%{ruby_vendorarchdir} %check -rake test - -%clean -rm -rf $RPM_BUILD_ROOT +ruby tests/tc_augeas.rb %files -%defattr(-,root,root,-) -%doc COPYING README.rdoc NEWS -%{ruby_sitelib}/augeas.rb -%{ruby_sitearch}/_augeas.so - +%doc COPYING README.md NEWS +%{ruby_vendorlibdir}/augeas.rb +%{ruby_vendorarchdir}/_augeas.so %changelog -* Fri Mar 25 2011 David Lutterkort - 0.4.0-1 -- Now requires augeas-0.8.0 - -* Wed Aug 12 2009 David Lutterkort - 0.3.0-1 -- New version - -* Tue Aug 26 2008 David Lutterkort - 0.2.0-1 -- New version - -* Fri May 9 2008 David Lutterkort - 0.1.0-1 -- Fixed up in accordance with Fedora guidelines - -* Mon Mar 3 2008 Bryan Kearney - 0.0.1-1 -- Initial specfile +* Thu Aug 1 2024 - George Hansper +- Copied latest ruby-augeas.spec from Fedora 39 src rpm + Added %if for building under rhel 7 + Updated Source0 to github URL