# # spec file for package ses-manual_zh_tw # # Copyright (c) 2019 SUSE Linux 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 https://bugs.opensuse.org/ # %bcond_without PDF %define full_lang 'Chinese Traditional' # # # leave the lang code LOWERCASED # # # %define my_lang zh_tw Name: ses-manual_%{my_lang} %define my_book ses-manual Version: 6+git3.2c9b2ed Release: 0 #BREQ Provides: locale(desktop-data-openSUSE:%{my_lang}) #OBS Source: doc-ses-%{version}.tar.bz2 #SOURCES Source901: doc_pre_checkin.sh Source903: attributes BuildRequires: daps > 1.99999 BuildRequires: docbook5-xsl-stylesheets BuildRequires: fdupes BuildRequires: jing BuildRequires: docbook_4 BuildRequires: suse-xsl-stylesheets > 1.99999 BuildRequires: update-desktop-files #JSP_REQ Requires: dejavu-fonts Requires: google-opensans-fonts BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch Summary: SUSE Enterprise Storage Administration Guide (%{full_lang}) License: CC-BY-SA-4.0 Group: Documentation/SUSE Url: http://doc.opensuse.org %define _defaultdocdir %{_datadir}/doc/manual %define _docdir %{_datadir}/doc/manual %description SUSE Enterprise Storage Deployment and Administration Guide (%{full_lang}). %package -n ses-admin_%{my_lang}-pdf Group: Documentation/SUSE License: CC-BY-SA-4.0 Summary: SUSE Enterprise Storage Administration Guide (PDF, %{full_lang}) %description -n ses-admin_%{my_lang}-pdf PDF of the SUSE Enterprise Storage Administration Guide (%{full_lang}). %package -n ses-deployment_%{my_lang}-pdf Group: Documentation/SUSE License: CC-BY-SA-4.0 Summary: SUSE Enterprise Storage Deployment Guide (PDF, %{full_lang}) %description -n ses-deployment_%{my_lang}-pdf The PDF of the SUSE Linux Enterprise Storage Deployment Guide (%{full_lang}). %prep %setup -c -q -n %{name}-%{version}/ses-manual #PREP %setup -c -q -T -D -n %{name}-%{version} find -name '*.png' -o -name '*.svg' | xargs chmod 644 || : #PDFPREP %build %define my_all_dir %{_builddir}/%{name}-%{version}/ses-manual cd %{my_all_dir} rm -rf images/src/odg 2>/dev/null # use dedicated daps command to find and save target directory package_dir=$(daps -d DC-ses-all package-html-dir-name) # e.g., /usr/share/help/C/gnome-help/opensuse-manuals.page # Produce .page files for HTML # Switches according to bnc#883820 export ADDITIONAL_OPTIONS="-Xss3072K" daps -d DC-ses-all package-html --xsltparam="'--stringparam build.for.web=0'" --pagefiles bookhtml=$(echo $package_dir/*_%{my_lang}-html.tar.bz2) bookhtml=${bookhtml##*/} tar xvf $package_dir/$bookhtml bk=${bookhtml%%_%{my_lang}-html.tar.bz2} [ -d $bk ] || bk=${bk}_draft echo $bk > %{name}.filelist cp $package_dir/*.page %name.page #MAKE_DOC #MAKE_JSP export FOP_STACK="-Xss2048K" build_pdf () { %if %{with PDF} book=$(echo ${1} | tr [:upper:] [:lower:]) if [ -z "$formatter" ]; then formatter=$(daps -d DC-${1} showvariable VARIABLE=FORMATTER) fi pkg_pdf=$(daps -d DC-${1} package-pdf --formatter=$formatter --name=$book) pdfname=$(find $pkg_pdf -name '*.pdf') echo $pdfname > ${book}_%{my_lang}-pdf.filelist %else : say build --with PDF %endif } all_pdf_docs=" ses-admin ses-deployment" [ -n "$all_pdf_docs" ] && for b in $all_pdf_docs; do build_pdf $b; done %install cd %{my_all_dir} mkdir -p %{buildroot}%{_defaultdocdir} # product is name without language code %define gnome_dir %{_datadir}/gnome/help/ses-manual install -d %{buildroot}%{gnome_dir} cp -a --dereference $(head -n 1 %{name}.filelist) \ %{buildroot}/%{_defaultdocdir}/%{name} gnome_help_dir=%{_datadir}/help/C/gnome-help install -d %{buildroot}$gnome_help_dir cp %name.page %{buildroot}$gnome_help_dir/%name.page { echo "%dir $gnome_help_dir" echo "$gnome_help_dir/%name.page" } > %name.filelist # Create the link to make the book visible in yelp if [ %{my_lang} = "en" ]; then pushd %{buildroot}%{_datadir}/help/C ln -s ../../doc/manual/%{name} %{my_book} popd echo "%{_datadir}/help/C/%{my_book}" >> %name.filelist fi #INST_JSP %if %{with PDF} for f in *-pdf.filelist; do mkdir %{buildroot}/%{_defaultdocdir}/${f%\.filelist} # PDF first cp -a --dereference $(head -n 1 $f) \ %{buildroot}/%{_defaultdocdir}/${f%\.filelist} # remove first line and append the new location sed -i 1d $f echo "%{_defaultdocdir}/${f%\.filelist}" >> $f #PDFHTML_LIST done %endif %fdupes '%{buildroot}%{_docdir}' %if %{with PDF} #PDFINST %endif #PDFXXX #JSP_POST %files -n ses-admin_%{my_lang}-pdf -f %{my_book}/ses-admin_%{my_lang}-pdf.filelist %defattr(-, root, root) %files -n ses-deployment_%{my_lang}-pdf -f %{my_book}/ses-deployment_%{my_lang}-pdf.filelist %defattr(-, root, root) #PDFFILES %files -f %{my_book}/%{name}.filelist %defattr(-, root, root) %dir %{_defaultdocdir} %{_defaultdocdir}/%{name} #GNOME #KDE4 #JSPFILES %changelog