Magellan Linux

Annotation of /branches/R11-unstable/extras/sgml-common/sgml-common-0.6.3-r7.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 25786 - (hide annotations) (download)
Tue Nov 25 04:18:11 2014 UTC (9 years, 5 months ago) by niro
File size: 2336 byte(s)
-release branches/R11-unstable
1 niro 8365 # $Id$
2    
3     PNAME="sgml-common"
4     PVER="0.6.3"
5     PBUILD="r7"
6    
7 niro 10181 PCAT="app-text"
8 niro 8365
9     DESCRIPTION="Base ISO character entities and utilities for SGML."
10     HOMEPAGE="ftp://ftp.kde.org/pub/kde/devel/docbook/SOURCES/"
11    
12     DEPEND=""
13    
14     SRCFILE="${PNAME}-${PVER}.tgz"
15     SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
16    
17     sminclude mbuild
18    
19     SRC_URI=(
20     ftp://ftp.kde.org/pub/kde/devel/docbook/SOURCES/${SRCFILE}
21     mirror://${PNAME}/${SRCFILE}
22     mirror://${PNAME}/${PNAME}-${PVER}-install-catalog.in
23     mirror://${PNAME}/${PNAME}-${PVER}-configure.in.patch
24     mirror://${PNAME}/${PNAME}-${PVER}-manpage-1.patch
25     )
26    
27     UP2DATE="updatecmd ${HOMEPAGE} | grep ${PNAME}- | lasttarball tgz"
28    
29     src_prepare()
30     {
31     munpack ${SRCFILE} || die
32     cd ${SRCDIR}
33    
34     # we use a hacked version of install-catalog that supports the ROOT
35     # variable, and puts quotes around the CATALOG files.
36     # - taken from gentoo
37     cp ${SOURCEDIR}/${PNAME}/${PNAME}-${PVER}-install-catalog.in \
38     ${SRCDIR}/bin/install-catalog.in
39    
40     # fix docdir location
41     mpatch ${PNAME}-${PVER}-configure.in.patch || die
42    
43     # fix glitch in manpage installation with newer automake
44     mpatch ${PNAME}-${PVER}-manpage-1.patch || die
45    
46     # fix some missing files and rebuild makefiles
47     export WANT_AUTOCONF=2.5
48     export WANT_AUTOMAKE=1.9
49 niro 10181 mautoreconf || die
50 niro 8365 }
51    
52     postinstall()
53     {
54     echo "Installing Catalogs..."
55     ${MROOT}/usr/bin/install-catalog --add \
56     /etc/sgml/sgml-ent.cat \
57     /usr/share/sgml/sgml-iso-entities-8879.1986/catalog
58     ${MROOT}/usr/bin/install-catalog --add \
59     /etc/sgml/sgml-docbook.cat \
60     /etc/sgml/sgml-ent.cat
61    
62     local file
63     for file in $(find ${MROOT}/etc/sgml/ -name "*.cat") ${MROOT}/etc/sgml/catalog
64     do
65     echo "Fixing ${file}"
66     awk '/"$/ { print $1 " " $2 }
67     ! /"$/ { print $1 " \"" $2 "\"" }' ${file} > ${file}.new
68     mv ${file}.new ${file}
69     done
70     }
71    
72     preremove()
73     {
74     cp ${MROOT}/usr/bin/install-catalog ${BUILDDIR}
75     }
76    
77     postremove()
78     {
79     [ ! -x ${BUILDDIR}/install-catalog ] && return
80    
81     echo "Removing Catalogs..."
82     if [[ -e ${MROOT}/etc/sgml/sgml-ent.cat ]]
83     then
84     ${BUILDDIR}/install-catalog --remove \
85     /etc/sgml/sgml-ent.cat \
86     /usr/share/sgml/sgml-iso-entities-8879.1986/catalog
87     fi
88    
89     if [[ -e ${MROOT}/etc/sgml/sgml-docbook.cat ]]
90     then
91     ${BUILDDIR}/install-catalog --remove \
92     /etc/sgml/sgml-docbook.cat \
93     /etc/sgml/sgml-ent.cat
94     fi
95    
96     if [ -x ${BUILDDIR}/install-catalog ]
97     then
98     rm ${BUILDDIR}/install-catalog
99     fi
100     }