Browse Source

updated 6 packages

OpenType-ipaexfont-4.01-1

OpenType-ipamj-mincho-6.01-1

OpenType-source-sans-pro-3.006-1

TrueType-ipafont-3.03-4

TrueType-vlgothic-2.120-2

ghostscript-9.52-1

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@12393 ec354946-7b23-47d6-9f5a-488ba84defc7
tomop 2 years ago
parent
commit
e0b7fc1388

+ 50 - 7
O/OpenType-ipaexfont/OpenType-ipaexfont-vl.spec

@@ -4,14 +4,15 @@
 Name:             OpenType-%{fontname}
 Summary:          IPAex Fonts - JIS X 0213:2004 compliant OpenType fonts
 Summary(ja):      IPAex フォント - JIS X 0213:2004に準拠した OpenType フォント
-Version:          3.01
+Version:          4.01
 Release:          1%{?_dist_release}
-License:          IPA Font License v1.0
 Group:            User Interface/X
-URL:              http://ossipedia.ipa.go.jp/ipafont/index.html
-#URL:             http://sourceforge.jp/projects/ipafonts/
+Vendor:           Project Vine
+Distribution:     Vine Linux
 
-Source0:          IPAexfont00301.zip
+License:          IPA Font License v1.0
+URL:              https://ipafont.ipa.go.jp/
+Source0:          https://ipafont.ipa.go.jp/IPAexfont/IPAexfont00401.zip
 
 BuildRoot:        %{_tmppath}/%{name}-%{version}-root
 BuildArch:        noarch
@@ -75,7 +76,7 @@ includes enduser license.
 
 
 %prep
-%setup -q -n IPAexfont00301
+%setup -q -n IPAexfont00401
 
 %clean
 if test -n "${RPM_BUILD_ROOT}" && test "/" != "${RPM_BUILD_ROOT}"; then
@@ -96,6 +97,42 @@ cp -a *.ttf $RPM_BUILD_ROOT%{_fontdir}
 %post gothic
 %__font_install_post %{_fontdir}
 
+%posttrans mincho
+update-alternatives --install \
+	/usr/share/fonts/alias/TrueType/fonts-japanese-mincho.ttf \
+	fonts-japanese-mincho.ttf \
+	%{_fontdir}/ipaexm.ttf \
+	120
+if [ ! -f /usr/share/fonts/alias/TrueType/fonts-japanese-mincho.ttf ] ; then
+    /sbin/update-alternatives --auto fonts-japanese-mincho.ttf
+fi
+
+%posttrans gothic
+update-alternatives --install \
+	/usr/share/fonts/alias/TrueType/fonts-japanese-gothic.ttf \
+	fonts-japanese-gothic.ttf \
+	%{_fontdir}/ipaexg.ttf \
+	120
+if [ ! -f /usr/share/fonts/alias/TrueType/fonts-japanese-gothic.ttf ] ; then
+    /sbin/update-alternatives --auto fonts-japanese-gothic.ttf
+fi
+
+%preun mincho
+if [ $1 -eq 0 ]; then
+	update-alternatives --remove \
+		fonts-japanese-mincho.ttf \
+		%{_fontdir}/ipaexm.ttf
+    /sbin/update-alternatives --auto fonts-japanese-mincho.ttf ||:
+fi
+
+%preun gothic
+if [ $1 -eq 0 ]; then
+	update-alternatives --remove \
+		fonts-japanese-gothic.ttf \
+		%{_fontdir}/ipaexg.ttf
+    /sbin/update-alternatives --auto fonts-japanese-gothic.ttf ||:
+fi
+
 %postun mincho
 %__font_install_postun %{_fontdir}
 
@@ -105,15 +142,21 @@ cp -a *.ttf $RPM_BUILD_ROOT%{_fontdir}
 %files
 
 %files mincho
+%license IPA_Font_License_Agreement_v1.0.txt
 %{_fontdir}/ipaexm.ttf
 
 %files gothic
+%license IPA_Font_License_Agreement_v1.0.txt
 %{_fontdir}/ipaexg.ttf
 
 %files doc
-%doc IPA_Font_License_Agreement_v1.0.txt Readme_IPAexfont00301.txt
+%doc IPA_Font_License_Agreement_v1.0.txt Readme_IPAexfont*.txt
 
 %changelog
+* Mon May 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 4.01-1
+- new upstream release.
+- made to use alternatives for new ghostscript structure.
+
 * Tue Apr 26 2016 Toshiharu Kudoh <toshi.kd2@gmail.com> - 3.01-1
 - new upstream release
 

+ 11 - 5
O/OpenType-ipamj-mincho/OpenType-ipamj-mincho-vl.spec

@@ -4,13 +4,15 @@
 Name: OpenType-%{fontname}
 Summary: IPAmj mincho Font - ISO/IEC10646 OpenType font
 Summary(ja): IPAmj 明朝フォント - ISO/IEC10646に準拠した OpenType フォント
-Version: 3.01
+Version: 6.01
 Release: 1%{?_dist_release}
-License: IPA Font License v1.0
 Group: User Interface/X
-URL: http://mojikiban.ipa.go.jp/1300.html
+Vendor: Project Vine
+Distribution: Vine Linux
 
-Source0: ipamjm00301.zip
+License: IPA Font License v1.0
+URL: http://mojikiban.ipa.go.jp/1300.html
+Source0: https://mojikiban.ipa.go.jp/OSCDL/IPAmjMincho/ipamjm00601.zip
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 BuildArch: noarch
@@ -65,12 +67,16 @@ cp -a *.ttf $RPM_BUILD_ROOT%{_fontdir}
 %__font_install_postun %{_fontdir}
 
 %files
+%license IPA_Font_License_Agreement_v1.0.txt
 %{_fontdir}/ipamjm.ttf
 
 %files doc
-%doc IPA_Font_License_Agreement_v1.0.txt Readme_ipamjm00%{version}.txt
+%doc IPA_Font_License_Agreement_v1.0.txt Readme.txt
 
 %changelog
+* Mon May 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 6.01-1
+- new upstream release.
+
 * Sat Oct 25 2014 Toshiharu Kudoh <toshi.kd2@gmail.com> - 3.01-1
 - new upstream release
 

+ 21 - 21
O/OpenType-source-sans-pro/OpenType-source-sans-pro-vl.spec

@@ -4,65 +4,65 @@
 Summary: A set of OpenType fonts designed for user interfaces 
 Summary(ja): ユーザーインターフェース向けにデザインされた OpenType フォントセット
 Name: OpenType-source-sans-pro
-Version: 1.050
-Release: 2%{?_dist_release}
-License: OFL
+Version: 3.006
+Release: 1%{?_dist_release}
 Group: User Interface/X
-URL: http://sourceforge.net/projects/sourcesans.adobe/
+Vendor: Project Vine
+Distribution: Vine Linux
+
+License: OFL
+URL: https://adobe-fonts.github.io/source-sans-pro/
+Source:	https://github.com/adobe-fonts/source-sans-pro/releases/download/%{version}R/source-sans-pro-%{version}R.zip
+
 BuildArch: noarch
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
-Source:	http://sourceforge.net/projects/sourcesans.adobe/files/%{_fontname}-%{version}.zip
 BuildRequires: unzip
+Obsoletes: %{name}-doc < 3.006
 
 %description
 Source Sans is a set of OpenType fonts that have been designed 
 to work well in user interface (UI) environments, 
 as well as in text setting for screen and print.
 
-%package doc
-Summary: Source Sans pro font documents
-Summary(ja): Source sans pro フォントドキュメント
-Group: User Interface/X
-
-%description doc
-This package includes important documents for Source Sans pro fonts
-includes enduser license.
-
-%description -l ja doc
-このパッケージには Source Sans pro フォントのライセンスを含む
-ドキュメント類が含まれています。
 
 %prep
-%setup -q -n %{_fontname}-%{version}
+%setup -q -n source-sans-pro-%{version}R
+
 
 %clean
 if test -n "%{buildroot}" && test "/" != "%{buildroot}"; then
     rm -rf %{buildroot}
 fi
 
+
 %build
 
+
 %install
 rm -rf %{buildroot}
 
 mkdir -p %{buildroot}%{_fontdir}
 cp -a OTF/*.otf %{buildroot}%{_fontdir}
 
+
 %post
 %__font_install_post %{fontdir}
 
 %postun
 %__font_install_postun %{fontdir}
 
+
 %files
 %defattr(-,root,root,-)
+%license LICENSE.md
+%doc README.md
 %{_fontdir}/*.otf
 
-%files doc
-%defattr(-,root,root,-)
-%doc LICENSE.txt ReadMe.html SourceSansProReadMe.html
 
 %changelog
+* Mon May 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.006-1
+- new upstream release.
+
 * Sun Jan 12 2014 TANAKA hiroaki <mosaicist@jcom.home.ne.jp> 1.050-2
 - rebuilt with gcc-4.8
 

+ 57 - 9
T/TrueType-ipafont/TrueType-ipafont-vl.spec

@@ -2,14 +2,16 @@
 
 Name:    TrueType-ipafont
 Version: 3.03
-Release: 3%{?_dist_release}
+Release: 4%{?_dist_release}
 Summary: IPA TrueType Fonts
 Summary(ja): IPA の日本語 TrueType フォント
 Group: User Interface/X
-License: IPA Font License Agreement v1.0
-URL: http://ossipedia.ipa.go.jp/ipafont/
+Vendor: Project Vine
+Distribution: Vine Linux
 
-Source:	IPAfont00303.zip
+License: IPA Font License Agreement v1.0
+URL: https://ipafont.ipa.go.jp/
+Source:	https://ipafont.ipa.go.jp/IPAfont/IPAfont00303.zip
 Source10: ipafont-mincho.ttfconf
 Source11: ipafont-gothic.ttfconf
 Source20: cidfmap.ja.ipafont-mincho
@@ -31,7 +33,7 @@ fonts.
 %description -l ja
 このパッケージは独立行政法人情報処理推進機構のIPAフォントの明朝、ゴシック
 両書体をインストールするためのメタパッケージです。このパッケージで
-以下の5書体がインストールされます。
+以下の4書体がインストールされます。
 (IPA明朝、IPAP明朝、IPAゴシック、IPAPゴシック)
 
 %package mincho
@@ -39,6 +41,8 @@ Summary: IPAMincho TrueType Fonts
 Summary(ja): IPA明朝 True Type フォント
 Group: User Interface/X
 Requires: TrueType-ipafont-doc
+Requires: alternatives
+Requires(preun): alternatives
 
 %description mincho
 This package includes IPA Mincho TrueType fonts.
@@ -52,6 +56,8 @@ Summary: IPA Gothic TrueType Fonts
 Summary(ja): IPA Gothic 日本語 True Type フォント
 Group: User Interface/X
 Requires: TrueType-ipafont-doc
+Requires: alternatives
+Requires(preun): alternatives
 
 %description gothic
 This package includes IPA Gothic TrueType fonts.
@@ -93,8 +99,8 @@ do
 done
 
 # install ghostscript8 cidfmap 
-mkdir -p $RPM_BUILD_ROOT%{_datadir}/ghostscript/conf.d
-install -m644 %{SOURCE20} %{SOURCE21} $RPM_BUILD_ROOT%{_datadir}/ghostscript/conf.d
+#mkdir -p $RPM_BUILD_ROOT%{_datadir}/ghostscript/conf.d
+#install -m644 %{SOURCE20} %{SOURCE21} $RPM_BUILD_ROOT%{_datadir}/ghostscript/conf.d
 
 # add fontpath.d symlinks
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/X11/fontpath.d
@@ -111,34 +117,76 @@ fi
 %post gothic
 %__font_install_post %{_fontdir}
 
+%posttrans mincho
+update-alternatives --install \
+	/usr/share/fonts/alias/TrueType/fonts-japanese-mincho.ttf \
+	fonts-japanese-mincho.ttf \
+	%{_fontdir}/ipam.ttf \
+	100
+if [ ! -f /usr/share/fonts/alias/TrueType/fonts-japanese-mincho.ttf ] ; then
+    /sbin/update-alternatives --auto fonts-japanese-mincho.ttf
+fi
+
+%posttrans gothic
+update-alternatives --install \
+	/usr/share/fonts/alias/TrueType/fonts-japanese-gothic.ttf \
+	fonts-japanese-gothic.ttf \
+	%{_fontdir}/ipag.ttf \
+	100
+if [ ! -f /usr/share/fonts/alias/TrueType/fonts-japanese-gothic.ttf ] ; then
+    /sbin/update-alternatives --auto fonts-japanese-gothic.ttf
+fi
+
+%preun mincho
+if [ $1 -eq 0 ]; then
+	update-alternatives --remove \
+		fonts-japanese-mincho.ttf \
+		%{_fontdir}/ipam.ttf
+    /sbin/update-alternatives --auto fonts-japanese-mincho.ttf ||:
+fi
+
+%preun gothic
+if [ $1 -eq 0 ]; then
+	update-alternatives --remove \
+		fonts-japanese-gothic.ttf \
+		%{_fontdir}/ipag.ttf
+    /sbin/update-alternatives --auto fonts-japanese-gothic.ttf ||:
+fi
+
 %postun mincho
 %__font_install_postun %{_fontdir}
 
 %postun gothic
 %__font_install_postun %{_fontdir}
 
+
 %files
 
 %files doc
 %doc *.txt
 
 %files mincho
+%license IPA_Font_License_Agreement_v1.0.txt
 %{_fontdir}/ipam*.ttf
 %{_fontdir}/ipafont-mincho.ttfconf
-%config %{_datadir}/ghostscript/conf.d/cidfmap.ja.ipafont-mincho
+#%config %{_datadir}/ghostscript/conf.d/cidfmap.ja.ipafont-mincho
 %{_sysconfdir}/fonts/conf.avail/*-ipa-mincho.conf
 %{_sysconfdir}/X11/fontpath.d/%{name}
 %config(missingok,noreplace) %{_sysconfdir}/fonts/conf.d/*-ipa-mincho.conf
 
 %files gothic
+%license IPA_Font_License_Agreement_v1.0.txt
 %{_fontdir}/ipag*.ttf
 %{_fontdir}/ipafont-gothic.ttfconf
-%config %{_datadir}/ghostscript/conf.d/cidfmap.ja.ipafont-gothic
+#%config %{_datadir}/ghostscript/conf.d/cidfmap.ja.ipafont-gothic
 %{_sysconfdir}/fonts/conf.avail/*-ipa-gothic.conf
 %config(missingok,noreplace) %{_sysconfdir}/fonts/conf.d/*-ipa-gothic.conf
 
 
 %changelog
+* Sun May 03 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.03-4
+- made to use alternatives for new ghostscript structure.
+
 * Wed Jul 13 2016 IWAI, Masaharu <iwaim.sub@gmail.com> 3.03-3
 - fix fontconfig files (Source30, 31) for fontconfig 2.10
  - sync Vine Linux Git repository

+ 29 - 9
T/TrueType-vlgothic/TrueType-vlgothic-vl.spec

@@ -1,5 +1,5 @@
 %define version 2.120
-%define release 1%{?_dist_release}
+%define release 2%{?_dist_release}
 %define vlgothic_date 20141206
 %define ttfjp_version 6.0
 
@@ -12,9 +12,12 @@ Summary(ja): VLゴシックフォントファミリ - フリーの日本語 True
 Name: TrueType-vlgothic
 Version: %{version}
 Release: %{release}
+Group: User Interface/X
+Vendor: Project Vine
+Distribution: Vine Linux
+Packager: daisuke
 
 License: BSD style
-Group: User Interface/X
 Url: http://vlgothic.dicey.org/
 
 Source: %{name}.tar.bz2
@@ -25,10 +28,6 @@ Source1: VLGothic-%{vlgothic_date}.tar.xz
 Source10: 59-vlgothic.conf
 Source20: cidfmap.ja.vlgothic
 
-Distribution: Vine Linux
-Vendor: Project Vine
-Packager: daisuke
-
 BuildArch: noarch
 Buildroot: %{_tmppath}/%{name}-%{version}-root
 Requires(post): mktcapdir >= 0.5.4
@@ -70,8 +69,8 @@ do
 done
 
 # install ghostscript8 cidfmap 
-mkdir -p $RPM_BUILD_ROOT%{_datadir}/ghostscript/conf.d
-install -m644 %{SOURCE20} $RPM_BUILD_ROOT%{_datadir}/ghostscript/conf.d
+#mkdir -p $RPM_BUILD_ROOT%{_datadir}/ghostscript/conf.d
+#install -m644 %{SOURCE20} $RPM_BUILD_ROOT%{_datadir}/ghostscript/conf.d
 
 # add fontpath.d symlinks
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/X11/fontpath.d
@@ -80,6 +79,24 @@ ln -sf /usr/share/fonts/%{name} $RPM_BUILD_ROOT%{_sysconfdir}/X11/fontpath.d/
 %post
 %__font_install_post %{fontdir}
 
+%posttrans
+update-alternatives --install \
+	/usr/share/fonts/alias/TrueType/fonts-japanese-gothic.ttf \
+	fonts-japanese-gothic.ttf \
+	%{fontdir}/VL-Gothic-Regular.ttf \
+	80
+if [ ! -f /usr/share/fonts/alias/TrueType/fonts-japanese-gothic.ttf ] ; then
+    /sbin/update-alternatives --auto fonts-japanese-gothic.ttf
+fi
+
+%preun
+if [ $1 -eq 0 ]; then
+	update-alternatives --remove \
+		fonts-japanese-gothic.ttf \
+		%{fontdir}/VL-Gothic-Regular.ttf
+    /sbin/update-alternatives --auto fonts-japanese-gothic.ttf ||:
+fi
+
 %postun
 %__font_install_postun %{fontdir}
 
@@ -93,9 +110,12 @@ rm -rf $RPM_BUILD_ROOT
 %{_sysconfdir}/fonts/conf.avail/*.conf
 %{_sysconfdir}/X11/fontpath.d/%{name}
 %config(missingok,noreplace) %{_sysconfdir}/fonts/conf.d/*.conf
-%config %{_datadir}/ghostscript/conf.d/cidfmap.ja.vlgothic
+#%config %{_datadir}/ghostscript/conf.d/cidfmap.ja.vlgothic
 
 %changelog
+* Mon May 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.120-2
+- made to use alternatives for new ghostscript structure.
+
 * Sat Dec 06 2014 Daisuke SUZUKI <daisuke@vinelinux.org> 2.120-1
 - update to 20141206
 

+ 178 - 143
g/ghostscript/ghostscript-vl.spec

@@ -1,77 +1,87 @@
-%define gs_dot_ver 9.27
+%bcond_with versioned_dir
 
-%define gs_ver %(echo %{gs_dot_ver} | sed -e "s/\\.//")
-%{expand: %%define build_with_freetype %{?_with_freetype:1}%{!?_with_freetype:0}}
+%if %{with versioned_dir}
+%global gsdatadir %{_datadir}/%{name}/%{version}
+%global gslibdir %{_libdir}/%{name}/%{version}
+%global gsconfdir %{_sysconfdir}/%{name}/%{version}
+%else
+%global gsdatadir %{_datadir}/%{name}
+%global gslibdir %{_libdir}/%{name}
+%global gsconfdir %{_sysconfdir}/%{name}
+%endif
 
-Summary: A PostScript(TM) interpreter and renderer.
-Summary(ja): 日本語 PostScript(TM) インタプリタ/レンダラ/ビュア
-Name: ghostscript
-Version: %{gs_dot_ver}
-Release: 3%{?_dist_release}
+Summary:        A PostScript(TM) interpreter and renderer.
+Summary(ja):    日本語 PostScript(TM) インタプリタ/レンダラ/ビュア
+Name:           ghostscript
+Version:        9.52
+Release:        1%{?_dist_release}
+Group:          Applications/Publishing
+Vendor:         Project Vine
+Distribution:   Vine Linux
+Packager:       daisuke
 
 # Included CMap data is Redistributable, no modification permitted,
 # see http://bugzilla.redhat.com/487510
-License: AGPLv3+ and Redistributable, no modification permitted
-URL: http://www.ghostscript.com/
-Group: Applications/Publishing
-Source0: https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs%{gs_ver}/ghostscript-%{gs_dot_ver}.tar.xz
+License:        AGPLv3+ and Redistributable, no modification permitted
+URL:            https://www.ghostscript.com/
+%define         shortver %(echo %{version} | sed -e "s/\\.//")
+Source0:        https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs%{shortver}/ghostscript-%{version}.tar.xz
+
 # ghostscript contains code we cannot ship due to licensing concerns.
 # Therefore we use this script to remove it before shipping the
 # tarball.
 # Download the upstream tarball and invoke this script while in the
 # tarball's directory:
-Source1: generate-tarball.sh
-Source2: CIDFnmap
-Source4: cidfmap
-Source5: cidfmap.ja
+# ... this script is not needed now
+Source1:        generate-tarball.sh
+
+Source2:        CIDFnmap
+Source4:        cidfmap
+Source5:        cidfmap.ja
 
-Source10: Changelog.gs7.vine
+Source10:       Changelog.gs7.vine
+
+# patches from upstream
+Patch000:       ghostscript-9.50-enumerate-all-fonts.patch
 
 # patches from fedora
-Patch100: ghostscript-9.23-100-run-dvipdf-securely.patch
+Patch100:       ghostscript-9.23-100-run-dvipdf-securely.patch
 
 # security patches
-Patch001: ghostscript-cve-2019-10216.patch
-Patch002: CVE-2019-14811_14812_14813.patch
-Patch003: 0001-fix-CVE-2019-14817.patch
-Patch004: CVE-2019-14869.patch
 
 # Vine patch(es)
-Patch1000: runlibfileifexists.patch
+Patch1000:      runlibfileifexists.patch
 
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-BuildRequires: xz
-BuildRequires: libjpeg-devel, libXt-devel
-BuildRequires: zlib-devel, libpng-devel, unzip, gtk3-devel
-BuildRequires: glib2-devel, gnutls-devel
+BuildRequires:  xz
+BuildRequires:  libjpeg-devel, libXt-devel
+BuildRequires:  zlib-devel, libpng-devel, unzip, gtk3-devel
+BuildRequires:  glib2-devel, gnutls-devel
 # Omni requires libxml
-BuildRequires: libxml2-devel
-BuildRequires: libtiff-devel
-BuildRequires: cups-devel >= 1.1.13
-BuildRequires: libtool
+BuildRequires:  libxml2-devel
+BuildRequires:  libtiff-devel
+BuildRequires:  cups-devel >= 1.1.13
+BuildRequires:  libtool
 #BuildRequires: jasper-devel
-BuildRequires: dbus-devel
-BuildRequires: poppler-data
-BuildRequires: lcms2-devel
-BuildRequires: openjpeg2-devel
-%{?_with_freetype:BuildRequires: freetype2-devel}
-
-Requires: urw-fonts
-Requires: ghostscript-fonts
-Requires: poppler-data
-
-Obsoletes: hpijs <= 1.7.1-2vl5
+BuildRequires:  dbus-devel
+BuildRequires:  poppler-data
+BuildRequires:  lcms2-devel
+BuildRequires:  openjpeg2-devel
+BuildRequires:  freetype2-devel
+BuildRequires:  fontconfig-devel
+
+Requires:       urw-fonts
+Requires:       ghostscript-fonts
+Requires:       poppler-data
+
+Obsoletes:      hpijs <= 1.7.1-2vl5
 #Provides: hpijs
 
-Obsoletes: ghostscript-shared < 8.0
-Provides: ghostscript-shared = %{version}-%{release}
+Obsoletes:      ghostscript-shared < 8.0
+Provides:       ghostscript-shared = %{version}-%{release}
 
-Conflicts: cups < 1.3.9-1
-
-Packager: daisuke
-Vendor: Project Vine
-Distribution: Vine Linux
+Conflicts:      cups < 1.3.9-1
 
 %description
 Ghostscript is a set of software that provides a PostScript(TM)
@@ -135,25 +145,15 @@ Group: Applications/Publishing
 A GTK-enabled version of Ghostscript, called 'gsx'.
 
 %prep
-%setup -q -n %{name}-%{gs_dot_ver}
-rm -rf cups/libs expat freetype icclib jasper jpeg jpegxr lcms lcms2 libpng openjpeg zlib
-rm -rf windows
+%setup -q -n %{name}-%{version}
+rm -rf cups/libs expat freetype jasper jpeg jpegxr lcms2* libpng openjpeg tiff windows zlib
 
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
+%patch000 -p1
 
 %patch100 -p1
 
 %patch1000 -p1
 
-# Convert manual pages to UTF-8
-from8859_1() {
-        iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_"
-        mv "${1}_" "$1"
-}
-
 
 %build
 # Compile without strict aliasing opts due to these files:
@@ -176,16 +176,26 @@ for path in \
 	%{_datadir}/fonts \
 	%{_datadir}/%{name}/conf.d \
 	%{_sysconfdir}/%{name} \
-	%{_sysconfdir}/%{name}/%{gs_dot_ver} \
-	%{_datadir}/poppler/cMap/*
+%if %{with versioned_dir}
+	%{_sysconfdir}/%{name}/%{version} \
+%endif
+;
 do
   FONTPATH="$FONTPATH${FONTPATH:+:}$path"
 done
 autoconf --force
-%configure --with-ijs --enable-dynamic --with-fontpath="$FONTPATH" \
-	--with-drivers=ALL --disable-compile-inits --with-system-libtiff \
-	--with-install-cups \
-	CFLAGS="$CFLAGS $EXTRACFLAGS"
+export CFLAGS="%{optflags} $CFLAGS $EXTRACFLAGS"
+%configure \
+	--enable-dynamic \
+	--disable-compile-inits \
+%if !%{with versioned_dir}
+	--without-versioned-path \
+%endif
+	--with-fontpath="$FONTPATH" \
+	--with-ijs \
+	--with-drivers=ALL \
+	--with-system-libtiff \
+	--with-install-cups
 
 # Build IJS
 cd ijs
@@ -194,146 +204,164 @@ cd ijs
 make %{?_smp_mflags}
 cd ..
 
-%if %{build_with_freetype}
 FT_CFLAGS=$(pkg-config --cflags freetype2)
-make %{?_smp_mflags} \
-     so RPM_OPT_FLAGS="$RPM_OPT_FLAGS $EXTRAFLAGS" prefix=%{_prefix} \
-	FT_BRIDGE=1 FT_CFLAGS="$FT_CFLAGS" FT_LIB=freetype
-make %{?_smp_mflags} \
+make %{?_smp_mflags} so \
      RPM_OPT_FLAGS="$RPM_OPT_FLAGS $EXTRAFLAGS" prefix=%{_prefix} \
 	FT_BRIDGE=1 FT_CFLAGS="$FT_CFLAGS" FT_LIB=freetype
-%else
-make %{?_smp_mflags} \
-     so RPM_OPT_FLAGS="$RPM_OPT_FLAGS $EXTRAFLAGS" prefix=%{_prefix}
-make %{?_smp_mflags} \
-     RPM_OPT_FLAGS="$RPM_OPT_FLAGS $EXTRAFLAGS" prefix=%{_prefix}
-%endif
+
+#make %{?_smp_mflags} \
+#     RPM_OPT_FLAGS="$RPM_OPT_FLAGS $EXTRAFLAGS" prefix=%{_prefix} \
+#	FT_BRIDGE=1 FT_CFLAGS="$FT_CFLAGS" FT_LIB=freetype
+
 make cups
 
 %install
-rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT/{%{_mandir},%{_bindir},%{_datadir},%{_docdir}}
-mkdir -p $RPM_BUILD_ROOT/{%{_libdir},%{_includedir}/ijs}
+rm -rf %{buildroot}
+mkdir -p %{buildroot}
+mkdir -p %{buildroot}/{%{_mandir},%{_bindir},%{_datadir},%{_docdir}}
+mkdir -p %{buildroot}/{%{_libdir},%{_includedir}/ijs}
 
 make install soinstall \
-%{?_with_freetype:FT_BRIDGE=1} \
-	prefix=$RPM_BUILD_ROOT%{_prefix} \
-	mandir=$RPM_BUILD_ROOT%{_mandir} \
-	datadir=$RPM_BUILD_ROOT%{_datadir} \
-	gsincludedir=$RPM_BUILD_ROOT%{_includedir}/ghostscript/ \
-	bindir=$RPM_BUILD_ROOT%{_bindir} \
-	libdir=$RPM_BUILD_ROOT%{_libdir} \
-	docdir=$RPM_BUILD_ROOT%{_docdir}/%{name}-%{gs_dot_ver} \
-	gsdir=$RPM_BUILD_ROOT%{_datadir}/%{name} \
-	gsdatadir=$RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver} \
-	gssharedir=$RPM_BUILD_ROOT%{_libdir}/%{name}/%{gs_dot_ver} \
-	CUPSSERVERROOT=$RPM_BUILD_ROOT`cups-config --serverroot` \
-	CUPSSERVERBIN=$RPM_BUILD_ROOT`cups-config --serverbin` \
-	CUPSDATA=$RPM_BUILD_ROOT`cups-config --datadir`
-
-mv -f $RPM_BUILD_ROOT%{_bindir}/gsc $RPM_BUILD_ROOT%{_bindir}/gs
+	prefix=%{buildroot}%{_prefix} \
+	mandir=%{buildroot}%{_mandir} \
+	datadir=%{buildroot}%{_datadir} \
+	gsincludedir=%{buildroot}%{_includedir}/ghostscript/ \
+	bindir=%{buildroot}%{_bindir} \
+	libdir=%{buildroot}%{_libdir} \
+	docdir=%{buildroot}%{_docdir}/%{name}-%{version} \
+	gsdir=%{buildroot}%{_datadir}/%{name} \
+	gsdatadir=%{buildroot}%{gsdatadir} \
+	gssharedir=%{buildroot}%{gslibdir} \
+	CUPSSERVERROOT=%{buildroot}`cups-config --serverroot` \
+	CUPSSERVERBIN=%{buildroot}`cups-config --serverbin` \
+	CUPSDATA=%{buildroot}`cups-config --datadir`
+
+mv -f %{buildroot}%{_bindir}/gsc %{buildroot}%{_bindir}/gs
 
 cd ijs
 %makeinstall
 cd ..
 
-echo ".so man1/gs.1" > $RPM_BUILD_ROOT/%{_mandir}/man1/ghostscript.1
-ln -sf gs $RPM_BUILD_ROOT/usr/bin/ghostscript
+echo ".so man1/gs.1" > %{buildroot}/%{_mandir}/man1/ghostscript.1
+ln -sf gs %{buildroot}/usr/bin/ghostscript
 
-%if 0
 # Rename an original cidfmap to cidfmap.GS
-mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/Resource/Init/cidfmap{,.GS}
+mv %{buildroot}%{gsdatadir}/Resource/Init/cidfmap{,.GS}
 # Install our own cidfmap to allow the separated
 # cidfmap which the font packages own.
-install -m0644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/Resource/Init/CIDFnmap
-install -m0644 %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/Resource/Init/cidfmap
-%endif
+#install -m0644 %{SOURCE2} %{buildroot}%{gsdatadir}/Resource/Init/CIDFnmap
+install -m0644 %{SOURCE4} %{buildroot}%{gsdatadir}/Resource/Init/cidfmap
+
+# cidfmap.ja
+mkdir -p %{buildroot}%{_datadir}/%{name}/conf.d
+install -m644 %{SOURCE5} %{buildroot}%{_datadir}/%{name}/conf.d/
 
 # Documentation
-install -m0644 doc/COPYING $RPM_BUILD_ROOT%{_docdir}/%{name}-%{gs_dot_ver}
+install -m0644 doc/COPYING %{buildroot}%{_docdir}/%{name}-%{version}
 
 # Don't ship .la files
-rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
+rm -f %{buildroot}%{_libdir}/*.la
 
 # Don't ship .a files
-rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
+rm -f %{buildroot}%{_libdir}/*.a
 
 # Don't ship ijs example client or server
-rm -f $RPM_BUILD_ROOT%{_bindir}/ijs_{client,server}_example
+rm -f %{buildroot}%{_bindir}/ijs_{client,server}_example
 
 # Don't ship URW fonts; we already have them.
-#rm -rf $RPM_BUILD_ROOT%{_datadir}/ghostscript/%{gs_dot_ver}/Resource/Font
+#rm -rf %{buildroot}%{gsdatadir}/Resource/Font
 
 # cjk examples
-mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/examples/cjk
-install -m0644 examples/cjk/* $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/examples/cjk/
+mkdir -p %{buildroot}%{gsdatadir}/examples/cjk
+install -m0644 examples/cjk/* %{buildroot}%{gsdatadir}/examples/cjk/
 
+%if %{with versioned_dir}
 # Don't ship two copies of Resource.  Just the versioned one will do.
-rm -rf $RPM_BUILD_ROOT%{_datadir}/ghostscript/Resource
-
-mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/conf.d
-mkdir -p $RPM_BUILD_ROOT/etc/ghostscript/%{gs_dot_ver}
-touch $RPM_BUILD_ROOT/etc/ghostscript/%{gs_dot_ver}/Fontmap.local
-touch $RPM_BUILD_ROOT/etc/ghostscript/%{gs_dot_ver}/cidfmap.local
+rm -rf %{buildroot}%{_datadir}/ghostscript/Resource
+%endif
 
-# cidfmap.ja
-#install -m644 %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/%{name}/conf.d
+mkdir -p %{buildroot}%{gsconfdir}
+touch %{buildroot}%{gsconfdir}/Fontmap.local
+touch %{buildroot}%{gsconfdir}/cidfmap.local
 
 # vine's historical changelog
-install -m644 %{SOURCE10} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{gs_dot_ver}
+install -m644 %{SOURCE10} %{buildroot}%{_docdir}/%{name}-%{version}
 
 # The man/de/man1 symlinks are broken (bug #66238).
-find $RPM_BUILD_ROOT%{_mandir}/de/man1 -type l | xargs rm -f
+find %{buildroot}%{_mandir}/de/man1 -type l | xargs rm -f
 
 # Don't ship fixmswrd.pl as it pulls in perl (bug #463948).
-rm -f $RPM_BUILD_ROOT%{_bindir}/fixmswrd.pl
+rm -f %{buildroot}%{_bindir}/fixmswrd.pl
 
 # Don't ship CMaps (instead poppler-data paths are in search path).
-rm -f $RPM_BUILD_ROOT%{_datadir}/ghostscript/%{gs_dot_ver}/Resource/CMap/*
+rm -f %{buildroot}%{gsdatadir}/Resource/CMap/*
+
+rm -f %{buildroot}%{gsdatadir}/Resource/Init/gs_init.ps.orig
+rm -f %{buildroot}%{gsdatadir}/Resource/Init/gs_fonts.ps.orig
 
 MAIN_PWD=`pwd`
-(cd $RPM_BUILD_ROOT; find ./usr/share/ghostscript/%{gs_dot_ver}/Resource -type f | \
+(cd %{buildroot}; find .%{gsdatadir}/Resource -type f | \
 		sed -e 's/\.//;' | grep -v Fontmap | grep -v gs_init.ps > $MAIN_PWD/rpm.sharelist
  find .%{_bindir}/ | sed -e 's/\.//;' | \
 		grep -v '/$\|/hpijs$\|/gsx$\|/ijs-config$' \
 		>> $MAIN_PWD/rpm.sharelist)
 
+
 %clean
-rm -rf $RPM_BUILD_ROOT
+rm -rf %{buildroot}
+
 
-%post -p /sbin/ldconfig
+%post
+/sbin/ldconfig
+
+if [ -d /usr/share/ghostscript/Resource/CMap -a ! -e Adobe-Japan1-0 ]; then
+  cd /usr/share/ghostscript/Resource/CMap
+  find ../../../poppler/cMap/ -type f | while read f;do
+    ln -sf $f ./
+  done
+fi
 
 %postun -p /sbin/ldconfig
 
+%triggerin -- poppler-data
+if [ -d /usr/share/ghostscript/Resource/CMap ]; then
+  cd /usr/share/ghostscript/Resource/CMap
+  rm -f ./*
+  find ../../../poppler/cMap/ -type f | while read f;do
+    ln -sf $f ./
+  done
+fi
+
+
 %files -f rpm.sharelist
 %defattr(-,root,root)
+%if %{with versioned_dir}
 %dir %{_sysconfdir}/ghostscript
-%dir %{_sysconfdir}/ghostscript/%{gs_dot_ver}
-%config(noreplace) %{_sysconfdir}/ghostscript/%{gs_dot_ver}/*
 %dir %{_datadir}/ghostscript
+%endif
+%dir %{gsconfdir}
+%config(noreplace) %{gsconfdir}/*
+%dir %{gsdatadir}
+%dir %{gsdatadir}/Resource
+%dir %{gsdatadir}/Resource/*
 %dir %{_datadir}/ghostscript/conf.d
-%dir %{_datadir}/ghostscript/%{gs_dot_ver}
-%dir %{_datadir}/ghostscript/%{gs_dot_ver}/Resource
-%dir %{_datadir}/ghostscript/%{gs_dot_ver}/Resource/Font
-%dir %{_datadir}/ghostscript/%{gs_dot_ver}/Resource/Init
-%config %{_datadir}/ghostscript/%{gs_dot_ver}/Resource/Init/gs_init.ps
-%config %{_datadir}/ghostscript/%{gs_dot_ver}/Resource/Init/Fontmap*
-#config %{_datadir}/ghostscript/conf.d/cidfmap.ja
-%exclude %{_datadir}/ghostscript/%{gs_dot_ver}/Resource/Font/URW*
-%{_datadir}/ghostscript/%{gs_dot_ver}/examples
-%{_datadir}/ghostscript/%{gs_dot_ver}/lib
-%{_datadir}/ghostscript/%{gs_dot_ver}/iccprofiles
+%config %{gsdatadir}/Resource/Init/gs_init.ps
+%config %{gsdatadir}/Resource/Init/Fontmap*
+%config %{_datadir}/ghostscript/conf.d/cidfmap.ja
+%exclude %{gsdatadir}/Resource/Font/URW*
+%{gsdatadir}/examples
+%{gsdatadir}/lib
+%{gsdatadir}/iccprofiles
 %{_mandir}/man*/*
 %lang(de) %{_mandir}/de/man*/*
 %{_libdir}/libgs.so.*
 %{_libdir}/libijs-*.so*
 %dir %{_libdir}/%{name}
-%{_libdir}/%{name}/%{gs_dot_ver}/
+%{_libdir}/%{name}/*
 
 %files doc
 %defattr(-,root,root)
-%doc %{_docdir}/%{name}-%{gs_dot_ver}
+%doc %{_docdir}/%{name}-%{version}
 
 %files gtk
 %defattr(-,root,root)
@@ -350,6 +378,13 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/libgs.so
 
 %changelog
+* Mon May 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.52-1
+- new upstream release.
+- dropped security patches: fixed in upstream.
+- imported Patch000 from upstream.
+- updated Patch100.
+- new scheme of cidfmap.
+
 * Thu Nov 28 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.27-3
 - added Patch004 to fix CVE-2019-14869.