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

Contents of /app-doc/gentoo-web/gentoo-web-2.3a.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.16 - (show annotations) (download)
Mon Dec 2 05:01:02 2002 UTC (12 years ago) by drobbins
Branch: MAIN
CVS Tags: HEAD
Changes since 1.15: +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.3a.ebuild,v 1.15 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 SLOT="0"
12 LICENSE="GPL-2"
13 KEYWORDS="x86 ppc sparc sparc64"
14
15 RDEPEND="virtual/python
16 dev-libs/libxslt"
17
18 DEPEND="${RDEPEND}"
19
20 src_unpack() {
21 local myhost
22 myhost=`hostname`
23 if [ "$myhost" = "laptop.kicks-ass.net" ]
24 then
25 echo -e "\e[32;1mMEEKROB detected.\e[0m"
26 GENTOO_SRCDIR=/home/meekrob/gentoo-src
27 WEBROOT=/home/httpd/htdocs
28 elif [ "$myhost" = "inventor.gentoo.org" ]
29 then
30 echo -e "\e[32;1mDROBBINS detected.\e[0m"
31 GENTOO_SRCDIR=/home/drobbins/gentoo-src
32 WEBROOT=/home/httpd/htdocs
33 elif [ "$myhost" = "chiba.3jane.net" ]
34 then
35 echo -e "\e[32;1mCHIBA detected.\e[0m"
36 WEBROOT=/www/virtual/www.gentoo.org/htdocs
37 else
38 if [ -n "${WEBROOT}" ]
39 then
40 # assign it from the environment.
41 WEBROOT=${WEBROOT}
42 else
43 # look for it with apache
44 WEBROOT="`grep '^DocumentRoot' /etc/apache/conf/apache.conf | cut -d\ -f2`"
45 # give it a nice default
46 [ -z "${WEBROOT}" ] && WEBROOT=/home/httpd/htdocs
47 fi
48 fi
49
50 echo "Setting GENTOO_SRCDIR to $GENTOO_SRCDIR"
51 echo "Setting WEBROOT to $WEBROOT"
52 echo "${WEBROOT}" > ${T}/webroot
53
54 cd ${WORKDIR}/${P}
55 if [ -n "$GENTOO_SRCDIR" ]
56 then
57 ln -s "${GENTOO_SRCDIR}" gentoo-src || die
58 else
59 echo "GENTOO_SRCDIR $GENTOO_SRCDIR"
60 cvs -d /home/cvsroot co gentoo-src
61 fi
62 }
63
64 src_install() {
65 export WEBROOT="`cat ${T}/webroot`"
66 dodir ${WEBROOT}/doc
67 dodir ${WEBROOT}/projects
68 insinto ${WEBROOT}/doc
69
70 local x
71 local y
72 for y in en es fr
73 do
74 cd ${S}/xml/doc/${y}
75 for x in *.xml
76 do
77 x=`basename ${x} .xml`
78 xsltproc $TEMPLATE ${x}.xml > ${D}${WEBROOT}/doc/${x}.html || die
79 done
80 done
81
82 cd ${S}
83 cp txt/firewall ${D}${WEBROOT}/doc/
84 dodir ${WEBROOT}/images
85 insinto ${WEBROOT}/images
86 cp -a ${S}/images ${D}/${WEBROOT}
87 local x
88 cd images
89 for x in shots/desktop*.png
90 do
91 [ "${x%*small.png}" != "${x}" ] && continue
92 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
93 done
94
95 insinto ${WEBROOT}
96 doins favicon.ico
97
98 cd ${S}
99 doins css/main-new.css css/resume.css
100
101 #dynamic firewalls tools page
102 xsltproc $TEMPLATE xml/dynfw.xml > ${D}${WEBROOT}/projects/dynfw.html || die
103 xsltproc $TEMPLATE xml/project-xml.xml > ${D}${WEBROOT}/projects/xml.html || die
104
105 #resume
106 xsltproc xsl/resume-html.xsl xml/resume.xml > ${D}${WEBROOT}/resume.html || die
107
108 #both URLs should work
109 dodir ${WEBROOT}/projects/keychain
110 xsltproc $TEMPLATE xml/keychain.xml > ${D}${WEBROOT}/projects/keychain.html || die
111 xsltproc $TEMPLATE xml/keychain.xml > ${D}${WEBROOT}/projects/keychain/index.html || die
112
113 insinto ${WEBROOT}/projects
114 doins dynfw/dynfw-1.0.1.tar.gz
115
116 cd ..
117 tar czvf ${D}${WEBROOT}/projects/guide-xml-latest.tar.gz gentoo-web
118 cd ${S}
119 dodir ${WEBROOT}/news
120 local mydate
121 mydate=`date +"%d %b %Y"`
122 echo "<?xml version='1.0'?>" > ${T}/main-news.xml
123 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
124 echo "<version>1.0</version><date>${mydate}</date><newsitems>" >> ${T}/main-news.xml
125 local myext
126 for x in `find xml/news -iname 200*.xml | sort -r`
127 do
128 myext=`basename $x`
129 myext=${myext%*.xml}
130 cat $x | sed -e "1d" -e "s:<news:<news external=\"/news/${myext}.html\":" >> ${T}/main-news.xml
131 xsltproc xsl/guide-main.xsl $x > ${D}/${WEBROOT}/news/${myext}.html
132 done
133 echo "</newsitems></mainpage>" >> ${T}/main-news.xml
134 insinto ${WEBROOT}
135 xsltproc $TEMPLATE ${T}/main-news.xml > ${D}${WEBROOT}/index.html || die
136 xsltproc $TEMPLATE xml/main-about.xml > ${D}${WEBROOT}/index-about.html || die
137 xsltproc $TEMPLATE xml/main-download.xml > ${D}${WEBROOT}/index-download.html || die
138 xsltproc $TEMPLATE xml/main-projects.xml > ${D}${WEBROOT}/index-projects.html || die
139 xsltproc $TEMPLATE xml/main-docs.xml > ${D}${WEBROOT}/index-docs.html || die
140 xsltproc $TEMPLATE xml/main-articles.xml > ${D}${WEBROOT}/index-articles.html || die
141 xsltproc $TEMPLATE xml/main-contract.xml > ${D}${WEBROOT}/index-contract.html || die
142 xsltproc $TEMPLATE xml/main-graphics.xml > ${D}${WEBROOT}/index-graphics.html || die
143 OLDROOT=${ROOT} ; unset ROOT
144
145 ROOT=${OLDROOT}
146
147
148 #install XSL for later use
149 dodir ${WEBROOT}/xsl
150 insinto ${WEBROOT}/xsl
151 cd ${S}/xsl
152 doins cvs.xsl guide-main.xsl
153
154 #install snddevices script
155 dodir ${WEBROOT}/scripts
156 insinto ${WEBROOT}/scripts
157 cd ${S}/scripts
158 doins snddevices
159
160 dobin ${DISTDIR}/cvs2cl.pl
161 dosbin ${S}/bin/cvslog.sh
162
163 insinto ${WEBROOT}
164 doins ${S}/txt/robots.txt
165
166 cd ${D}
167 chmod -R +r *
168
169 insinto ${WEBROOT}/snapshots
170 newins ${S}/html/index.html-snapshots index.html
171 }
172
173 pkg_preinst() {
174 export WEBROOT="`cat ${T}/webroot`"
175 if [ -d ${WEBROOT}.bak ]
176 then
177 rm -rf ${WEBROOT}.bak
178 fi
179 if [ -d ${WEBROOT} ]
180 then
181 cp -ax ${WEBROOT} ${WEBROOT}.bak
182 fi
183 if [ "`hostname`" = "chiba.3jane.net" ]
184 then
185 echo '>>> Syncing up images to ibiblio...'
186 source ~drobbins/.ssh-agent-chiba.3jane.net
187 rsync --delete -ave ssh ${D}/${WEBROOT}/images/ drobbins@login.ibiblio.org:gentoo/images/
188 fi
189
190 #do some python goodness outside of the firewall
191 #This can only be done in ${T} since ${S} may be a live CVS tree
192 python ${S}/python/gendevlistxml.py ${S}/txt/devlist.txt ${T}/main-devlist.xml || die
193 xsltproc $TEMPLATE ${T}/main-devlist.xml > ${D}${WEBROOT}/index-devlist.html || die
194 cd ${T}
195 mkdir -p xml/packages
196 dodir ${WEBROOT}/packages/
197 insinto ${WEBROOT}/packages/
198 #we're getting bonkers stuff in the main packages pages, so lets make sure it's empty
199 python ${S}/python/genpkgxml.py ${T}/main-packages-old-style.xml || die
200 python ${S}/python/genpkgxml-v2.py ${T}/main-packages.xml || die
201 for DIR in `ls xml/packages`
202 do
203 dodir ${WEBROOT}/packages/${DIR}
204 for FILE in `ls xml/packages/${DIR}`
205 do
206 FILE=${FILE%.xml}
207 echo -n "."
208 xsltproc $TEMPLATE xml/packages/${DIR}/${FILE}.xml > ${D}/${WEBROOT}/packages/${DIR}/${FILE}.html || die
209 done
210 done
211 xsltproc $TEMPLATE ${T}/main-packages.xml > ${D}${WEBROOT}/index-packages.html || die
212 xsltproc $TEMPLATE ${T}/main-packages-old-style.xml > ${D}${WEBROOT}/index-packages-old.html || die
213 }

  ViewVC Help
Powered by ViewVC 1.1.20