3 # Ruby script for generating amaroK tarball releases from KDE SVN
5 # (c) 2005 Mark Kretschmann <markey@web.de>
6 # Some parts of this code taken from cvs2dist
7 # License: GNU General Public License V2
11 egmodule = "kdereview"
15 svnbase = "svn+ssh://toma@svn.kde.org/home/kde"
16 svnroot = "#{svnbase}/trunk"
17 adminroot = "#{svnbase}/branches/KDE/3.5"
22 #----------------------------------------------------------------
24 folder = name + "-" + version
25 addPo = [name] + addPo
26 addDocs = [name] + addDocs
28 # Prevent using unsermake
29 oldmake = ENV["UNSERMAKE"]
30 ENV["UNSERMAKE"] = "no"
32 puts "Fetching #{egmodule}/#{name}..."
33 # Remove old folder, if exists
34 `rm -rf #{folder} 2> /dev/null`
35 `rm -rf folder.tar.bz2 2> /dev/null`
40 `svn co -N #{svnroot}/#{egmodule}`
51 `echo 'DO_NOT_COMPILE="$DO_NOT_COMPILE doc"' >> doc/configure.in.in`
54 `svn co #{adminroot}/kde-common/admin`
58 puts "Fetching l10n docs for #{egmodule}/#{name}...\n"
61 i18nlangs = `svn cat #{svnroot}/l10n/subdirs`
66 i18nlangsCleaned += [l];
69 i18nlangs = i18nlangsCleaned
81 docdirname = "l10n/#{lang}/docs/playground-utils/#{dg}"
83 `svn co -q #{svnroot}/#{docdirname} > /dev/null 2>&1`
85 next unless FileTest.exists?( dg )
86 print "Copying #{lang}'s #{dg} documentation over... "
87 `cp -R #{dg}/ ../doc/#{lang}_#{dg}`
89 # we don't want KDE_DOCS = AUTO, cause that makes the
90 # build system assume that the name of the app is the
91 # same as the name of the dir the Makefile.am is in.
92 # Instead, we explicitly pass the name..
93 makefile = File.new( "../doc/#{lang}_#{dg}/Makefile.am", File::CREAT | File::RDWR | File::TRUNC )
94 makefile << "KDE_LANG = #{lang}\n"
95 makefile << "KDE_DOCS = #{dg}\n"
103 puts "Fetching l10n po for #{egmodule}/#{name}...\n"
106 Dir.chdir( ".." ) # in egmodule now
111 for lang in i18nlangs
117 pofilename = "l10n/#{lang}/messages/playground-utils/#{dg}.po"
118 `svn cat #{svnroot}/#{pofilename} 2> /dev/null | tee l10n/#{dg}.po`
119 next if FileTest.size( "l10n/#{dg}.po" ) == 0
121 if !FileTest.exist?( dest )
125 print "Copying #{lang}'s #{dg}.po over .. "
126 `mv l10n/#{dg}.po #{dest}`
129 makefile = File.new( "#{dest}/Makefile.am", File::CREAT | File::RDWR | File::TRUNC )
130 makefile << "KDE_LANG = #{lang}\n"
131 makefile << "SUBDIRS = $(AUTODIRS)\n"
132 makefile << "POFILES = AUTO\n"
140 makefile = File.new( "po/Makefile.am", File::CREAT | File::RDWR | File::TRUNC )
141 makefile << "SUBDIRS = $(AUTODIRS)\n"
150 # Remove SVN data folder
151 `find -name ".svn" | xargs rm -rf`
154 Dir.chdir( ".." ) # name-version
157 # Move some important files to the root folder
158 Dir.chdir( "#{name}" )
159 `/bin/mv -f src/#{name}.lsm ..`
160 `/bin/mv -f AUTHORS ..`
161 `/bin/mv -f COPYING ..`
162 `/bin/mv -f INSTALL ..`
163 `/bin/mv -f ChangeLog ..`
165 #`/bin/mv -f README ..`
167 #`/bin/mv -f HACKING ..`
168 `/bin/rm release_rsibreak.rb makechangelog ../INDEX ../README icons/artwork-v1.tar.gz icons/artwork-v2.tar.gz`
169 `/bin/rm icons/artwork-v3.tar.gz`
177 puts "Generating Makefiles.. "
179 # Remove that ugly warning which is added just because we sit in playground
180 `echo "AUTOMAKE_OPTIONS = foreign" > Makefile.am.in`
181 `echo "DISTCLEANFILES = inst-apps" >> Makefile.am.in`
182 `echo "include admin/deps.am" >> Makefile.am.in`
183 `echo "include admin/Doxyfile.am" >> Makefile.am.in`
185 ENV["ACLOCAL"]="aclocal"
186 ENV["AUTOCONF"]="autoconf"
188 `make -f Makefile.cvs`
191 `rm -rf autom4te.cache`
197 puts "Compressing.. "
198 Dir.chdir( ".." ) # root folder
199 `tar -jcf #{folder}.tar.bz2 #{folder}`
204 ENV["UNSERMAKE"] = oldmake