Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
202 lines (183 sloc) 9.16 KB
<?xml version="1.0"?>
<project name="rssowl" default="bootstrap" basedir=".">
<description>Builds a Debian package of RSSOwl 2</description>
<!-- PROPERTIES //-->
<property file="project.properties"/>
<property file="private.properties"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="deb" location="debian"/>
<property name="src" location="src"/>
<property name="dl" location="downloads"/>
<!-- CLASSPATH //-->
<path id="classpath">
<fileset dir="lib" includes="*.jar"/>
</path>
<path id="svnant.classpath">
<fileset dir="lib/svnant-1.3.0/lib">
<include name="*.jar"/>
</fileset>
</path>
<!-- TYPEDEFS //-->
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" />
<taskdef resource="ant_deb_task.properties" classpathref="classpath"/>
<!-- TARGETS //-->
<target name="bootstrap" depends="clean, download-binary-all, dist-all, create-debian-repos"></target>
<target name="download-binary-all" depends="download-binary-x86, download-binary-x86-64"></target>
<target name="dist-all" depends="dist-x86, dist-x86-64"></target>
<target name="get-src-by-svn" depends="" description="svn checkout latest src to ${src} dir">
<condition property="srcDirAvailavle">
<available file="${src}"/>
</condition>
<condition property="srcDirNotAvailavle">
<not>
<available file="${src}"/>
</not>
</condition>
<antcall target="-svn-sw"/>
<antcall target="-svn-co"/>
</target>
<target name="-svn-sw" if="srcDirAvailavle">
<svn svnkit="false" javahl="false">
<switch url="${svn.url}" path="${src}" />
</svn>
</target>
<target name="-svn-co" if="srcDirNotAvailavle">
<svn svnkit="false" javahl="false">
<checkout url="${svn.url}" revision="HEAD" destPath="${src}" />
</svn>
</target>
<target name="svn-info">
<svn>
<wcVersion path="${src}/rssowl" />
</svn>
<echo message= "Subversion repository url: ${repository.url}" />
</target>
<target name="download-binary-x86" description="get and unzip upstream project">
<mkdir dir="${dl}"/>
<mkdir dir="${build}/x86"/>
<echo>Downloading ${download.src.x86}</echo>
<get src="${download.src.x86}" dest="${dl}/${download.dest.x86}"/>
<unzip src="${dl}/${download.dest.x86}" dest="${build}/x86"/>
</target>
<target name="download-binary-x86-64" description="get and unzip upstream project">
<mkdir dir="${dl}"/>
<mkdir dir="${build}"/>
<mkdir dir="${build}/x86_64"/>
<echo>Downloading ${download.src.x86_64}</echo>
<get src="${download.src.x86_64}" dest="${dl}/${download.dest.x86_64}"/>
<unzip src="${dl}/${download.dest.x86_64}" dest="${build}/x86_64"/>
</target>
<target name="build-available" description="checks if build is available">
<available file="${build}" property="isAvail" />
<fail unless="isAvail" message="Build dir doesn't exist!" />
</target>
<target name="dist-x86" depends="build-available" description="build the deb package x86">
<desktopentry
toFile="${build}/x86/${package.name}/RSSOwl.desktop"
name="RSSOwl"
comment="Newsreader for RSS / RDF / Atom Newsfeeds"
icon="/usr/share/pixmaps/rssowl.xpm"
exec="/usr/bin/rssowl"
path="/usr/share/${package.name}"
categories="Network;News;Java;GTK"
/>
<mkdir dir="${dist}"/>
<copy file="${build}/x86/${package.name}/RSSOwl" tofile="${build}/x86/${package.name}/rssowl.bin"/>
<copy file="${build}/x86/${package.name}/icon.xpm" tofile="${build}/x86/${package.name}/rssowl.xpm"/>
<copy file="${deb}/copyright" tofile="${build}/x86/${package.name}/copyright"/>
<copy file="${deb}/menu/rssowl" tofile="${build}/x86/${package.name}/menu/rssowl"/>
<copy file="${deb}/changelog" tofile="${build}/x86/${package.name}/changelog"/>
<copy file="${deb}/rssowl" tofile="${build}/x86/${package.name}/rssowl"/>
<deb
todir="${dist}"
package="${package.name}"
section="news"
architecture="i386"
depends="${depends}">
<version upstream="${version}" debian="${debian.version}"/>
<maintainer name="${maintainer.name}" email="${maintainer.email}"/>
<description synopsis="${description.synopsis}">${description.body}</description>
<tarfileset file="${build}/x86/${package.name}/rssowl.bin" prefix="usr/share/${package.name}" filemode="755"/>
<tarfileset file="${build}/x86/${package.name}/rssowl" prefix="usr/bin" filemode="755"/>
<tarfileset file="${build}/x86/${package.name}/rssowl.xpm" prefix="usr/share/pixmaps"/>
<tarfileset file="${build}/x86/${package.name}/menu/rssowl" prefix="usr/share/menu"/>
<tarfileset dir="${build}/x86/${package.name}/plugins" prefix="usr/share/${package.name}/plugins"/>
<tarfileset dir="${build}/x86/${package.name}/features" prefix="usr/share/${package.name}/features"/>
<tarfileset dir="${build}/x86/${package.name}/configuration" prefix="usr/share/${package.name}/configuration"/>
<tarfileset dir="${build}/x86/${package.name}" prefix="usr/share/doc/${package.name}">
<include name="about.html"/>
<include name="about_files/**"/>
<include name="changelog"/>
</tarfileset>
<tarfileset file="${build}/x86/${package.name}/RSSOwl.desktop" prefix="usr/share/applications"/>
</deb>
</target>
<target name="dist-x86-64" depends="build-available" description="build the deb package x86-64">
<desktopentry
toFile="${build}/x86_64/${package.name}/RSSOwl.desktop"
name="RSSOwl"
comment="Newsreader for RSS / RDF / Atom Newsfeeds"
icon="/usr/share/pixmaps/rssowl.xpm"
exec="/usr/bin/rssowl"
path="/usr/share/${package.name}"
categories="Network;News;Java;GTK"
/>
<mkdir dir="${dist}"/>
<copy file="${build}/x86_64/${package.name}/RSSOwl" tofile="${build}/x86_64/${package.name}/rssowl.bin"/>
<copy file="${build}/x86_64/${package.name}/icon.xpm" tofile="${build}/x86_64/${package.name}/rssowl.xpm"/>
<copy file="${deb}/copyright" tofile="${build}/x86_64/${package.name}/copyright"/>
<copy file="${deb}/menu/rssowl" tofile="${build}/x86_64/${package.name}/menu/rssowl"/>
<copy file="${deb}/changelog" tofile="${build}/x86_64/${package.name}/changelog"/>
<copy file="${deb}/rssowl" tofile="${build}/x86_64/${package.name}/rssowl"/>
<deb
todir="${dist}"
package="${package.name}"
section="news"
architecture="amd64"
depends="${depends}">
<version upstream="${version}" debian="${debian.version}"/>
<maintainer name="${maintainer.name}" email="${maintainer.email}"/>
<description synopsis="${description.synopsis}">${description.body}</description>
<tarfileset file="${build}/x86_64/${package.name}/rssowl.bin" prefix="usr/share/${package.name}" filemode="755"/>
<tarfileset file="${build}/x86_64/${package.name}/rssowl" prefix="usr/bin" filemode="755"/>
<tarfileset file="${build}/x86_64/${package.name}/rssowl.xpm" prefix="usr/share/pixmaps"/>
<tarfileset file="${build}/x86_64/${package.name}/menu/rssowl" prefix="usr/share/menu"/>
<tarfileset dir="${build}/x86_64/${package.name}/plugins" prefix="usr/share/${package.name}/plugins"/>
<tarfileset dir="${build}/x86_64/${package.name}/features" prefix="usr/share/${package.name}/features"/>
<tarfileset dir="${build}/x86_64/${package.name}/configuration" prefix="usr/share/${package.name}/configuration"/>
<tarfileset dir="${build}/x86_64/${package.name}" prefix="usr/share/doc/${package.name}">
<include name="about.html"/>
<include name="about_files/**"/>
<include name="changelog"/>
</tarfileset>
<tarfileset file="${build}/x86_64/${package.name}/RSSOwl.desktop" prefix="usr/share/applications"/>
</deb>
</target>
<target name="create-debian-repos">
<exec executable="${deb}/create-repos.sh">
<arg value="${gpg.passphrase}"/>
</exec>
</target>
<target name="deploy-debian-repos">
<echo>Use ant -lib /usr/share/java/commons-net2.jar deploy-debian-repos</echo>
<ftp server="${ftp.host}"
userid="${ftp.user}"
password="${ftp.password}"
remotedir="/ubuntu">
<fileset dir="repo/rssowl/ubuntu"/>
</ftp>
<ftp server="${ftp.host}"
userid="${ftp.user}"
password="${ftp.password}"
remotedir="/debian">
<fileset dir="repo/rssowl/debian"/>
</ftp>
</target>
<target name="clean" description="remove all work folders">
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete dir="${src}"/>
<delete dir="${dl}"/>
</target>
</project>