File release-notes-openSUSE.spec of Package release-notes-openSUSE

#
# spec file for package release-notes-openSUSE
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           release-notes-openSUSE
BuildRequires:  docbook-xsl-stylesheets
BuildRequires:  libxslt
BuildRequires:  recode
BuildRequires:  update-desktop-files
BuildRequires:  w3m
BuildRequires:  xml2po
BuildRequires:  xmlcharent
BuildRequires:  xmlgraphics-fop
Summary:        Most Important Changes for This openSUSE Release
License:        GFDL-1.1
Group:          Documentation/SUSE
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Version:        12.2.6
Release:        0
Provides:       release-notes = %{version}
Source0:        release-notes-opensuse-%{version}.tar.bz2
Source8:        %{name}.desktop.in
Url:            http://en.opensuse.org

%description
This package contains the description of the most important changes for
this openSUSE release. In HTML format, they are available in the help
center.



%prep
%setup -q -n release-notes-opensuse-%{version}
# rfile=RELEASE-NOTES-openSUSE.en.po
rfile=po/en.po
[ -f $rfile ] || {
  echo $rfile is missing
  exit 1
}

%build
%define SUSE_PROD openSUSE
./configure --prefix=/usr
make all pdf arch=%_arch prod=slprof SUSE_PROD=%SUSE_PROD

%install
make DESTDIR=$RPM_BUILD_ROOT SUSE_PROD=%SUSE_PROD install
rnpath="${RPM_BUILD_ROOT}"/usr/share/doc/release-notes/%SUSE_PROD
[ -f $rnpath/RELEASE-NOTES.cs.html ] && {
  [ -f $rnpath/RELEASE-NOTES.sk.html ] || {
    ln -s RELEASE-NOTES.cs.html $rnpath/RELEASE-NOTES.sk.html
    # ln -s RELEASE-NOTES.cs.rtf $rnpath/RELEASE-NOTES.sk.rtf
  }
}
for h in $rnpath/RELEASE-NOTES.*.html; do
  ln -s ${h#$rnpath/} ${h/html/rtf}
done

mkdir -p $RPM_BUILD_ROOT/usr/share/susehelp/meta
sed 's/@SUSE_PROD@/%{SUSE_PROD}/' $RPM_SOURCE_DIR/%{name}.desktop.in \
  > $RPM_BUILD_ROOT/usr/share/susehelp/meta/%{name}.desktop
{
  for f in "${RPM_BUILD_ROOT}"/usr/share/doc/release-notes/%SUSE_PROD/RELEASE-NOTES.*.html ; do
    l=${f%\.html}
    l=${l##*\.}
    echo "DocPath[$l]=/usr/share/doc/release-notes/%{SUSE_PROD}/RELEASE-NOTES.$l.html"
  done
} >>$RPM_BUILD_ROOT/usr/share/susehelp/meta/%{name}.desktop
%suse_update_desktop_file $RPM_BUILD_ROOT/usr/share/susehelp/meta/%{name}.desktop

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc fdl.txt
%dir /usr/share/susehelp
%dir /usr/share/susehelp/meta
/usr/share/susehelp/meta/%{name}.desktop
%doc /usr/share/doc/release-notes

%changelog
openSUSE Build Service is sponsored by