/[gentoo-x86]/app-doc/gentoo-web/gentoo-web-2.4.ebuild
Gentoo

Contents of /app-doc/gentoo-web/gentoo-web-2.4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.17 - (show annotations) (download)
Mon Dec 2 05:01:02 2002 UTC (11 years, 10 months ago) by drobbins
Branch: MAIN
CVS Tags: HEAD
Changes since 1.16: +1 -1 lines
FILE REMOVED
zapping old gentoo-web ebuild

1 # Copyright 1999-2002 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /home/cvsroot/gentoo-x86/app-doc/gentoo-web/gentoo-web-2.4.ebuild,v 1.16 2002/11/14 18:36:53 vapier Exp $
4
5 S=${WORKDIR}/gentoo-src/gentoo-web
6 TEMPLATE=${S}/xsl/guide-main.xsl
7 DESCRIPTION="www.gentoo.org website"
8 SRC_URI="http://www.red-bean.com/cvs2cl/cvs2cl.pl"
9 HOMEPAGE="http://www.gentoo.org"
10 ##################
11 # This Ebuild will require the following _enviroment_ variables to be set
12 #
13 # GENTOO_SRCDIR - the directory you have extracted the xml-guide-latest.tar.gz or checked out gentoo-src/gentoo-web
14 # from CVS
15 #
16 # WEBROOT - The top directory you want the website to be built into (eg /home/httpd/htdocs)
17
18 SLOT="0"
19 LICENSE="GPL-2"
20 KEYWORDS="x86 ppc sparc sparc64"
21
22 RDEPEND="virtual/python
23 dev-libs/libxslt"
24
25 DEPEND="${RDEPEND}"
26
27 src_unpack() {
28 local myhost
29 myhost=`hostname`
30 if [ "$myhost" = "inventor.gentoo.org" ]
31 then
32 echo -e "\e[32;1mDROBBINS detected.\e[0m"
33 GENTOO_SRCDIR=/home/drobbins/gentoo-src
34 WEBROOT=/home/httpd/htdocs
35 elif [ "$myhost" = "chiba.3jane.net" ]
36 then
37 echo -e "\e[32;1mCHIBA detected.\e[0m"
38 WEBROOT=/www/virtual/www.gentoo.org/htdocs
39 else
40 if [ -n "${WEBROOT}" ]
41 then
42 # assign it from the environment.
43 WEBROOT=${WEBROOT}
44 else
45 # look for it with apache
46 WEBROOT="`grep '^DocumentRoot' /etc/apache/conf/apache.conf | cut -d\ -f2`"
47 # give it a nice default
48 [ -z "${WEBROOT}" ] && WEBROOT=/home/httpd/htdocs
49 #GENTOO_SRCDIR=/data/gentoo-src
50 fi
51 fi
52
53 echo "Setting GENTOO_SRCDIR to $GENTOO_SRCDIR"
54 echo "Setting WEBROOT to $WEBROOT"
55 echo "${WEBROOT}" > ${T}/webroot
56
57 cd ${WORKDIR} || die
58 if [ -n "$GENTOO_SRCDIR" ]
59 then
60 ln -s "${GENTOO_SRCDIR}" gentoo-src || die
61 else
62 echo "GENTOO_SRCDIR $GENTOO_SRCDIR"
63 cvs -d /home/cvsroot co gentoo-src/gentoo-web
64 fi
65 }
66
67 src_install() {
68 export WEBROOT="`cat ${T}/webroot`"
69 dodir ${WEBROOT}/doc
70 dodir ${WEBROOT}/doc/txt
71 dodir ${WEBROOT}/projects
72 insinto ${WEBROOT}/doc
73
74 local x
75 local y
76 for y in en es fr nl cz ja de
77 do
78 cd ${S}/xml/doc/${y}
79 for x in *.xml
80 do
81 x=`basename ${x} .xml`
82 xsltproc $TEMPLATE ${x}.xml > ${D}${WEBROOT}/doc/${x}.html || die
83 done
84 done
85
86 local z
87 cd ${D}${WEBROOT}/doc
88 for z in *.html
89 do
90 z=`basename ${z} .html`
91 lynx -dump ${z}.html | awk 'BEGIN { DOIT=0; } { if ($0 ~ /Updated/) DOIT=1; if (DOIT != 1) print $0}'i | sed -e '1,3d' \
92 &> ${D}${WEBROOT}/doc/txt/${z}.txt || die
93 done
94
95 cd ${D}${WEBROOT}/doc/txt
96 tar -cf gentoo-web-doc.tar *
97 bzip2 -z gentoo-web-doc.tar
98
99 cd ${S}
100 cp txt/firewall ${D}${WEBROOT}/doc/
101 dodir ${WEBROOT}/images
102 insinto ${WEBROOT}/images
103 cp -a ${S}/images ${D}/${WEBROOT}
104 local x
105 cd images
106 for x in shots/desktop*.png
107 do
108 [ "${x%*small.png}" != "${x}" ] && continue
109 sed -e "s:TITLE:${x}:" -e "s:IMG:http\://www.ibiblio.org/gentoo/images/${x}:" ${S}/html/shell.html > ${D}${WEBROOT}/images/${x%.png}.html
110 done
111
112 insinto ${WEBROOT}
113 doins favicon.ico
114
115 cd ${S}
116 doins css/main-new.css css/resume.css
117
118 #dynamic firewalls tools page
119 xsltproc $TEMPLATE xml/dynfw.xml > ${D}${WEBROOT}/projects/dynfw.html || die
120 xsltproc $TEMPLATE xml/project-xml.xml > ${D}${WEBROOT}/projects/xml.html || die
121
122 #resume
123 xsltproc xsl/resume-html.xsl xml/resume.xml > ${D}${WEBROOT}/resume.html || die
124
125 #both URLs should work
126 dodir ${WEBROOT}/projects/keychain
127 xsltproc $TEMPLATE xml/keychain.xml > ${D}${WEBROOT}/projects/keychain.html || die
128 xsltproc $TEMPLATE xml/keychain.xml > ${D}${WEBROOT}/projects/keychain/index.html || die
129
130 insinto ${WEBROOT}/projects
131 doins dynfw/dynfw-1.0.1.tar.gz
132
133 cd ..
134 tar czvf ${D}${WEBROOT}/projects/guide-xml-latest.tar.gz gentoo-web
135 cd ${S}
136 dodir ${WEBROOT}/news
137 local mydate
138 mydate=`date +"%d %b %Y"`
139 echo "<?xml version='1.0'?>" > ${T}/main-news.xml
140 echo '<mainpage id="news"><title>Gentoo Linux News</title><author title="Author"><mail link="drobbins@gentoo.org">Daniel Robbins</mail></author>' >> ${T}/main-news.xml
141 echo "<version>1.0</version><date>${mydate}</date><newsitems>" >> ${T}/main-news.xml
142 local myext
143 for x in `find xml/news -iname 200*.xml | sort -r`
144 do
145 myext=`basename $x`
146 myext=${myext%*.xml}
147 cat $x | sed -e "1d" -e "s:<news:<news external=\"/news/${myext}.html\":" >> ${T}/main-news.xml
148 xsltproc xsl/guide-main.xsl $x > ${D}/${WEBROOT}/news/${myext}.html
149 done
150 echo "</newsitems></mainpage>" >> ${T}/main-news.xml
151 # Lets create the use description page,
152
153 echo "<?xml version='1.0'?>" > ${T}/main-use.xml
154 echo '<guide link="/use.html"><title>Gentoo Linux Use Variable Descriptions</title><author title="Author"><mail link="peitolm@gentoo.org">Colin Morey</mail></author>' >> ${T}/main-use.xml
155 echo "<version>1.0</version><date>${mydate}</date><chapter><title>Use Descriptions</title>" >> ${T}/main-use.xml
156 echo "<section><body><p>A small table of currently available use variables and a short description of each</p><table>" >> ${T}/main-use.xml
157 echo '<tr><th>Variable</th><th>Description</th></tr>' >> ${T}/main-use.xml
158
159 # The following line is not the most elegant, but in this instance we go for readability over compactness
160 for line in `cat /usr/portage/profiles/use.desc | grep -v \# | sed 's/ /___/g'|sed 's/___-___/\<\/ti>\<ti\>/'`
161 do
162 echo "<tr><ti>$line </ti></tr>" | sed 's/___/ /g'>> ${T}/main-use.xml
163 done
164 echo "</table></body></section></chapter></guide>" >> ${T}/main-use.xml
165
166 #create the lang description page
167 echo "<?xml version='1.0'?>" > ${T}/main-lang.xml
168 echo '<guide link="/lang.html"><title>Gentoo Linux LANG Descriptions</title><author title="Author"><mail link="zhen@gentoo.org">John P. Davis</mail></author>' >> ${T}/main-lang.xml
169 echo "<version>1.0</version><date>${mydate}</date><chapter><title>LANG Descriptions</title>" >> ${T}/main-lang.xml
170 echo "<section><body><p>A small table of currently available LANG variables and a short description of each</p><table>" >> ${T}/main-lang.xml
171 echo '<tr><th>LANG</th><th>Description</th></tr>' >> ${T}/main-lang.xml
172
173 # The following line is not the most elegant, but in this instance we go for readability over compactness
174 for line in `cat /usr/portage/profiles/lang.desc | grep -v \# | sed 's/ /___/g'|sed 's/___-___/\<\/ti>\<ti\>/'`
175 do
176 echo "<tr><ti>$line </ti></tr>" | sed 's/___/ /g'>> ${T}/main-lang.xml
177 done
178 echo "</table></body></section></chapter></guide>" >> ${T}/main-lang.xml
179
180
181
182 insinto ${WEBROOT}
183 xsltproc $TEMPLATE ${T}/main-news.xml > ${D}${WEBROOT}/index.html || die
184 xsltproc $TEMPLATE xml/main-about.xml > ${D}${WEBROOT}/index-about.html || die
185 xsltproc $TEMPLATE xml/main-download.xml > ${D}${WEBROOT}/index-download.html || die
186 xsltproc $TEMPLATE xml/main-projects.xml > ${D}${WEBROOT}/index-projects.html || die
187 xsltproc $TEMPLATE xml/main-docs.xml > ${D}${WEBROOT}/index-docs.html || die
188 xsltproc $TEMPLATE xml/main-articles.xml > ${D}${WEBROOT}/index-articles.html || die
189 xsltproc $TEMPLATE xml/main-contract.xml > ${D}${WEBROOT}/index-contract.html || die
190 xsltproc $TEMPLATE xml/main-graphics.xml > ${D}${WEBROOT}/index-graphics.html || die
191 xsltproc $TEMPLATE ${T}/main-use.xml > ${D}${WEBROOT}/doc/use.html || die
192 xsltproc $TEMPLATE ${T}/main-lang.xml > ${D}${WEBROOT}/doc/lang.html || die
193 xsltproc $TEMPLATE xml/main-mirrors.xml > ${D}${WEBROOT}/index-mirrors.html || die
194 xsltproc $TEMPLATE xml/main-irc.xml > ${D}${WEBROOT}/index-irc.html || die
195 OLDROOT=${ROOT} ; unset ROOT
196
197 ROOT=${OLDROOT}
198
199
200 #install XSL for later use
201 dodir ${WEBROOT}/xsl
202 insinto ${WEBROOT}/xsl
203 cd ${S}/xsl
204 doins cvs.xsl guide-main.xsl
205
206 #install snddevices script
207 dodir ${WEBROOT}/scripts
208 insinto ${WEBROOT}/scripts
209 cd ${S}/scripts
210 doins snddevices
211
212 dobin ${DISTDIR}/cvs2cl.pl
213 dosbin ${S}/bin/cvslog.sh
214
215 insinto ${WEBROOT}
216 doins ${S}/txt/robots.txt
217
218 cd ${D}
219 chmod -R +r *
220
221 insinto ${WEBROOT}/snapshots
222 newins ${S}/html/index.html-snapshots index.html
223 }
224
225 pkg_preinst() {
226 export WEBROOT="`cat ${T}/webroot`"
227 if [ -d ${WEBROOT}.bak ]
228 then
229 rm -rf ${WEBROOT}.bak
230 fi
231 if [ -d ${WEBROOT} ]
232 then
233 cp -ax ${WEBROOT} ${WEBROOT}.bak
234 fi
235 if [ "`hostname`" = "chiba.3jane.net" ]
236 then
237 echo '>>> Syncing up images to ibiblio...'
238 source ~drobbins/.ssh-agent-chiba.3jane.net
239 rsync --delete -ave ssh ${D}/${WEBROOT}/images/ drobbins@login.ibiblio.org:gentoo/images/
240 fi
241
242 #do some python goodness outside of the firewall
243 #This can only be done in ${T} since ${S} may be a live CVS tree
244 python ${S}/python/gendevlistxml.py ${S}/txt/devlist.txt ${T}/main-devlist.xml || die
245 xsltproc $TEMPLATE ${T}/main-devlist.xml > ${D}${WEBROOT}/index-devlist.html || die
246
247 # now we make the package tree(this is what takes the time)
248
249 cd ${T}
250 mkdir -p xml/packages
251 dodir ${WEBROOT}/packages/
252 insinto ${WEBROOT}/packages/
253 #we're getting bonkers stuff in the main packages pages, so lets make sure it's empty
254 python ${S}/python/genpkgxml.py ${T}/main-packages-old-style.xml || die
255 python ${S}/python/genpkgxml-v2.py ${T}/main-packages.xml || die
256 for DIR in `ls xml/packages`
257 do
258 dodir ${WEBROOT}/packages/${DIR}
259 for FILE in `ls xml/packages/${DIR}`
260 do
261 FILE=${FILE%.xml}
262 echo -n "."
263 xsltproc $TEMPLATE xml/packages/${DIR}/${FILE}.xml > ${D}/${WEBROOT}/packages/${DIR}/${FILE}.html || die
264 done
265 done
266 xsltproc $TEMPLATE ${T}/main-packages.xml > ${D}${WEBROOT}/index-packages.html || die
267 xsltproc $TEMPLATE ${T}/main-packages-old-style.xml > ${D}${WEBROOT}/index-packages-old.html || die
268 }

  ViewVC Help
Powered by ViewVC 1.1.20