File hp-education-release.spec of Package hp-education-release
#
# spec file for package openSUSE-Education-release
#
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# norootforbuild
Name: hp-education-release
Summary: Product version files for HP-Education
Version: 1.0
Release: 2
License: BSD 3-Clause
Group: System/Fhs
AutoReqProv: on
Vendor: HP-Education
%if 0%{?suse_version} > 1100
Provides: %name-%version
Provides: product()
Provides: product(HP-Education) = 1.0-0
Provides: product(HP-Education-0) = 1.0-0
Provides: product(HP-Education-SP0) = 1.0-0
Requires: product_flavor(HP-Education) = 1.0
%endif
Source0: hp-education-release-rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define is_beta 1
%define betaversion Alpha1
%description
This package contains some files useful for later updates and upgrades
of the HP-Education add on.
Authors:
--------
Lars Vogdt
%if 0%{?suse_version} > 1100
%package DVD
License: BSD 3-Clause
Group: System/Fhs
Provides: product_flavor()
Provides: product_flavor(HP-Education) = 1.0-0
Provides: flavor(DVD)
Requires: product(SLE) = 11
Summary: HP-Education Add on
%description DVD
This package contains some files useful for later updates and upgrades
of the HP-Education add on.
Authors:
--------
Lars Vogdt
%package ftp
License: BSD 3-Clause
Group: System/Fhs
Provides: product_flavor()
Provides: product_flavor(HP-Education) = 1.0-0
Provides: flavor(ftp)
Requires: product(SLE) = 11
Summary: HP-Education Add on
%description ftp
This package contains some files useful for later updates and upgrades
of the HP-Education add on.
Authors:
--------
Lars Vogdt
%endif
%prep
%build
%install
%if 0%{suse_version} > 1100
for flavor in DVD ftp; do
mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/HP-Education-release-$flavor
cat >$RPM_BUILD_ROOT/%{_defaultdocdir}/HP-Education-release-$flavor/README << EOF
This package just exist just for providing the product flavor $flavor.
EOF
%endif
mkdir -p $RPM_BUILD_ROOT/etc
#
# create a human readable release file in /etc
#
RELEASEFILE="$RPM_BUILD_ROOT/etc/HP-Education-release"
%if 0%{?is_beta}
echo "openSUSE-Education" > $RELEASEFILE
%else
echo "openSUSE-Education %{betaversion}" > $RELEASEFILE
%endif
echo "VERSION = %{version}" >> $RELEASEFILE
echo "RELEASE = %{release}" >> $RELEASEFILE
%if 0%{?suse_version} > 1030 && 0%{?suse_version} < 1110
# create a product file for zypper/YaST
mkdir -p $RPM_BUILD_ROOT/etc/zypp/products.d/
PRODUCTSFILE="$RPM_BUILD_ROOT/etc/zypp/products.d/HP-Education-release.prod"
echo "[HP-Education %{version} %arch]" >> $PRODUCTSFILE
echo "name=HP-Education" >> $PRODUCTSFILE
echo "version=%{version} %{betaversion}" >> $PRODUCTSFILE
echo "release=%{release}" >> $PRODUCTSFILE
echo "flavor=online" >> $PRODUCTSFILE
echo >> $PRODUCTSFILE
echo "[update]" >> $PRODUCTSFILE
echo "url=http://download.opensuse.org/repositories/isv://hp://education/images/" >> $PRODUCTSFILE
echo >> $PRODUCTSFILE
%endif
%if 0%{?suse_version} > 1100
mkdir -p $RPM_BUILD_ROOT/etc/products.d/
REPOFILE=$RPM_BUILD_ROOT/etc/products.d/%name.prod
cat > $REPOFILE << EOF
<?xml version="1.0" encoding="UTF-8"?>
<product id="HP-Education" schemeversion="0">
<vendor>HP-Education</vendor>
<name>HP-Education</name>
<version>%{version}</version>
<patchlevel>0</patchlevel>
<release>0</release>
<arch>%{_target_cpu}</arch>
<productline>SUSE</productline>
<updaterepokey>hpedu11</updaterepokey>
<summary>The HP-Education Add-on</summary>
<description>The HP-Education Add-on provides packages
for use in educational environments.</description>
<urls>
<url name="bugtracker">http://devzilla.novell.com/education/</url>
<url name="releasenotes">http://www.opensuse-education.org/download/relnotes/hp/11/release-notes-hp-edu.rpm</url>
<url name="updates">http://download.opensuse.org/repositories/isv://hp://education/images/</url>
</urls>
%if 0%{?is_beta}
<buildconfig producttheme="SUSE" />
%else
<buildconfig producttheme="SUSE" betaversion="%{betaversion}" />
%endif
<installconfig defaultlang="en_US" datadir="suse" descriptiondir="suse/setup/descr">
<releasepackage name="%name" version="%version" flag="EQ"/>
<distribution>SLE</distribution>
</installconfig>
<runtimeconfig allowresolving="true" packagemanager="zypper" />
</product>
EOF
%endif
%if 0%{?suse_version} > 1030
#
# create a vendor file to handle different vendor packages
#
mkdir -p $RPM_BUILD_ROOT/etc/zypp/vendors.d/
VENDORFILE="$RPM_BUILD_ROOT/etc/zypp/vendors.d/HP-Education"
echo "[main]" >> $VENDORFILE
echo "vendors=%{vendor},SUSE LINUX Products GmbH,openSUSE Build Service,openSUSE-Education" >> $VENDORFILE
#
# create the update repo file for zypper
#
mkdir -p $RPM_BUILD_ROOT/etc/zypp/repos.d
REPOFILE="$RPM_BUILD_ROOT/etc/zypp/repos.d/HP-Education-Updates.repo"
echo "[HP-Education Updates]" >> $REPOFILE
echo "name=HP-Education Updates" >> $REPOFILE
echo "baseurl=http://download.opensuse.org/repositories/isv://hp://education/SLE_11" >> $REPOFILE
echo "type=rpm-md" >> $REPOFILE
echo "enabled=1" >> $REPOFILE
echo "autorefresh=1" >> $REPOFILE
echo "gpgcheck=1" >> $REPOFILE
echo "keeppackages=0" >> $REPOFILE
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%config /etc/HP-Education-release
%if 0%{?suse_version} > 1030
%dir /etc/zypp
%dir /etc/zypp/repos.d
%dir /etc/zypp/vendors.d
%if 0%{?suse_version} > 1100
%dir /etc/products.d/
%config(noreplace) /etc/products.d/%name.prod
%else
%dir /etc/zypp/products.d
%config(noreplace) /etc/zypp/products.d/HP-Education-release.prod
%endif
%config(noreplace) /etc/zypp/vendors.d/HP-Education
%config(noreplace) /etc/zypp/repos.d/HP-Education-Updates.repo
%endif
%if 0%{?suse_version} > 1100
%files DVD
%defattr(-,root,root)
%doc %{_defaultdocdir}/HP-Education-release-DVD
%files ftp
%defattr(-,root,root)
%doc %{_defaultdocdir}/HP-Education-release-ftp
%endif
%changelog