##
##  wordpress-themes.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 versions
%define       V_wordpress                  4.2
%define       V_theme_sparkling            2.4.11
%define       V_theme_ward                 1.0.7
%define       V_theme_stargazer            4.0.0
%define       V_theme_make                 1.10.9
%define       V_theme_pinbin               1.4.7

#   package information
Name:         wordpress-themes
Summary:      Wordpress Themes Collection
URL:          http://wordpress.org/
Vendor:       R. Boren & M. Mullenweg et al.
Packager:     OpenPKG Project
Distribution: OpenPKG Community
Class:        PLUS
Group:        CMS
License:      GPL
Version:      %{V_wordpress}
Release:      20250411

#   list of sources
Source1:      http://wordpress.org/themes/download/sparkling.%{V_theme_sparkling}.zip
Source2:      http://wordpress.org/themes/download/ward.%{V_theme_ward}.zip
Source3:      http://wordpress.org/themes/download/stargazer.%{V_theme_stargazer}.zip
Source4:      http://wordpress.org/themes/download/make.%{V_theme_make}.zip
Source5:      http://wordpress.org/themes/download/pinbin.%{V_theme_pinbin}.zip

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

%description
    This is a collection of WordPress themes.

%track
    prog wordpress-themes:theme-sparkling = {
        version   = %{V_theme_sparkling}
        url       = http://wordpress.org/themes/sparkling
        regex     = sparkling\.(__VER__)\.zip
    }
    prog wordpress-themes:theme-ward = {
        version   = %{V_theme_ward}
        url       = http://wordpress.org/themes/ward
        regex     = ward\.(__VER__)\.zip
    }
    prog wordpress-themes:theme-stargazer = {
        version   = %{V_theme_stargazer}
        url       = http://wordpress.org/themes/stargazer
        regex     = stargazer\.(__VER__)\.zip
    }
    prog wordpress-themes:theme-make = {
        version   = %{V_theme_make}
        url       = http://wordpress.org/themes/make
        regex     = make\.(__VER__)\.zip
    }
    prog wordpress-themes:theme-pinbin = {
        version   = %{V_theme_pinbin}
        url       = http://wordpress.org/themes/pinbin
        regex     = pinbin\.(__VER__)\.zip
    }

%prep
    %setup -q -T -c
    %setup -q -T -D -a 1
    %setup -q -T -D -a 2
    %setup -q -T -D -a 3
    %setup -q -T -D -a 4
    %setup -q -T -D -a 5

%build

%install
    #   install plugins
    %{l_shtool} mkdir -f -p -m 755 \
        $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/themes/sparkling \
        $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/themes/ward \
        $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/themes/stargazer \
        $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/themes/make \
        $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/themes/pinbin
    cp -rp sparkling/* $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/themes/sparkling/
    cp -rp ward/*      $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/themes/ward/
    cp -rp stargazer/* $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/themes/stargazer/
    cp -rp make/*      $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/themes/make/
    cp -rp pinbin/*    $RPM_BUILD_ROOT%{l_prefix}/libexec/wordpress/wp-content/themes/pinbin/

    #   determine installation files
    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}

%files -f files

%clean

