sgml-skel/sgml-skel.spec
Martin Pluskal 95b1e67657 Accepting request 895751 from home:alarrosa:branches:Publishing
While debugging an unrelated issue, I noticed this in the
/var/log/zypp/history file in a completely new TW installation:

```
# 2021-05-27 12:53:09 sgml-skel-0.7.1-1.11.noarch.rpm installed ok
# Additional rpm output:
# /var/tmp/rpm-tmp.ss1I6k: line 5: sed: command not found
# I/O error : Broken pipe
#
2021-05-27 12:53:09|install|sgml-skel|0.7.1-1.11|noarch||openSUSE-20210522-0|2122ff76185f0cb41900e7183b903534c1bf7a345fb41af99fe5af286d8e87f0|
2021-05-27 12:53:09|install|sg3_utils|1.46-1.1|x86_64||openSUSE-20210522-0|8ee96d933cbaaeab7cb716a43e76c6f679f3f2a10c85f734592745a42a7243c9|
2021-05-27 12:53:09|install|sed|4.8-3.5|x86_64||openSUSE-20210522-0|3e20c62841696a4d1240a565cc2ee48943a93d13fb740c560fd6fe27422398b0|
```

So %post fails to run because sed is not installed yet.

This SR fixes that.

- %post uses sed, so add `Requires(post): sed`.

OBS-URL: https://build.opensuse.org/request/show/895751
OBS-URL: https://build.opensuse.org/package/show/Publishing/sgml-skel?expand=0&rev=22
2021-05-27 12:00:58 +00:00

94 lines
3.1 KiB
RPMSpec

#
# spec file for package sgml-skel
#
# Copyright (c) 2021 SUSE LLC
#
# 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/
#
Name: sgml-skel
Version: 0.7.1
Release: 0
Summary: Helper Scripts for the SGML System
License: GPL-2.0-or-later
Group: Productivity/Publishing/SGML
URL: https://github.com/openSUSE/sgml-skel
Source0: https://github.com/openSUSE/sgml-skel/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires: automake
BuildRequires: libxml2
Requires: /bin/awk
Requires: bash
Requires: coreutils
Requires: findutils
Requires: libxml2-tools
Requires: libxslt-tools
Requires(post): /bin/awk
Requires(post): bash
Requires(post): coreutils
Requires(post): findutils
Requires(post): libxml2-tools
Requires(post): libxslt-tools
Requires(post): sed
BuildArch: noarch
%description
These scripts will help prepare and maintain parts of an SGML system.
%prep
%setup -q
%build
autoreconf -fiv
%configure
%install
%make_install
ln -sf sgml2xmlcat.sh %{buildroot}%{_bindir}/sgmlcat2x.sh
ln -sf install-catalog %{buildroot}%{_bindir}/install-catalog.sh
ln -sf edit-xml-catalog %{buildroot}%{_bindir}/edit-xml-catalog.sh
install -d -m755 %{buildroot}%{_datadir}/sgml
install -d -m755 %{buildroot}%{_sysconfdir}/{sgml,xml}
install -d -m755 %{buildroot}%{_localstatedir}/lib/sgml
touch %{buildroot}%{_sysconfdir}/sgml/catalog
xmlcatalog --noout --create %{buildroot}%{_sysconfdir}/xml/suse-catalog.xml
xmlcatalog --noout --create %{buildroot}%{_sysconfdir}/xml/catalog
# Use correct order: first new method, second old method
xmlcatalog --noout --add "nextCatalog" "catalog-d.xml" "catalog-d.xml" %{buildroot}%{_sysconfdir}/xml/catalog
xmlcatalog --noout --add "nextCatalog" "suse-catalog.xml" "suse-catalog.xml" %{buildroot}%{_sysconfdir}/xml/catalog
install -d -m755 %{buildroot}%{_sysconfdir}/xml/catalog.d
%post
# only create suse-catalog.xml at installation time; not in the update case
if [ "$1" = 1 ]; then
[ -r %{_sysconfdir}/xml/suse-catalog.xml ] \
|| xmlcatalog --create | sed 's:/>:>\
</catalog>:' >%{_sysconfdir}/xml/suse-catalog.xml
fi
update-xml-catalog
%files
%defattr(-, root, root)
%dir %{_sysconfdir}/sgml
%dir %{_sysconfdir}/xml
%dir %{_sysconfdir}/xml/catalog.d
%dir %{_localstatedir}/lib/sgml
%doc AUTHORS COPYING ChangeLog README*
%ghost %{_sysconfdir}/sgml/catalog
%ghost %{_sysconfdir}/xml/suse-catalog.xml
%ghost %{_sysconfdir}/xml/catalog-d.xml
%config %verify(not md5 size mtime) %{_sysconfdir}/xml/catalog
%{_bindir}/*
%{_mandir}/man1/*
%changelog