##
##  drupal-theme-misc.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 (core)
%define       V_drupal                     6.x

#   package versions (themes)
%define       V_theme_alek_2_0             6.x-1.x-dev
%define       V_theme_amadou               6.x-1.4
%define       V_theme_barlow               6.x-1.7
%define       V_theme_barron               6.x-2.3
%define       V_theme_bluebreeze           6.x-1.0
%define       V_theme_deco                 6.x-1.1
%define       V_theme_framework            6.x-3.3
%define       V_theme_fourseasons          6.x-2.0
%define       V_theme_nista                6.x-4.8
%define       V_theme_sky                  6.x-3.11
%define       V_theme_zen                  6.x-2.1

#   package information
Name:         drupal-theme-misc
Summary:      Drupal CMS: Theme Collection
URL:          http://www.drupal.org/
Vendor:       Drupal Community et al.
Packager:     OpenPKG Project
Distribution: OpenPKG Community
Class:        PLUS
Group:        CMS
License:      GPL
Version:      %{V_drupal}
Release:      20130830

#   list of sources
Source0:      http://ftp.drupal.org/files/projects/alek_2_0-%{V_theme_alek_2_0}.tar.gz
Source1:      http://ftp.drupal.org/files/projects/amadou-%{V_theme_amadou}.tar.gz
Source2:      http://ftp.drupal.org/files/projects/barlow-%{V_theme_barlow}.tar.gz
Source3:      http://ftp.drupal.org/files/projects/barron-%{V_theme_barron}.tar.gz
Source4:      http://ftp.drupal.org/files/projects/bluebreeze-%{V_theme_bluebreeze}.tar.gz
Source5:      http://ftp.drupal.org/files/projects/deco-%{V_theme_deco}.tar.gz
Source6:      http://ftp.drupal.org/files/projects/framework-%{V_theme_framework}.tar.gz
Source7:      http://ftp.drupal.org/files/projects/fourseasons-%{V_theme_fourseasons}.tar.gz
Source8:      http://ftp.drupal.org/files/projects/nista-%{V_theme_nista}.tar.gz
Source9:      http://ftp.drupal.org/files/projects/sky-%{V_theme_sky}.tar.gz
Source10:     http://ftp.drupal.org/files/projects/zen-%{V_theme_zen}.tar.gz

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

%description
    This is a collection of reusable "themes" for the Drupal CMS.

%track
    prog drupal-theme-misc:theme_alek_2_0 = {
        version   = %{V_theme_alek_2_0}
        url       = http://ftp.drupal.org/files/projects/
        regex     = alek_2_0-(6\.x-\d+(?:\.\d+)+)\.tar\.gz
    }
    prog drupal-theme-misc:theme_amadou = {
        version   = %{V_theme_amadou}
        url       = http://ftp.drupal.org/files/projects/
        regex     = amadou-(6\.x-\d+(?:\.\d+)+)\.tar\.gz
    }
    prog drupal-theme-misc:theme_barlow = {
        version   = %{V_theme_barlow}
        url       = http://ftp.drupal.org/files/projects/
        regex     = barlow-(6\.x-\d+(?:\.\d+)+)\.tar\.gz
    }
    prog drupal-theme-misc:theme_barron = {
        version   = %{V_theme_barron}
        url       = http://ftp.drupal.org/files/projects/
        regex     = barron-(6\.x-\d+(?:\.\d+)+)\.tar\.gz
    }
    prog drupal-theme-misc:theme_bluebreeze = {
        version   = %{V_theme_bluebreeze}
        url       = http://ftp.drupal.org/files/projects/
        regex     = bluebreeze-(6\.x-\d+(?:\.\d+)+)\.tar\.gz
    }
    prog drupal-theme-misc:theme_deco = {
        version   = %{V_theme_deco}
        url       = http://ftp.drupal.org/files/projects/
        regex     = deco-(6\.x-\d+(?:\.\d+)+)\.tar\.gz
    }
    prog drupal-theme-misc:theme_framework = {
        version   = %{V_theme_framework}
        url       = http://ftp.drupal.org/files/projects/
        regex     = framework-(6\.x-\d+(?:\.\d+)+)\.tar\.gz
    }
    prog drupal-theme-misc:theme_fourseasons = {
        version   = %{V_theme_fourseasons}
        url       = http://ftp.drupal.org/files/projects/
        regex     = fourseasons-(6\.x-\d+(?:\.\d+)+)\.tar\.gz
    }
    prog drupal-theme-misc:theme_nista = {
        version   = %{V_theme_nista}
        url       = http://ftp.drupal.org/files/projects/
        regex     = nista-(6\.x-\d+(?:\.\d+)+)\.tar\.gz
    }
    prog drupal-theme-misc:theme_sky = {
        version   = %{V_theme_sky}
        url       = http://ftp.drupal.org/files/projects/
        regex     = sky-(6\.x-\d+(?:\.\d+)+)\.tar\.gz
    }
    prog drupal-theme-misc:theme_zen = {
        version   = %{V_theme_zen}
        url       = http://ftp.drupal.org/files/projects/
        regex     = zen-(6\.x-\d+(?:\.\d+)+)\.tar\.gz
    }

%prep
    %setup -q -c -T
    %{l_tar} xfz %{SOURCE0}
    %{l_tar} xfz %{SOURCE1}
    %{l_tar} xfz %{SOURCE2}
    %{l_tar} xfz %{SOURCE3}
    %{l_tar} xfz %{SOURCE4}
    %{l_tar} xfz %{SOURCE5}
    %{l_tar} xfz %{SOURCE6}
    %{l_tar} xfz %{SOURCE7}
    %{l_tar} xfz %{SOURCE8}
    %{l_tar} xfz %{SOURCE9}
    %{l_tar} xfz %{SOURCE10}

%build

%install
    #   create installation hierarchy
    %{l_shtool} mkdir -f -p -m 755 \
        $RPM_BUILD_ROOT%{l_prefix}/share/drupal/sites/all/themes

    #   avoid copying unnecessary text files
    find . -name "*.orig" -print | xargs rm -f
    rm -f CHANGELOG.txt COPYRIGHT.txt INSTALL.*.txt INSTALL.txt
    rm -f LICENSE.txt MAINTAINERS.txt UPGRADE.txt

    #   install all files (and strip down installation afterwards)
    cp -rp * \
        $RPM_BUILD_ROOT%{l_prefix}/share/drupal/sites/all/themes/

    #   determine installation files
    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
        %{l_files_std} \
        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/share/drupal'

%files -f files

%clean

