##
##  omake.spec -- OpenPKG RPM Package Specification
##  Copyright (c) 2000-2025 OpenPKG Project <http://openpkg.org/>
##
##  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_base 0.9.8.5
%define       V_rev  3

#   package information
Name:         omake
Summary:      Powerful Build System
URL:          http://omake.metaprl.org/
Vendor:       Jason Hickey, Aleksey Nogin, et al.
Packager:     OpenPKG Project
Distribution: OpenPKG Community
Class:        EVAL
Group:        Building
License:      MIT/LGPL/GPL
Version:      %{V_base}.%{V_rev}
Release:      20080101

#   list of sources
Source0:      http://mojave.metaprl.org/download/omake/omake-%{V_base}-%{V_rev}.tar.gz

#   build information
BuildPreReq:  OpenPKG, openpkg >= 20160101, ocaml
PreReq:       OpenPKG, openpkg >= 20160101

%description
    OMake is a build system designed for scalability and portability. It
    uses a syntax similar to make(1), but it features many additional
    enhancements, including the following: support for projects spanning
    several directories or directory hierarchies; fast, reliable,
    automated, scriptable dependency analysis using MD5 digests, with
    full support for incremental builds; full native support for rules
    that build several files at once; portability; built-in functions
    that provide the most common features of programs like grep(1),
    sed(1), and awk(1); active filesystem monitoring, where the build
    automatically restarts whenever you modify a source file.

%track
    prog omake = {
        version   = %{V_base}-%{V_rev}
        url       = http://omake.metaprl.org/download.html
        regex     = omake-(\d+\.\d+(\.\d+)+-\d+)\.tar\.gz
    }

%prep
    %setup -q -n omake-%{V_base}

%build
    %{l_make} %{l_mflags} all \
        PREFIX=%{l_prefix}\
        BINDIR=%{l_prefix}/bin \
        LIBDIR=%{l_prefix}/lib \
        MANDIR=%{l_prefix}/man

%install
    %{l_make} %{l_mflags} install \
        INSTALL_ROOT=$RPM_BUILD_ROOT\
        PREFIX=%{l_prefix}\
        BINDIR=%{l_prefix}/bin \
        LIBDIR=%{l_prefix}/lib \
        MANDIR=%{l_prefix}/man
    strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
    %{l_shtool} mkdir -f -p -m 755 \
        $RPM_BUILD_ROOT%{l_prefix}/info \
        $RPM_BUILD_ROOT%{l_prefix}/man/man1
    %{l_shtool} install -c -m 644 \
        doc/info/omake-doc.info* $RPM_BUILD_ROOT%{l_prefix}/info/
    %{l_shtool} install -c -m 644 \
        doc/txt/omake-doc.txt $RPM_BUILD_ROOT%{l_prefix}/man/man1/omake.1
    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}

%files -f files

%clean

