Skip to content

Commit

Permalink
Change README.rdoc to README.md in Rakefile, Updated ruby-augeas.spec…
Browse files Browse the repository at this point in the history
… from Fedora 39 (#19)
  • Loading branch information
georgehansper authored Aug 4, 2024
1 parent 706f466 commit 760f1d6
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 44 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -33,3 +34,5 @@ jobs:
bundler-cache: true
- name: Run tests
run: bundle exec rake test
- name: Test package
run: bundle exec rake package
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/**/*"
Expand Down
66 changes: 26 additions & 40 deletions ruby-augeas.spec
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 <[email protected]> - 0.4.0-1
- Now requires augeas-0.8.0

* Wed Aug 12 2009 David Lutterkort <[email protected]> - 0.3.0-1
- New version

* Tue Aug 26 2008 David Lutterkort <[email protected]> - 0.2.0-1
- New version

* Fri May 9 2008 David Lutterkort <[email protected]> - 0.1.0-1
- Fixed up in accordance with Fedora guidelines

* Mon Mar 3 2008 Bryan Kearney <[email protected]> - 0.0.1-1
- Initial specfile
* Thu Aug 1 2024 - George Hansper <[email protected]>
- Copied latest ruby-augeas.spec from Fedora 39 src rpm
Added %if for building under rhel 7
Updated Source0 to github URL

0 comments on commit 760f1d6

Please sign in to comment.